cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Bean to j2ee library

Former Member
0 Kudos

I am trying to add a session bean to a j2ee library project. I can successfully add the

jar file containing the bean to the j2ee library and deploy the resulting sda file. The bean however does not appear in the JNDI registry.

If I add the bean to an enterprise application project (EAR) and deploy the ear file,the bean is successfully registered in the JNDI registry.

My question is whether it is at all possible to have a bean in a j2ee library?

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks Maksim

I thought as much.

The scenario goes like this.

I have a common application with a session bean that handles MQ requests. This is called from other beans. If I reference the common application from these beans the jar file for the common app is included in the EAR file for every bean. The common app jar file is then deployed with each bean.

Is this a normal thing or how would I make it cleaner?

Rod

ravi_raman2
Active Contributor
0 Kudos

Rodney,

ejb`s are deployed, ..not added..so the answer would be yes and no, yes it is possible to have a bean in a j2ee library, however it should be deployed and thus added..not added.

That is the reason for it not appearing in the jndi registry, check the deployment descriptor for the bean..for more details..

Regards

Ravi Raman

former_member182372
Active Contributor
0 Kudos

Rodney, it is not correct to place EJB`s in library. EJB requires special deployment descriptor for appropriate container and library doesnt` have it. What is the reason which forced you to use library instead of EAR for EJB packaging?