- This topic has 8 replies, 2 voices, and was last updated 20 years, 9 months ago by Scott Anderson.
-
AuthorPosts
-
vleninMember– System Setup ——————————-
Operating System and version: XP SP2
Eclipse version: 2.1.2
Eclipse build id: 200311030802
MyEclipse version: 2.7 RC2
Eclipse JDK version: 1.4.2_03
Application Server JDK version: 1.4.2_03– Message Body ——————————-
Hi,I am trying to deploy a J2EE project written with MyEclipse to Orion 2.0.2.
I wrote a very simple app with a Web project and a EJB module.
I configured the MyEclipse/XDoclet parameters as instructed in the Help docs.
I have a stateless session bean with 1 method I wrote. The rest of the bean is generated by XDoclet/MyEclipse.
In my web project I have a servlet that calls on the bean.
When I deploy (as an archive), I get the following error when I start Orion:
Error in application TTT: Error loading package at file:/C:/orion/application-autodeploy/TTT/TTTEJB.jar, com.mike.ccc.MikeBean does not implement javax.ejb.EJBObject (it implements javax.ejb.SessionBean)Any idea why?
Thanks
Mikeundefined
vleninMemberOk, the problem I listed above is fixed. I forgot to end my package name with ejb.
Now there is another issue.
I get javax.naming.NameNotFoundException: ejb/MikeBeanHome not found in TTT, when I run my servlet.Why can’t it find the home interface? Is there any additional configuration that I need to do to Orion?
Thanks
Mike
Scott AndersonParticipantMike,
You’ll need to be sure you’re getting XDoclet to generate the orion-ejb-jar.xml file that specifies what JNDI mapping to use for your EJB. You’ll need to be sure that the Orion subtask has been added to the ejbdoclet task for the project in the MyEclipse-XDoclet settings under the project Properties.
vleninMemberI had already done that. I followed the instructions in the MyEclipse Help exactly.
Here is the orion-ejb-jar.xml file that XDoclet generated.
<?xml version=”1.0″?>
<!DOCTYPE orion-ejb-jar PUBLIC “-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN” “http://www.orionserver.com/dtds/orion-ejb-jar.dtd”><orion-ejb-jar deployment-version=”2.0.2″ deployment-time=”fa4dc36342″>
<enterprise-beans>
<session-deployment name=”MikeBean” location=”MikeBean” wrapper=”MikeBeanHome_StatelessSessionHomeWrapper1″ persistence-filename=”MikeBean” />
</enterprise-beans>
<assembly-descriptor>
<default-method-access>
<security-role-mapping name=”<default-ejb-caller-role>” impliesAll=”true” />
</default-method-access>
</assembly-descriptor>
</orion-ejb-jar>Here’s my code that is calling on my bean:
Properties prop = System.getProperties();
Context ctx = new InitialContext(prop);
java.lang.Object objRef = ctx.lookup(MikeBeanHome.JNDI_NAME);
MikeBeanHome mbHome =
(MikeBeanHome) PortableRemoteObject.narrow(objRef,MikeBeanHome.class);
this.mb = (MikeBean) mbHome.create();Any idea what could be wrong?
Scott AndersonParticipantWhat is the setting of MikeBeanHome.JNDI_NAME?
vleninMemberMikeBeanHome.JNDI_NAME = “ejb/MikeBeanHome”
Scott AndersonParticipantTry referencing it as “MikeBean” , since that’s what is specified in your orion-ejb-jar.xml file. You can change the generated name by playing with the XDoclet properties but you need to bear in mind that the properties you specify for Orion must match the ones you’ve specified for the general EJB settings and utility classes. Right now it looks like you’ve got a disconnect since the JNDI_NAME doesn’t match what is being generated to the deployment descriptor for Orion.
vleninMemberI tried it and it didn’t work.
I tried referencing it a number of different ways.
But nothing works.
I keep getting ClassCastExceptions or javax.naming.NameNotFoundException.I would have thought that MyEclipse would have generated the correct xml files for me. I’m not trying to do anything fancy, just have a servlet call on an EJB all within the same enterprise project.
Scott AndersonParticipantI would have thought that MyEclipse would have generated the correct xml files for me.
Right now our XDoclet support still requires you to manually and properly configure XDoclet to generate the necessary descriptors for your server. We’ll be working on usability enhancements in this area in the future.
-
AuthorPosts