wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Eclipse, Sub WebApp 9, EJB3.0, MySQL combo... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Eclipse, Sub WebApp 9, EJB3.0, MySQL combo..." Watch "Eclipse, Sub WebApp 9, EJB3.0, MySQL combo..." New topic
Author

Eclipse, Sub WebApp 9, EJB3.0, MySQL combo...

Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
Wondering if anyone could help me with deploying my EJB3.0 JAR file for connecting to MySQL?

I found this example on the 'Net (http://www.webagesolutions.com/knowledgebase/javakb/jkb006/index.html)
Which seems pretty good for showing me the basics of creating my Entity Bean, Session Bean etc.

I followed the instructions, the only difference (that I can see) is that I am using MySQL.

The classes all compile and the JAR is built, and the JAR files now deploys but I get the following error in my LOG file:



Looks like it's to do with the EJB not being able to connect to my MySQL DB.
Here is the Persistence XML



Additional Info (for testing it merely set/get the firstname and an auto-generated ID:

Entity Bean


Interface Bean (Remote)


Session Bean (Stateless)


My InitialContext on the 'Client'

[code]
props.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
props.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
props.setProperty("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
props.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
/code]

Thank you in advance for any help! :-D

[ August 13, 2008: Message edited by: Keith Seller ]
[ August 13, 2008: Message edited by: Keith Seller ]
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9937
    
159



Have you deployed your datasource to point to the MySQL database. Here's what that article mentions:

The unit will use a data source with JNDI name jdbc/__default. This data source is automatically defined when Glassfish is installed. In real life, you will probably use a database such as MySQL, Oracle or DB2. In that case, you must first define a data source using the Glassfish administration console.


[My Blog] [JavaRanch Journal]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse, Sub WebApp 9, EJB3.0, MySQL combo...
 
Similar Threads
Websphere 7 and OpenJPA
EJB3.0 on Sun WebApp9.0 - dead end!
Any defect in the attached code
weblogic ejb
EJB3.0, mySQL, Queries & Entity Beans?