not sure about ejb3, but shouldn't this be more like
in ejb2 this would be the proper prefix...
I think the problem I am having is relating to the way I packaged my ear file.
When I unpacked the ear and deployed only the jar file, I had no problem looking up the remote interfaces.
I would greatly appreciate if someone can help clarifying what I need in my ear file. O'Reilly's Enterprise JavaBeans 3.0 does not seem to address this at all.
Here is the structure of my ear file:
test.ear test-ds.xml test.jar META-INF application.xml MANIFEST.MF
My application.xml contains the following:
<?xml version="1.0" encoding="UTF-8"?> <application> <display-name>test</display-name> <description>Test Project</description> <!-- The EJB-JAR --> <!-- TODO: JBoss needs 'ejb' element but the spec requires 'persistence' --> <module> <!-- <ejb>test.jar</ejb> --> <persistence>test.jar</persistence> </module> </application>
And my test-ds.xml is as followed:
<?xml version="1.0" encoding="UTF-8"?> <datasources> <local-tx-datasource> <jndi-name>testDS</jndi-name> <connection-url>jdbc:sqlserver://localhost:1814;databaseName=test;selectMethod=cursor;</connection-url> <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class> <user-name>***</user-name> <password>***</password> <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation> <min-pool-size>25</min-pool-size> <max-pool-size>100</max-pool-size> <blocking-timeout-millis>5000</blocking-timeout-millis> <idle-timeout-minutes>15</idle-timeout-minutes> <prepared-statement-cache-size>75</prepared-statement-cache-size> </local-tx-datasource> </datasources>
I think my test-ds.xml is OK because it worked with plain jar deployment. What else missing in my application.xml file?
Thanks for your help.
Have you give JNDI name to your EJB ?
During the déployment, you should see something like this :
[EjbModule] Deploying XXX [ProxyFactory] Bound EJB Home 'XXX' to jndi 'X_X' [EJBDeployer] Deployed: file:/C:/jboss-portal-2.4.1/server/default/deploy/XXX.jar
I thought with EJB3, the JNDI name should be defaulted the unqualified classname.
Do I need an explicit JNDI name if I were to deploy with EAR file? Deployment with JAR did not seem to require the JNDI names at all.
Hi the correct Lookup when deploying in an ear file must be:
Object authenRef = _intialCtx.lookup("<ear-file-without-extension>/AuthenticatorBean/remote");
in your case:
Object authenRef = _intialCtx.lookup("test/AuthenticatorBean/remote");
I had the same problem like you before ;-))