pjgould
asked on
Weblogic EJB deployment problem (LocalObject Interface problem)
Right, can't quite work this one out. I have an EAR containing several local EJBs which I can deploy fine on Webshere / Orion. I decided that I'd try deploying these to Weblogic 7 App server today, as I'm going to be using that for some upcoming projects.
Using the deployment tool (Weblogic builder) i get the following errors when I try to open the EAR file:
////////////////////////// ////////// ////////// ////////// ///////
Inspecting input J2EE module engine-ejb.jar
[EarCMBean] ejb module uri=engine-ejb.jar
Loaded descriptor file META-INF/ejb-jar.xml
......
Discovered module type for engine-ejb.jar
Found EJB components. Initializing descriptors
Found EJBHome: pjg.ejb.SenderServiceLocal Home
Cannot determine bean class for interface 'pjg.ejb.SenderLocalServic e'
Found EJBHome: pjg.ejb.OpServiceLocalHome
Cannot determine bean class for interface 'pjg.ejb.OpLocalService'
Removing bean pjg/SenderServiceEJB
Removing bean pjg/OpServiceEJB
////////////////////////// ////////// ////////// ////////// //////////
Using Weblogic admin console to deploy these I just get a compilation error. Now, I've done some investigation into the matter myself, and the Local Interfaces both have superinterfaces which describing the Business Method signatures ie:
// Superclass:
public interface SenderService {
public mData send(mData msg);
}
// Local Interface:
public interface SenderLocalService
extends SenderService, EJBLocalObject {
}
// Bean class:
public class SenderServiceBean
implements SenderService {
public void ejbCreate() throws CreateException {
}
public mData send(mData msg) {
mData newMsg = ....
// blah blah
return newMsg;
}
....
// Other ejbMethods implemented
....
}
Like I say, this model seems to work fine with other app servers (although I can't see the point of the superinterfaces to be honest), but not with Weblogic. Now, when I get rid of the superinterfaces and put the business methods into the class which extends ejbLocalObject it all deploys very nicely, Weblogic just doesn't seem to like the fact that the Local Interface is extending both the sender superclass and EJBLocalObject.
So, in a nutshell, what I want to know is "Is there any reason that a Local Interface can't Extend both these classes?" It all seems to boil down to the app servers EJB class generation, but I'd like to know for sure!
If anyone needs any more info just let me know...
Cheers,
Pete
Using the deployment tool (Weblogic builder) i get the following errors when I try to open the EAR file:
//////////////////////////
Inspecting input J2EE module engine-ejb.jar
[EarCMBean] ejb module uri=engine-ejb.jar
Loaded descriptor file META-INF/ejb-jar.xml
......
Discovered module type for engine-ejb.jar
Found EJB components. Initializing descriptors
Found EJBHome: pjg.ejb.SenderServiceLocal
Cannot determine bean class for interface 'pjg.ejb.SenderLocalServic
Found EJBHome: pjg.ejb.OpServiceLocalHome
Cannot determine bean class for interface 'pjg.ejb.OpLocalService'
Removing bean pjg/SenderServiceEJB
Removing bean pjg/OpServiceEJB
//////////////////////////
Using Weblogic admin console to deploy these I just get a compilation error. Now, I've done some investigation into the matter myself, and the Local Interfaces both have superinterfaces which describing the Business Method signatures ie:
// Superclass:
public interface SenderService {
public mData send(mData msg);
}
// Local Interface:
public interface SenderLocalService
extends SenderService, EJBLocalObject {
}
// Bean class:
public class SenderServiceBean
implements SenderService {
public void ejbCreate() throws CreateException {
}
public mData send(mData msg) {
mData newMsg = ....
// blah blah
return newMsg;
}
....
// Other ejbMethods implemented
....
}
Like I say, this model seems to work fine with other app servers (although I can't see the point of the superinterfaces to be honest), but not with Weblogic. Now, when I get rid of the superinterfaces and put the business methods into the class which extends ejbLocalObject it all deploys very nicely, Weblogic just doesn't seem to like the fact that the Local Interface is extending both the sender superclass and EJBLocalObject.
So, in a nutshell, what I want to know is "Is there any reason that a Local Interface can't Extend both these classes?" It all seems to boil down to the app servers EJB class generation, but I'd like to know for sure!
If anyone needs any more info just let me know...
Cheers,
Pete
ASKER
Hiya, Sure thing. Here's the ejb-jar.xml file before I run it through Weblogic Builder:
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<description>Engine EJBs</description>
<enterprise-beans>
<session>
<description>Core Service</description>
<display-name>CoreServiceJ AR</displa y-name>
<ejb-name>pjg/CoreServiceE JB</ejb-na me>
<home>pjg.core.ejb.CoreSer viceHome</ home>
<remote>pjg.core.ejb.CoreR emoteServi ce</remote >
<ejb-class>pjg.core.ejb.Co reServiceB ean</ejb-c lass>
<session-type>Stateless</s ession-typ e>
<transaction-type>Bean</tr ansaction- type>
</session>
<session>
<description>The sender service.</description>
<display-name>SenderServic eJAR</disp lay-name>
<ejb-name>pjg/SenderServic eEJB</ejb- name>
<local-home>pjg.ejb.Sender ServiceLoc alHome</lo cal-home>
<local>pjg.ejb.SenderLocal Service</l ocal>
<ejb-class>pjg.ejb.SenderS erviceBean </ejb-clas s>
<session-type>Stateless</s ession-typ e>
<transaction-type>Bean</tr ansaction- type>
<env-entry>
<description>Implementatio n Class</description>
<env-entry-name>ImplClass< /env-entry -name>
<env-entry-type>java.lang. String</en v-entry-ty pe>
<env-entry-value>pjg.ejb.S enderServi ceStub</en v-entry-va lue>
</env-entry>
</session>
<session>
<description>The operator service.</description>
<display-name>OpServiceJAR </display- name>
<ejb-name>pjg/OpServiceEJB </ejb-name >
<local-home>pjg.ejb.OpServ iceLocalHo me</local- home>
<local>pjg.ejb.OpLocalServ ice</local >
<ejb-class>pjg.ejb.OpServi ceBean</ej b-class>
<session-type>Stateless</s ession-typ e>
<transaction-type>Bean</tr ansaction- type>
<env-entry>
<description>Implementatio n Class</description>
<env-entry-name>ImplClass< /env-entry -name>
<env-entry-type>java.lang. String</en v-entry-ty pe>
<env-entry-value>pjg.ejb.O pServiceSt ub</env-en try-value>
</env-entry>
</session>
</enterprise-beans>
</ejb-jar>
At this point I don't have a weblogic-ejb-jar.xml (Do I need one - I thought that the builder should generate this).
Then I open my Ear file in the Weblogic Builder, and receive the message:
"Found ejb-jar.xml but couldn't find weblogic-ejb-jar.xml
Would you like new descriptors created for you? The existing ejb-jar.xml will be preserved".
To which I answered yes (otherwise I have an exception occuring as there's no weblogic-ejb-jar.xml).
Upon looking at the xml files that are created I have:
<ejb-jar>
<description><![CDATA[Engi ne EJBs]]></description>
<enterprise-beans>
<session>
<description><![CDATA[Core Service]]></description>
<display-name>CoreServiceJ AR</displa y-name>
<ejb-name>pjg/CoreServiceE JB</ejb-na me>
<home>pjg.core.ejb.CoreSer viceHome</ home>
<remote>pjg.core.ejb.CoreR emoteServi ce</remote >
<ejb-class>pjg.core.ejb.Co reServiceB ean</ejb-c lass>
<session-type>Stateless</s ession-typ e>
<transaction-type>Bean</tr ansaction- type>
</session>
</enterprise-beans>
</ejb-jar>
and:
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>pjg/CoreServiceE JB</ejb-na me>
<stateless-session-descrip tor>
<pool>
</pool>
<stateless-clustering>
</stateless-clustering>
</stateless-session-descri ptor>
<transaction-descriptor>
</transaction-descriptor>
<jndi-name>pjg/CoreService EJB</jndi- name>
</weblogic-enterprise-bean >
</weblogic-ejb-jar>
ie. it seems to have "lost" my local ejbs.
Am I using this tool in the wrong way?
Thanks.
Pete
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<description>Engine EJBs</description>
<enterprise-beans>
<session>
<description>Core Service</description>
<display-name>CoreServiceJ
<ejb-name>pjg/CoreServiceE
<home>pjg.core.ejb.CoreSer
<remote>pjg.core.ejb.CoreR
<ejb-class>pjg.core.ejb.Co
<session-type>Stateless</s
<transaction-type>Bean</tr
</session>
<session>
<description>The sender service.</description>
<display-name>SenderServic
<ejb-name>pjg/SenderServic
<local-home>pjg.ejb.Sender
<local>pjg.ejb.SenderLocal
<ejb-class>pjg.ejb.SenderS
<session-type>Stateless</s
<transaction-type>Bean</tr
<env-entry>
<description>Implementatio
<env-entry-name>ImplClass<
<env-entry-type>java.lang.
<env-entry-value>pjg.ejb.S
</env-entry>
</session>
<session>
<description>The operator service.</description>
<display-name>OpServiceJAR
<ejb-name>pjg/OpServiceEJB
<local-home>pjg.ejb.OpServ
<local>pjg.ejb.OpLocalServ
<ejb-class>pjg.ejb.OpServi
<session-type>Stateless</s
<transaction-type>Bean</tr
<env-entry>
<description>Implementatio
<env-entry-name>ImplClass<
<env-entry-type>java.lang.
<env-entry-value>pjg.ejb.O
</env-entry>
</session>
</enterprise-beans>
</ejb-jar>
At this point I don't have a weblogic-ejb-jar.xml (Do I need one - I thought that the builder should generate this).
Then I open my Ear file in the Weblogic Builder, and receive the message:
"Found ejb-jar.xml but couldn't find weblogic-ejb-jar.xml
Would you like new descriptors created for you? The existing ejb-jar.xml will be preserved".
To which I answered yes (otherwise I have an exception occuring as there's no weblogic-ejb-jar.xml).
Upon looking at the xml files that are created I have:
<ejb-jar>
<description><![CDATA[Engi
<enterprise-beans>
<session>
<description><![CDATA[Core
<display-name>CoreServiceJ
<ejb-name>pjg/CoreServiceE
<home>pjg.core.ejb.CoreSer
<remote>pjg.core.ejb.CoreR
<ejb-class>pjg.core.ejb.Co
<session-type>Stateless</s
<transaction-type>Bean</tr
</session>
</enterprise-beans>
</ejb-jar>
and:
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>pjg/CoreServiceE
<stateless-session-descrip
<pool>
</pool>
<stateless-clustering>
</stateless-clustering>
</stateless-session-descri
<transaction-descriptor>
</transaction-descriptor>
<jndi-name>pjg/CoreService
</weblogic-enterprise-bean
</weblogic-ejb-jar>
ie. it seems to have "lost" my local ejbs.
Am I using this tool in the wrong way?
Thanks.
Pete
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hiya, I got the ear deployed in the end.
Cheers for that.
Cheers for that.
Can you please put the ejb-jar.xml file and the weblogic-ejb-jar.xml files here? It might help us...