I noticed a release note for RC9
[EJBTHREE-654] - remove hard coding of TransactionManager
I've also noticed that when running an embedded ejb3 app in Tomcat the jndi.properties file is not enough to make an initial context pick up the correct properties, and I need to do this to find anything that embedded ejb3 deployed:
Hashtable<String, String> props = new Hashtable<String, String>(); props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); props.put("java.naming.factory.initial", "org.jnp.interfaces.LocalOnlyContextFactory"); InitialContext ic = new InitialContext(props);
Perhaps there's an issue deep in there when looking up the transaction manager? I'm unsure of how to log this to JIRA... Is this an issue that should be logged to JIRA or am I doing something wrong configuring the JNDI for Tomcat?
i'm having the same issue: the new InitialContext() sometimes picks up the apache tomcat properties instead of the jboss ones...
what is the correct way to configure tomcat to use the jndi implementation supplied w/ jboss ejb3?
Just to be clear, the error I'm getting is caused when embedded jboss starts up and tries to find the TransactionManager. This isn't a call I'm making myself.
Allon, any of my own calls I have to pass in the jboss jndi properties explicitly.
Has anyone found a solution to this? I'm having the same problem the original poster reports, directly with the embedded-war example from the tutorial. I'm using Embeddable_ALPHA_9 and Tomcat 5.5.17 on a Windows XP machine.
I agree with the other posters that it is a JNDI properties problem, not in user code but in how the UserTransaction code finds the UserTransactionManager. So where should the jndi.properties file go?
The problem is not limited to Tomcat, it appears with Jetty also. I took the same standalone.war from the embedded-war example, as distributed with Embeddable_ALPHA_9, and deployed it in a fresh Jetty installation, and still get the JNDI error trying to find the TransactionManager during bootstraping of the UserTransaction.
Since it happens with Jetty, I doubt it is the Tomcat read-only JNDI service properties causing the problem. (I was sure not to use a Jetty configuration that included JNDI.) Maybe the TransactionManager is getting bound somewhere unexpected?
The problem occurs with the unmodified embedded-war example from Alpha9, and happens during the microcontainer's creation of the UserTransaction (as specified in embedded-jboss-beans.xml), long before it gets to any application level code.
Has anyone successfully deployed a war containing the embedded EJB 3 container? What's your trick?
Added a JIRA issue. I hope I did it right.
i am still fcing probelm