• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB2 to EJB3 migration question.

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have my beans written in 2.x. I have a project to convert the session beans (stateless) from 2.x to 3.0.

As soon as I put the below line, the compile breaks at this line.

import javax.ejb.Stateless;

As a result, I cannot use annotation such as: @Stateless in the code. Can someone tell me what am I doing wrong? I am using JBOSS4.0.1sp1 currently with this web application.

Also, how do i find if my EJBs are 2.0 or 2.1?

In the existing code, I do see: ejbCreate(), ejbActivate(), ejbPassivate(), ejbRemove() code used and no annotations used, so I know it is not EJB 3.0.

Also, in the same JobServiceBean.java file, I do below code:

* @ejb.bean type="Stateless"
* name="JobService"
* jndi-name="JobService"
*
* @ejb.ejb-ref
* ejb-name="FileService"
* view-type="local"
* ref-name=""FileService"
*
* @ejb.env-entry description="The path for middle-tier files."
* name="DTUMiddleTierDir"
* type="java.lang.String"
* value="/dtu/"

which is telling me it is Stateless. if I change it to Stateful, the bean becomes Stateful in the resulting (on the fly made) ejb-jar.xml.

Also, when I compile the code, on the fly using xdoclet, the following 4 files are being generated: JobService.java, JobServiceHome.java, JobServiceLocal.java, JobServiceLocalHome.java

Can someone tell me, what kind of bean am I dealing with? (is it remote/local home/localhome)?

I am new to Java, EJB world. I scanned through some documentations about EJBs. Any help would be appreciated. Thanks.
 
Ranch Hand
Posts: 138
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Prashant,
Please look at JBoss 4 documentation to see the EJB version supported.

As per their docs, "JBoss AS 4.2 and above supports EJB3 out of the box. Note that JBoss AS 5.0 supports the full EJB3 feature set".


 
prashant gandhi
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Prajakta. Found it. You are right. thanks.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic