• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

EJB application deployment problem

 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am dying to deploy/run a simple EJB application.

I belive i got correct application server to deploy EJB3.0 application, i am using jboss-4.2.1.GA, from it's release notes i came to know it supports EJB3.0, please find the below link for that info.
http://sourceforge.net/project/shownotes.php?release_id=523619&group_id=22866

now my question is, why i am getting the below error at the time of deployment ?

DEBUG - 2008-08-13 09:51:12,215 [main] ejb.EJBDeployer (create:593) - Verifying file:/C:/jboss-4.2.1.GA/server/MigrationDomain/tmp/deploy/tmp27658PlaceBid.ear-contents/PlaceBidEJB.jar
WARN - 2008-08-13 09:51:12,247 [main] EJBDeployer.verifier (specViolation:588) - EJB spec violation:
Bean : PlaceBidBean
Section: 7.10.2
Warning: A Session bean must implement, directly or indirectly, the javax.ejb.SessionBean interface.

WARN - 2008-08-13 09:51:12,247 [main] EJBDeployer.verifier (specViolation:588) - EJB spec violation:
Bean : PlaceBidBean
Section: 7.10.3
Warning: A Session bean must define at least one ejbCreate method.

WARN - 2008-08-13 09:51:12,247 [main] EJBDeployer.verifier (specViolation:588) - EJB spec violation:
Bean : PlaceBidBean
Section: 7.10.1
Warning: The session bean must implement either a remote home and remote, or a local home and a local interface.

DEBUG - 2008-08-13 09:51:12,262 [main] util.NestedThrowable (create:977) - org.jboss.util.NestedThrowable.parentTraceEnabled=true
DEBUG - 2008-08-13 09:51:12,262 [main] util.NestedThrowable (create:977) - org.jboss.util.NestedThrowable.nestedTraceEnabled=false
DEBUG - 2008-08-13 09:51:12,262 [main] util.NestedThrowable (create:977) - org.jboss.util.NestedThrowable.detectDuplicateNesting=true
ERROR - 2008-08-13 09:51:12,247 [main] deployment.MainDeployer (create:977) - Could not create deployment: file:/C:/jboss-4.2.1.GA/server/MigrationDomain/tmp/deploy/tmp27658PlaceBid.ear-contents/PlaceBidEJB.jar
org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:610)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
DEBUG - 2008-08-13 09:51:12,262 [main] scanner.URLDeploymentScanner (deploy:429) - Failed to deploy: org.jboss.deployment.scanner.URLDeploymentScanner$DeployedURL@3eaa71bb{ url=file:/C:/jboss-4.2.1.GA/server/MigrationDomain/deploy/PlaceBid.ear, deployedLastModified=0 }
org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:610)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)


i suspect this server follows EJB2.0 specification, but how come it's release notes specifies it supports EJB3.0, do i need to modify any thing in my code to make it work. Please help me out.
please find my code in below post, unfortunately it has been moved to BEA/weblogic category.
https://coderanch.com/t/421092/BEA-Weblogic/unable-deploy-EJB-component

Requesting for help.
[ August 13, 2008: Message edited by: Garla Ravi ]
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JBoss-4.2.1 does support EJB3. Post the output of the following commands:



and



Also post the contents of your application.xml. In your PlaceBidEJB.jar do you have a ejb-jar.xml? (Its not mandatory).

P.S: The latest stable version of JBoss is 4.2.3 GA. Its always better to use the latest stable version. But as far as this error is concerned, it's not because of the JBoss version.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also post the entire logs, that you see on the console (from the point when you start JBoss). While posting logs or xml content or code, remember to wrap it in a code block.
 
Garlapati Ravi
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much Jaikiran,

i think i am nearing, it deployed properly after removing ejb-jar.xml. But i am unable to access the application, i got below exception on browser :

META-INF/
META-INF/MANIFEST.MF
META-INF/application.xml
PlaceBidEJB.jar
PlaceBidWeb.war

META-INF/
META-INF/MANIFEST.MF
com/
com/ravi/
com/ravi/bidding/
com/ravi/bidding/ejb/
com/ravi/bidding/ejb/PlaceBid.class
com/ravi/bidding/ejb/PlaceBidBean.class
PlaceBid.java
PlaceBidBean.java
Also post the entire logs, that you see on the console (from the point when you start JBoss).

[ August 13, 2008: Message edited by: Garla Ravi ]
 
Garlapati Ravi
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
application.xml

web.xml


URL i am using to access the application :

[ August 13, 2008: Message edited by: Garla Ravi ]
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The logs dont show that the WAR files in the EAR is being deployed. Your application.xml looks incorrect:


It should be:



Change the application.xml and redeploy the application.
 
Ranch Hand
Posts: 329
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure your web application gets deployed without problems? Are there any log files where you can check that out (I am running JBoss under Linux and my logs are printed to a file instead of to the console)?
If you can't find more log information then you could try checking JBoss' jmx-console.

Also it would be useful if you post the PlaceBidServlet code.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

unfortunately it has been moved to BEA/weblogic category


Please understand that containers problems should be discussed at their respective forum, where you'll have more chances to find help.
 
Garlapati Ravi
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Jaikiran,

one step away.

After changing application.xml i could able to access my application, i think now it deployed properly, but i believe lookup is not happening, i guess EJBs are not registered with JNDI. what else need to be done. please help. I had a look in to log file, no exceptions regarding EJBs deployment.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

java.lang.NullPointerException
at com.ravi.bidding.PlaceBidServlet.service(PlaceBidServlet.java:14)



The NullPointerException is coming from the PlaceBidServlet code. Post the code of the service method. Check what line number 14 is doing in that code.
[ August 14, 2008: Message edited by: Jaikiran Pai ]
 
Garlapati Ravi
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can find all classes coding in the below post:
https://coderanch.com/t/421092/BEA-Weblogic/unable-deploy-EJB-component

my servlet code is as below:
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

@EJB
private com.ravi.bidding.ejb.PlaceBid placeBid;



In JBoss-4.2.x, the @EJB injection does not work in servlets. It works only in EJBs. JBoss-5 (which is still in a CR version) is a JavaEE5 server and the @EJB injection in servlets is going to work in JBoss-5 versions.

Your alternate option is to do a JNDI lookup of the bean in your service method instead of injecting it.
 
Garlapati Ravi
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your info, I wrote below code in servlet to lookup EJB. It throws an exception:

I doubt whether EJBs are registered in JNDI, any clues ?
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are using an incorrect jndi name for looking up the bean. Use the jmx-console to figure out the jndi-name of your bean and then use that string in the lookup().
 
Garlapati Ravi
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I didn't find anything regarding PlaceBidEJB.jar nor about EJB class name, everywhere i could see about PlaceBidWeb.war or PlaceBid.ear, but nothing about .jar file.

even checked for JNDI in complete jmx-console, no use. nothing about PlaceBid

did Ctrl+F for strings "PlaceBid" and "Place", everywhere it shows about web, nothing found about EJB/.jar file.

followed the steps in jmx-console link. no use.

anything else ?

please find below lines on my jboss console, nothing about .jar/EJB.

These are the lines i found on console regarding my application, don't find anything else. I belive it supposed to show something about .jar/ejb as well right ?

Any clues ?
[ August 15, 2008: Message edited by: Garla Ravi ]
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Post the code of your beans. Have you annotated them appropriately?
 
Garlapati Ravi
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you could find all classes of my application at below post:
https://coderanch.com/t/421092/BEA-Weblogic/unable-deploy-EJB-component
[ August 15, 2008: Message edited by: Garla Ravi ]
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From your other thread:

import javax.ejb30.Stateless;
@Stateless
....

import javax.ejb30.Local;
@Local
...



The imports are wrong. It should be javax.ejb.Stateless and same for the rest of the other imports. Where did you get that example from? I am surprised that it even compiled, unless ofcourse you created the javax.ejb30 package or is present in some jar in your application.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,

This is useful link to start EJB3.0 (By MZ)
http://java.boot.by/scbcd5-guide/apa.html
 
Garlapati Ravi
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You spot it correct man, thank you, i believe EJB module got deployed, but i am unable to trace out JNDI name, can we trace JNDI name from below log comments made on jboss console at deployment time, i was looking into jmx-console, i found MBean: jboss.j2ee:ear=PlaceBid.ear,jar=PlaceBidEJB.jar,name=PlaceBidBean,service=EJB3
any clues from this ?
I am using PlaceBidEJB by guessing it could be my JNDI name, but it throws me same exception :


I got javax.ejb30.* package from weblogic.jar of weblogic9.1, i removed it and replaced it with jboss-ejb3x.jar
[ August 15, 2008: Message edited by: Garla Ravi ]
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

14:14:14,174 INFO [EJBContainer] STARTED EJB: com.ravi.bidding.ejb.PlaceBidBean ejbName: PlaceBidBean



So now the bean has been deployed.

Follow this link again, access the JNDIView MBean and invoke the list method. Post the output that you see on the JNDI tree page, here.
 
Garlapati Ravi
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found lots of things, but i am posting only related to my application:

 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

+- PlaceBid (class: org.jnp.interfaces.NamingContext)
| +- PlaceBidBean (class: org.jnp.interfaces.NamingContext)
| | +- local (proxy: $Proxy65 implements interface com.ravi.bidding.ejb.PlaceBid,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)



Based on this, your lookup string should be "PlaceBid/PlaceBidBean/local" to get the local bean.
 
Garlapati Ravi
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank You very much 'Jaikiran Pai'. Happiest moment of the month. I could successfully deployed and accessed my first EJB3.0 application. If this doesn't work by any reason, i would have disappointed. I learned many things.

you are equally good at JBOSS as well, that's really cool.

thank you once again !
[ August 15, 2008: Message edited by: Garla Ravi ]
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad to know it worked
 
You don't like waffles? Well, do you like this tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic