-
1. Re: Issue while deploying EJB 3 with JBoss AS 7
swd847 Jun 19, 2012 3:43 AM (in response to manoj.m.agarwal)Does your deployment contain OSGI manifests?
-
2. Re: Issue while deploying EJB 3 with JBoss AS 7
manoj.m.agarwal Jun 19, 2012 5:11 AM (in response to swd847)No...it doesn't. If it needs to have OSGI then please let me know how to do it because i am not much aware of it.
Thanks !
-
3. Re: Issue while deploying EJB 3 with JBoss AS 7
lafr Jun 19, 2012 5:12 AM (in response to manoj.m.agarwal)Can you show us the code of the bean?
You're using any xml files in you deployment unit?
Show us a jar -tvf xyz-startup-bean-3.0.0-SNAPSHOT.jar.
-
4. Re: Issue while deploying EJB 3 with JBoss AS 7
manoj.m.agarwal Jun 19, 2012 5:35 AM (in response to lafr)Hi Frank,
I was following another thread where you suggested EJB option for invoking something while JBoss startup .(https://community.jboss.org/thread/201070)
Jaikiran made a correction in your suggestion, and now this error is gone but another issue is surfaced.....
Now my jar is getting deployed but init method(annotated with @PostConstruct) is not getting invoke.
This is my bean class...
package com.abc.xyz;
import javax.annotation.PostConstruct;
import javax.ejb.Startup;
import javax.inject.Singleton;
@Singleton
@Startup
public class xyzStartupBean
{public xyzStartupBean()
{
System.out.println("bean instance created");
}
@PostConstruct
public void init()
{
System.out.println("post construct....");
}
}Attached is the output of jar-tvf .................
0 Tue Jun 19 14:45:34 IST 2012 META-INF/
214 Tue Jun 19 14:45:32 IST 2012 META-INF/MANIFEST.MF
0 Tue Jun 19 14:45:34 IST 2012 com/
0 Tue Jun 19 14:45:34 IST 2012 com/abc/
0 Tue Jun 19 14:45:34 IST 2012 com/abc/xyz/
714 Tue Jun 19 14:45:34 IST 2012 com/abc/xyz/XyzStartupBean.class
395 Tue Jun 19 14:45:34 IST 2012 META-INF/ejb-jar.xml
1667 Tue Jun 19 14:45:34 IST 2012 META-INF/harvest.sig
0 Tue Jun 19 14:45:36 IST 2012 META-INF/maven/
0 Tue Jun 19 14:45:36 IST 2012 META-INF/maven/xyz/
0 Tue Jun 19 14:45:36 IST 2012 META-INF/maven/xyz/xyz-startup-bean/
1649 Tue Jun 19 11:30:54 IST 2012 META-INF/maven/xyz/xyz-startup-bean/pom.xml
124 Tue Jun 19 14:45:34 IST 2012 META-INF/maven/xyz/xyz-startup-bean/pom.propertiesIn ejb-jar.xml i have just <display-name> and MANIFEST.MF have just version.
Please let me know if i need to do some explicit configuration, so that init() get invoke while JBoss startup.
Thanks !
-
5. Re: Issue while deploying EJB 3 with JBoss AS 7
jaikiran Jun 19, 2012 5:38 AM (in response to manoj.m.agarwal)import javax.inject.Singleton;
Wrong import! It should be javax.ejb.Singleton.
-
6. Re: Issue while deploying EJB 3 with JBoss AS 7
manoj.m.agarwal Jun 19, 2012 5:54 AM (in response to jaikiran)Hi Jaikiran,
I corrected the import stmnt...now i am ending up with the same exception what i posted in the starting of this thread
-
7. Re: Issue while deploying EJB 3 with JBoss AS 7
dmlloyd Jun 19, 2012 9:31 AM (in response to manoj.m.agarwal)1 of 1 people found this helpfulA NullPointerException is always a bug. That said, it would be helpful if you could open a JIRA at http://issues.jboss.org/browse/AS7 containing the stack trace and an EJB JAR which reproduces the issue, along with the corresponding source code.
Thanks!
-
8. Re: Issue while deploying EJB 3 with JBoss AS 7
manoj.m.agarwal Jun 21, 2012 5:18 AM (in response to dmlloyd)I opened a JIRA bug for it.
Thanks David