Brian,
I don't see any obvious issues with the code. I even tried a similar example of my local setup (JBoss-4.2.3 GA) and that worked without any issues. I was able to see the service in the jmx-console and even invoke the method.
Can you please post the exact code of your service, including all the import statements? Also can you post the console logs of JBoss?
While posting the logs or code or xml content, remember to wrap it in a code block using the Code button in the message editor window and please hit the Preview button to make sure your post is correctly formatted
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4173871#4173871
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4173871
anonymous wrote : org.jboss.util.NestedSQLException: Could not create connection; - nested
| throwable: (org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: oracle.jdbc.driver.OracleDriver, url: jdbc:oracle:thin:@srv06:1521:training
This error occurs when you have the connection URL incorrect (I don't remember exactly, but i think it even appears when the driver jar is not placed in the %JBOSS_HOME%\server\< serverName>\lib folder).
I don't know how it starts working without changing anything.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4173864#4173864
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4173864
How about changing your code to:
| InitialContext ctx = new InitialContext();
| NamingEnumeration<Binding> list = ctx.listBindings("persistence-units");
| while (list.hasMore()) {
| Binding nc = (Binding)list.next();
| System.out.println("Persistence Unit EMF is relative : " + nc.isRelative() + " name: " + nc.getName()+" [class: "+nc.getClassName()+"]");
|
| Object o = ctx.lookup("persistence-units/" + nc.getName());
|
| if(!(o instanceof EntityManagerFactory)) {
| System.out.println("No good; o instance of "+o.getClass().getName());
| }
| else {
| System.out.println("Got it again!");
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4173860#4173860
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4173860