Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ejb deployment issue

 
Arun Kumar
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am trying to deploy an application on jboss which was already running on weblogic server.

I am facing some issue in deploying the ejb which is bundled in an ear file.


there is this application.ear which has three components.

application.jar which bundles all the ejbs.

one.war

two.war

I am pasting the application.xml file here.




application.jar has the ejb-jar.xml

one element of it i will put here




I have added the jboss.xml in the jar file with the following input.




It cribs with the following error while deploying on jboss.


15:50:20,113 ERROR [org.jboss.deployment.MainDeployer] Could not start deployment: file:/C:/Test/4.3.0/server/citistreet.jms/tmp/deploy/tmp64688application.ear-contents/application.jar
org.jboss.deployment.DeploymentException: Failed to setup client ENC; - nested throwable: (org.jboss.deployment.DeploymentException: ejb-ref ejb/tpaServices_com_ing_tpa_services_UserServiceHome, expected either ejb-link in ejb-jar.xml or jndi-name in jboss.xml)
at org.jboss.deployment.ClientDeployer.start(ClientDeployer.java:175)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
 
Jeremy Whiting
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Arun,
The application server is having difficulty creating an Environment Naming Context (ENC) JNDI services associated with your application.

Arun Kumar wrote:
15:50:20,113 ERROR [org.jboss.deployment.MainDeployer] Could not start deployment: file:/C:/Test/4.3.0/server/citistreet.jms/tmp/deploy/tmp64688application.ear-contents/application.jar
org.jboss.deployment.DeploymentException: Failed to setup client ENC; - nested throwable: (org.jboss.deployment.DeploymentException: ejb-ref ejb/tpaServices_com_ing_tpa_services_UserServiceHome, expected either ejb-link in ejb-jar.xml or jndi-name in jboss.xml)
at org.jboss.deployment.ClientDeployer.start(ClientDeployer.java:175)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)


The JBoss server is expecting your enterprise application EAR file to include a file called "jboss-app.xml" bundled inside the META-INF directory. The jboss-app.xml file contains deployment meta data.
In your situation it looks very straight forward and a simple xml file will suffice.

I recommend you take a look at the documentation on the JBoss EJB3 Reference guide, depending on which version of AS you using 4/5 to understand what goes into the meta data file. Additionally the JBoss Application Server reference documentation.

EJB3 AS4, Chapter 7 "JBoss EJB 3.0 jboss.xml deployment descriptor"
http://www.jboss.org/ejb3/docs/reference/build/reference/en/html/

Here is the reference documentation explains the packaging of Enterprise Applications
http://www.jboss.org/file-access/default/members/jbossas/freezone/docs/Installation_And_Getting_Started_Guide/5/html/Sample_JSF_EJB3_Application.html#Sample_JSF_EJB3_Application-Configuration_and_Packaging

Regards,
Jeremy

SCJP, SCWCD
 
Arun Kumar
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeremy,

I added the jboss-app.xml


but it still give the problem I believe the problem is this application is also the client of all the jar that it is deploying using the home interfaces.

Therefore this has an application-client.xml one entry of it is as below.



I believe this is the problem if I delete the application-client.xml then the errors stop.


 
Jeremy Whiting
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Arun,
Yes the application-client.xml was not necessary. The web application is a "client" of the EJB beans and because the WARs and EJB jars are packaged in the same EAR file the server considers automatically the web WAR applications as clients.

Regards,
Jeremy
 
Arun Kumar
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeremy, I left the application-client.xml and added the jboss-client.xml and that fixes the issue. Now I am able to deploy the applicaiton without any issue.

Now I am getting the issue in resolving the jndi name for the ejb.

I have the following code in the ejb-jar.xml



and I have the following entry for this in the jboss-client.xml





I have opened the jmx console and see the following entry in the jmx console.




I tried all the permutation combination of the JNDI name to resolve it but could not.


 
Jeremy Whiting
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Arun,
Paste the exception stack trace please.

Regards,
Jeremy
 
Arun Kumar
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeremy for your continued help. I am pasting the stack trace here.

Application is using the properietry framework to loolup the ejb. The jndi name that I specified was "mainservlet/ejb/tpaServices_com_ing_tpa_services_ApplicationServiceHome"

I have also used all the below combinations.

"ejb/tpaServices_com_ing_tpa_services_ApplicationServiceHome"
"java:comp/env/ejb/tpaServices_com_ing_tpa_services_ApplicationServiceHome"
"java:comp/env/mainservlet/ejb/tpaServices_com_ing_tpa_services_ApplicationServiceHome"

Nothing worked till now.









 
Jeremy Whiting
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Arun,
Afraid I cannot explain what is happening. You mentioned you are using a proprietary framework to obtain the object from JNDI.
Have you contacted the vendor for support ?

Regards,
Jeremy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic