-
1. Re: Session bean using MySQL
joelvogt Sep 16, 2002 11:07 PM (in response to powertoaster)try including with your jboss.xml and ejb-jar.xml a jaws.xml. Otherwise jboss uses standardjaws.xml which only defines DefaultDS.
Basically find standardjaws.xml and make your own with only the mysql bits included. This is where you will want to define your custom finders later on too.
Hope this helps. -
2. Re: Session bean using MySQL
powertoaster Sep 17, 2002 4:01 AM (in response to powertoaster)Ok, I edited the standard jaws.xml and included a version for my bean in the META-INF.
The error that I am getting is:
java.rmi.ServerException: Bean exception. Notify the application administrator; nested exception is:
javax.ejb.EJBException: AgencyBean: Error connecting to jdbc/Agency:
javax.naming.NameNotFoundException: jdbc not bound; -
3. Re: Session bean using MySQL
pvamstel Sep 17, 2002 4:32 AM (in response to powertoaster)I had something simulair.
Try to get rid of the jdbc prefi in the jndi stuff and just name it. Maybe that will work.
Do not know why it does not work with jdbc/ infront of it
Or try java:/Name
In the jmx viewer you can get a list of all bound jndi names -
4. Re: Session bean using MySQL
rockinryan Sep 17, 2002 7:06 PM (in response to powertoaster)
Unless I am missing something (aside from not knowing what JBoss/Tomcat versions you are running) I'd say you only need to do this:
Change this:
dataSource = (DataSource)ic.lookup("jdbc/Agency");
To This:
dataSource = (DataSource)ic.lookup("java:/agencyDS");
I should note that in all my comparable examples and projects I DID NOT have any support in my ejb-jar.xml file. I also was not *required* to create jboss.xml so I didn't! (meaning it worked without one, so I didn't bother)
I simply defined the datasource in mysql-service.xml and then used the exact name that is output when deploying that xml file. (Of course not as my first try, but it made sense and worked immediately when I did.) It seems you are all set on the -service.xml file, if not let me know and I can gather more info.
As always, please post a follow up and let others know what works or what does not.
thanks & good luck,
Ryan -
5. Re: Session bean using MySQL
rockinryan Sep 17, 2002 7:12 PM (in response to powertoaster)
Unless I am missing something (aside from not knowing what JBoss/Tomcat versions you are running) I'd say you only need to do this:
Change this:
dataSource = (DataSource)ic.lookup("jdbc/Agency");
To This:
dataSource = (DataSource)ic.lookup("java:/agencyDS");
I should note that in all my comparable examples and projects I DID NOT have any support in my ejb-jar.xml file. I also was not *required* to create jboss.xml so I didn't! (meaning it worked without one, so I didn't bother)
I simply defined the datasource in mysql-service.xml and then used the exact name that is output when deploying that xml file. (Of course not as my first try, but it made sense and worked immediately when I did.) It seems you are all set on the -service.xml file, if not let me know and I can gather more info.
As always, please post a follow up and let others know what works or what does not.
thanks & good luck,
Ryan -
6. Re: Session bean using MySQL
powertoaster Sep 19, 2002 11:30 PM (in response to powertoaster)I made a mistake here the 'jdbc/agency' is actually 'java:/comp/env/jdbc/agency' in my bean. Which shows exactly like that in the jmx-console jndilist screen.