JavaFx 2.0 + EJB + Netbeans - Runtime Exception - exception

please,
I wrote a test app in JavaFx 2.0 + EJB in the Netbeans IDE and I got a problem running this app outside netbeans.
I have a form using FXML and an action of this form runs a EJB method. I am using the Glassfish Server.
When I run this test app on netbeans it works perfectly, but when I run the app outside of Netbeans like jnlp or in the browser ... the app can't access the EJB methods. I couldn't see the error message in webstart or in the browser. So, I ask:
1) How can I see the error message in a web start or in the browser? (like javaws test-app.jnlp)
2) I guess the error occurs because of classpath issues. (I need gf-client.jar and javaee-api-6.0.jar in the classpath in order the app works). How can I assure these jars are in the classpath?
Sorry by my english.
Thanks,
Cleber.

to see errors from jnlp you need to enable Java Console:
Control Panel - Java Properties - Advanced - Java Console - Enable Console
for jnlp case all external libs should be stated in jnlp file. Usually NetBeans do it for you, but you can debug this case by reviewing Java Console output.

Related

Constructor NotImplementedException?

I am starting and doing testing with PostSharp 6.9.4 Community version, upgrading from 3.0.27 Express. Everything is fine building in VS2017, but when we queue a new build in tfs we get this error:
c:\B1\Net\SEP TR dev Visual Studio 2017\Sources\src\projectName\projectName.csproj : error LA0014: The custom attribute 'Helpers.TimeTraceAspect' constructor threw the exception NotImplementedException: The method cannot be executed at build time.
What does it mean?
Same code works and builds fine in 3.0.27 but not in 6.9.4.
I have not found any information about this error in PostSharp's support page.
Thank you for your help.

Reference .netstandard 2.0 project in core 2.0 Runtime loading error when GenerateAssemblyInfo = false

When we add the reference, we are able to use the .netstandard libs classes in our .net core console project (in Visual Studio), and it compiles.
When we run the app, it immediately crashes with this error in the output window:
An unhandled exception of type 'System.IO.FileNotFoundException'
occurred in Unknown Module. Could not load file or assembly
'MyNetStandard20Assembly, Version=0.1.0.0, Culture=en-us,
PublicKeyToken=null'. The system cannot find the file specified.
Update / Cause (still looking for reason)
So we use AssemblyInfo files in our projects and in order to make these work with the new project structure we needed to add this to the first PropertyGroup in the .NET Standard project:
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
That then allows us to have a Properties/AssemblyInfo.cs file in the project, just like a .NET Framework project would allow.
Anyway, when we remove this from the .NET Standard project then the .NET Core project finds the assembly and is happy.
Does anyone know why?

Works on console project but not on ASP.NET project EF Core with MySql Connector

I have a weird problem here. I'm trying to access a MySql database with Entity Framework Core.
It works on the .NET console. but when the same code runs on the web app it says.
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[0]
An unhandled exception has occurred while executing the request
System.TypeLoadException: Method 'Clone' in type 'MySQL.Data.EntityFrameworkCore.Infraestructure.Internal.MySQLOptionsExtension' from assembly 'MySql.Data.EntityFrameworkCore, Version=8.0.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' does not have an implementation.
at Microsoft.EntityFrameworkCore.MySQLDbContextOptionsExtensions.UseMySQL[TContext]
at ConsoleApplication.EmployeesContextFactory.Create(String connectionString) in BooksController.cs:line 65
Here is my code
var optionsBuilder = new DbContextOptionsBuilder<EmployeesContext>();
optionsBuilder.UseMySQL(connectionString);
var context = new EmployeesContext(optionsBuilder.Options);
context.Database.EnsureCreated();
It gives me the exception on the method UseMySql() The same exact code works fine in the console.
Also connectionString, .NET Core version and many of the constraints that I can think of are the same.
EDIT
Seeing the difference The ASP.NET project has following Nugets
The console app has the following,
Both projects show it's target framework as 2.0
What's the right way to solve this issue?
Because the current MySQL connector only supports .NET Core 1, you might not be able to use it with v2.
You could try this package at https://github.com/jasonsturges/mysql-dotnet-core

Getting 'java.sql.SQLException: com.mysql.jdbc.Driver' with grails run-app (when BuildConfig.groovy doesn't need to be recompiled)

I've upgraded my grails application from 1.3.9 to 2.2.3 and then to 2.3.3. I read the release and upgrade notes for 1.3.9->2.2.3 and then from 2.2.3->2.3.3
I am using OpenJDK 6, Jetty 6 and the plugin jetty 1.1, MySQL 5.5 and I have the connector library under lib
Now my issue is if I run grails clean and then grails run-app the application runs without any problems but if I stop it and run grails run-app again I get a gigantic error (see here: http://pastebin.com/36MpXhir)
I also found that changing something like adding a space somewhere in BuildConfig.groovy (anything that makes it be recompiled) makes the application run normally.
Looking at the stacktrace the first thing that puzzles me is
[02.12.13 16:13:59.919] [main] pool.ConnectionPool Unable to create initial connections of pool.
java.sql.SQLException: com.mysql.jdbc.Driver
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254)
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:486)
at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:144)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy.afterPropertiesSet(LazyConnectionDataSourceProxy.java:162)
There are references to org.apache.tomcat even though I'm using jetty (and removed tomcat from BuildConfig.groovy).
Did anyone else encounter such a problem?
Don't put jar files in the lib directory if they're available in a public Maven repo. It's far better to download jars once and keep them in a local cache, and reuse them as needed.
The MySQL driver is used as the commented-out example in the generated BuildConfig.groovy - just un-comment it :) You might want to bump up the version to the latest, e.g.
dependencies {
runtime 'mysql:mysql-connector-java:5.1.27'
}
This is a good site for finding Maven artifacts: http://mvnrepository.com/artifact/mysql/mysql-connector-java
If you do have a jar that's not in a Maven repo (e.g. one with shared code at your company) then you can put it in the lib directory, but it's not auto-discovered. Run grails compile --refresh-dependencies to get it added to the classpath.
For me same error has occurred while running the Grails Application.Then I debug and view the code history of my code which was committed recently.
From that I found the issue that was:
Inside the controller file I send the instance with-out properly
Eg:
**def list=[personInstance.]---> error occurred.**
**render list as JSON**
Then I correct my mistake-->clean the app --> run the app
Now its working fine.

Problem hosting wcfservice on mydoamin.com

I have an asp.net and a wcf service created. I hosted wcfservice on localhost(IIS) and the as.net web application also on IIS. Both work fine. I want to host both wcf and my asp.net web application on a registered domain. But when I right click on wcf service & click on publish and eneter details of the site I got error
""The "IsCleanMSDeployPackageNeeded" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or
assembly
'Microsoft.Web.Deployment, Version=7.1.0.0,
Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or one of its
dependencies. The system
cannot find the file specified."
Affte googleing I installed MSwebdeplot v2 on my machine &
tried again. but this tiel I get error "Web deployment
task failed. (Attempt by method
'Microsoft.Web.Publishing.Tasks.VSMSDeployDriverInCmd.LogTrace
(Microsoft.Web.Deployment.DeploymentTraceEventArgs)' to access type
'Microsoft.Web.Deployment.DeploymentSyncParameterEventArgs' failed.) "
I tried to get solution from internet but no luck. pls help me. I have attached the screen shot also.
You need this: http://www.iis.net/download/WebDeploy