Skip to main content

Run from NetBeans works Stand alone doesnt

4 replies [Last post]
kenbarnesjr
Offline
Joined: 2008-02-07

Hello all I am using glassfish 9.1 with NB6.0. I have created a Javaweb start application that uses a database connection. When I build and run from netbeans the project will come up and work(I have the database and server on netbeans). but if i try to upload the jar file from the admin console it crashes when trying to get a connection to the db. I have tried getting the JNDI context but I cant because its a web start and I have tried hibernate to no avail. Why will it run with netbeans but not when i deploy using manager app. Thanks in advance.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
trekkyleaper
Offline
Joined: 2007-05-26

If you have server-side components that require a DB connection, you need to set up the connection pool. Netbeans does this automatically when you run it inside Netbeans, but you have to do it manually in the stand-alone world.

chrjohn
Offline
Joined: 2008-03-11

Hi,

maybe you have other libraries on your CLASSPATH in NetBeans than when you run GlassFish stand alone?
When it "crashes", do you see an stack trace? Can you post it?
What kind of application is this? Normally you should be able to do JNDI lookups via the Context.

Cheers
Chris

kenbarnesjr
Offline
Joined: 2008-02-07

It is a java web start application. There is no stack trace in the log when the table just comes up empty but I get a connection refused stack trace when i deploy. It is going for the initial context but its ran outiside of the server is what i think is giving me the problem
.

chrjohn
Offline
Joined: 2008-03-11

You can have almost anything in a JavaWebStart application... E.g. it is possible that you have EJBs in a WebStart app that also access a database table on the server.
Can you provide some more information?

Hmm, one thing that springs to my mind... Did you sign the JAR files that you deploy via WebStart?
Have a look here: http://weblogs.java.net/blog/lancea/archive/2007/06/using_java_web.html

Cheers
Chris