Client using ejb-ref to lookup
Hi,
I read the docs, I searched for answers but there are still some things I don't
understand regarding a stand alone client application to a weblogic server 8.1
that could look up a bean using ejb-ref. I don't want to use the JNDI name.
There is the client-application.xml and the MyClientJar.runtime.xml but i'm not
sure I understand where to put them. I have the client-application.xml in my
client jar, the runtime.xml one in the same directory like specified in the
documentation, I tried to put the xml and the jar in my classpath and running
the client, no success the client cannot lookup using ejb-ref
I read that MyClientJar.jar should go in my ServerModule.ear so I did that too,
still doesn't work.
Something I'm not doing right or something I don't understand.
Any help or comments appreciated
Thank You
Max
Hi,
I read the docs, I searched for answers but there are still some things I don't
understand regarding a stand alone client application to a weblogic server 8.1
that could look up a bean using ejb-ref. I don't want to use the JNDI name.
There is the client-application.xml and the MyClientJar.runtime.xml but i'm not
sure I understand where to put them. I have the client-application.xml in my
client jar, the runtime.xml one in the same directory like specified in the
documentation, I tried to put the xml and the jar in my classpath and running
the client, no success the client cannot lookup using ejb-ref
I read that MyClientJar.jar should go in my ServerModule.ear so I did that too,
still doesn't work.
Something I'm not doing right or something I don't understand.
Any help or comments appreciated
Thank You
Max
Similar Messages
-
Have to ask again:when to use ejb-ref ?
hi, I asked this last week but nobody answered it.
i am really curious about it and i checked some docs it said " it is useful
coz beans can look each other up without needing to initialize JNDI to any
particular driver".
i wonder what means particular driver and when there will be great
difference between using and not using.
thanx in advance
Ciao,
zhxtIn WLS you can have either global JNDI names that are visible throughout
the server or JNDI names that are local to your application.
The recommended best practice these days is to use ejb-refs and/or
ejb-links to lookup your EJBs. For local EJBs, you don't need to have a
global JNDI name since they are not visible to other applications.
-- Rob
scratchback wrote:
hi, I asked this last week but nobody answered it.
i am really curious about it and i checked some docs it said " it is useful
coz beans can look each other up without needing to initialize JNDI to any
particular driver".
i wonder what means particular driver and when there will be great
difference between using and not using.
thanx in advance
Ciao,
zhxt -
if i do not write <ejb-ref> in ejb-jar.xml,what will happen?the application
can not run or performance is low?
and is there any difference between bmp and cmp?i mean "does cmp need
<ejb-ref>?"
Ciao,
zhxtIn WLS you can have either global JNDI names that are visible throughout
the server or JNDI names that are local to your application.
The recommended best practice these days is to use ejb-refs and/or
ejb-links to lookup your EJBs. For local EJBs, you don't need to have a
global JNDI name since they are not visible to other applications.
-- Rob
scratchback wrote:
hi, I asked this last week but nobody answered it.
i am really curious about it and i checked some docs it said " it is useful
coz beans can look each other up without needing to initialize JNDI to any
particular driver".
i wonder what means particular driver and when there will be great
difference between using and not using.
thanx in advance
Ciao,
zhxt -
Hi !
I made an Entity bean for a master table, make its local interfaces and deploy it in a seperate jar.
Then i want to call this Entity bean thru any session bean using local interfaces and this session bean
is in a seperate jar file.
Right now its not working - i heard it can be used using <ejb-ref> tag.
Can anyone tell me what all entries do i need to make for this :
Do i need to write some code also for ti or only entries in deployment descriptor files will do ?
and what all entries do i need to make in deplyment descriptors or entity and deployment descriptors of session beans.
If somone has sample code then do please send across...
Thanks in advance !!I tried the thing :
I made an Entity Bean and a session bean in seperate jar files
The ejb-ref entries in session beans deployment descriptor files are ::
<ejb-local-ref>
<ejb-ref-name>ejb/EmpLocal</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>EmpHomeLocal</local-home>
<local>EmpLocal</local>
</ejb-local-ref>
Now, the code in session bean from where i am calling Entity bean is ::
InitialContext initialcontext = new InitialContext();
System.out.println("Initial Context created ");
home = (EmpHomeLocal)initialcontext.lookup("java:comp/env/EmpLocal");
System.out.println("After getting Local Home");
But its giving me the following error in Session Bean
Initial Context created
java.lang.ClassCastException: EmpEJB_1huw_LocalHomeImpl
Can, anyone help me to call an Entity bean's local methods from a Session bean - bith in seperate jar files -
Help needed - why we use ejb-ref element in ejb-jar.xml
hi all
can anyone tell me what is the purpose of this element in the ejb deploy descriptor? thanksSuppose u have bean A, which needs to look up another bean B. Normally you wud need to use the jndi lookup using the initial context to access the bean B's home interface. If you use ejb-ref element you dont need to know the JNDI name of bean B. You can use ejb-ref-name instead. So you can say this is a short cut method of looking up and getting a reference to a bean's home object.
-
Using ejb-ref tag for EJB toEJB reference
Hello all respected members,
I am using weblogic 5.1 (sp 9).
I have two Session EJBs - a client and another is the referenced by
the client.
The client is using services of the referenced EJB.
The two EJBs are in two very different packages.
Now say I am trying to deploy the client EJB first, without deploying
the referenced EJB.
What I expect (rather, want)is, when the client EJB is being deloyed,
it should give a notification somehow (let's say, by throwing an
exception) that the referenced EJB is not yet deployed.
First of all, is this possible ?
Secondly, I am aware of the of the <ejb-ref> tag. In order to meet my
requirement, I have added the same tag in the client's ejb-jar.xml and
corresponding <ejb-reference-description> tag in the
weblogic-ejb-jar.xml file.
When I start the weblogic server, I can see that the referenced EJB is
not deployed. But the client EJB is being deployed, it does not give
any notification that the referenced EJB is not yet deployed and gets
deployed successfully.
In other words, I expect <ejb-ref> tag to let me know that the
referenced EJB is not yet deployed. Is my understanding of <ejb-ref>
tag correct ?
It is clear to me that when the client EJB tries to instantiate the
referenced EJB to use its services, it would throw an exception
(during the lookup) since the referenced EJB is not deployed. But I
want to avoid this exception at this stage. I want to get a
notification of this, much before i.e. when the weblogic is deploying
my client EJB. I think the <ejb-ref> tag does this. Hence I am using
it.
If I am going in wrong direction, is there any other way to fulfil my
requirement ?
Please advise.
Neelesh.The <ejb-ref> element is used at deployment to map the bean references.
The beans referred to should already be deployed.
Neelesh wrote:
Hello all respected members,
I am using weblogic 5.1 (sp 9).
I have two Session EJBs - a client and another is the referenced by
the client.
The client is using services of the referenced EJB.
The two EJBs are in two very different packages.
Now say I am trying to deploy the client EJB first, without deploying
the referenced EJB.
What I expect (rather, want)is, when the client EJB is being deloyed,
it should give a notification somehow (let's say, by throwing an
exception) that the referenced EJB is not yet deployed.
First of all, is this possible ?
Secondly, I am aware of the of the <ejb-ref> tag. In order to meet my
requirement, I have added the same tag in the client's ejb-jar.xml and
corresponding <ejb-reference-description> tag in the
weblogic-ejb-jar.xml file.
When I start the weblogic server, I can see that the referenced EJB is
not deployed. But the client EJB is being deployed, it does not give
any notification that the referenced EJB is not yet deployed and gets
deployed successfully.
In other words, I expect <ejb-ref> tag to let me know that the
referenced EJB is not yet deployed. Is my understanding of <ejb-ref>
tag correct ?
It is clear to me that when the client EJB tries to instantiate the
referenced EJB to use its services, it would throw an exception
(during the lookup) since the referenced EJB is not deployed. But I
want to avoid this exception at this stage. I want to get a
notification of this, much before i.e. when the weblogic is deploying
my client EJB. I think the <ejb-ref> tag does this. Hence I am using
it.
If I am going in wrong direction, is there any other way to fulfil my
requirement ?
Please advise.
Neelesh. -
Memory leak in a client using EJBs deployed in a Bea Weblogic 10.0.0 cluste
Hi all,
We are having a memory leak in a client using stateless EJBs deployed in cluster. The client is a Tomcat 6.0.18 with java 6 but it is reproduced using Tomcat 5 with java 5. The client is calling a Weblogic Server 10.0 making
calls to an EJB deployed in cluster that has two instances installed in two different machines.
The client works fine if we shutdown one of the server instances and so when the client is using only one instance.
Resuming the environment:
Client Side:
1 HP-Itanium machine with HP-UX.
1 Tomcat 6 with java 6 (reproduced with java 5)
Bea Weblogic client (wlclient.jar) for Weblogic 10.0.0
Server Side:
2 HP-Itanium machines with HP-UX
Bea Weblogic Server 10.0.0 installed in both machines
An unique domain
Two Bea instances (one per machines) associated to a Bea Cluster
EJBs deployed in both instances
We have monitored the memory consumed in Tomcat and we have noticed that the VM memory PS OLD GEN grows up permanently when we make tests having the two server side Bea Instances up. We have extended
the memory VM parameters in Tomcat client till 1G and it's only a way to delay the end: the free memory is empty, the GC is not able to free no more byte and the CPU is 100% consumed by the GC work. At the end Tomcat Client
doesn't accept more http petitions and must be restarted.
Besides, we have studied the VM memory in Tomcat using jmap and importing it using Eclipse Memory Analyzer. We have seen some strange memory blocks of several Mbytes that are always growing up and that are stored
under data structures in the package com.sun.corba:
com.sun.corba.se.impl.legacy.connection.SocketFactoryConnectionImpl (4.5Mb)
|
-> com.sun.corba.se.impl.transport.CorbaResponseWaitingRoomImpl
|
-> java.util.Hashtable
|
-> java.util.Hashtable$Entry
|
-> java.util.Hashtable$Entry
-> java.util.Hashtable$Entry
-> java.util.Hashtable$Entry
Has anybody any idea about this problem?
Thanks in advance.Hi all,
We are having a memory leak in a client using stateless EJBs deployed in cluster. The client is a Tomcat 6.0.18 with java 6 but it is reproduced using Tomcat 5 with java 5. The client is calling a Weblogic Server 10.0 making
calls to an EJB deployed in cluster that has two instances installed in two different machines.
The client works fine if we shutdown one of the server instances and so when the client is using only one instance.
Resuming the environment:
Client Side:
1 HP-Itanium machine with HP-UX.
1 Tomcat 6 with java 6 (reproduced with java 5)
Bea Weblogic client (wlclient.jar) for Weblogic 10.0.0
Server Side:
2 HP-Itanium machines with HP-UX
Bea Weblogic Server 10.0.0 installed in both machines
An unique domain
Two Bea instances (one per machines) associated to a Bea Cluster
EJBs deployed in both instances
We have monitored the memory consumed in Tomcat and we have noticed that the VM memory PS OLD GEN grows up permanently when we make tests having the two server side Bea Instances up. We have extended
the memory VM parameters in Tomcat client till 1G and it's only a way to delay the end: the free memory is empty, the GC is not able to free no more byte and the CPU is 100% consumed by the GC work. At the end Tomcat Client
doesn't accept more http petitions and must be restarted.
Besides, we have studied the VM memory in Tomcat using jmap and importing it using Eclipse Memory Analyzer. We have seen some strange memory blocks of several Mbytes that are always growing up and that are stored
under data structures in the package com.sun.corba:
com.sun.corba.se.impl.legacy.connection.SocketFactoryConnectionImpl (4.5Mb)
|
-> com.sun.corba.se.impl.transport.CorbaResponseWaitingRoomImpl
|
-> java.util.Hashtable
|
-> java.util.Hashtable$Entry
|
-> java.util.Hashtable$Entry
-> java.util.Hashtable$Entry
-> java.util.Hashtable$Entry
Has anybody any idea about this problem?
Thanks in advance. -
Ejb-ref, ejb-link or JNDI lookup
If I have an application in which one EJB is using another EJB in the SAME application,
what is the best of way of accessing the other EJB?
Why would I use ejb-ref / ejb-link instead of just looking it up in the JNDI?
Just curious.
Thanks.
Danejb-ref/ejb-link were introduced in the ejb spec to allow bean developers to
develop beans without any knowledge of the environment into which they would
be deployed. If you can live with hard coded jndi names then that is fine or
you can use the mechanism define below but using ejb-ref/ejb-link makes your
beans more reuseable and less dependent on the final environement.
If both the ejbs are in the same application I would recommend using ejb-ref
and ejb-link.
-- Anand
"Chad McDaniel" <[email protected]> wrote in message
news:[email protected]..
"Dan Baumbach" <[email protected]> writes:
If I have an application in which one EJB is using another EJB in the
SAME application,
what is the best of way of accessing the other EJB?
Why would I use ejb-ref / ejb-link instead of just looking it up in theJNDI?
>>
>
I believe that ejb-ref/link is not useful in most systems and causes
another level of complexity to maintain. Since EJBs are complex enough
I think that using the basic JNDI lookup is preferable. Also, this
frees you to move the beans to a remote server if you ever want to.
The simplest and most flexible technique, I believe, is to use a
utility class that handles all EJB lookups for you and use a simple
EJB and JNDI name mapping that this class can generate the JNDI name
with a simply manipulation of the bean name. If you ever change the
reference technique you will then only have one class to modify.
This is also a good place to cache home references. -
Ejb-ref in oc4j 10.1.3.2.0 standalone
Hi,
i asked this before, but i didnt receive any answers. So i looked in more deeply to be more precise.
I developed and deployed a Webservice with JDEV 10.1.3 which looks up EJBs in a remote oc4j. I configured the ejb-references in web.xml and orion-web.xml like shown in the documentation by using ejb-ref-mapping attribute jndi-properties-file and remote-server-ref=true. That works fine in embedded oc4j 10.1.3.2.0.
If i deploy the same application to standalone oc4j 10.1.3.2.0 the application fails wih a naming exception. If i hardcode the jndi-properties again all works fine, so it seems to be a problem of configuration.
So i let print out some information about the InitialContext constructed im the ServiceLocator-Class i use:
ctx = new InitialContext( );
Hashtable ha = ResourceManager.getInitialEnvironment(null);
logger.debug("" + ha.get(InitialContext.PROVIDER_URL));
NamingEnumeration nenum = ctx.listBindings("java:comp/env");
There are indeed some differences between the standalone and the embedded as listed below:
embedded:
07/09/17 17:53:36 ormi://remote-IP: javax.naming.Reference:Reference Class Name: javax.ejb.EJBHome
Type: location
Content: MyBeanFacade
Type: remote-server-ref
Content: true
Type: jndi-properties-file
Content: jndi.properties
07/09/17 17:53:36 ejb: javax.naming.Context:[Context TestWS-org-webapp: {MyBeanFacade=Reference Class Name: javax.ejb.EJBHome
Type: location
Content: MyBeanFacade
Type: remote-server-ref
Content: true
Type: jndi-properties-file
Content: jndi.properties
, ejb/MBeanServerUserEjb=Reference Class Name: javax.ejb.EJBHome
Type: location
Content: MBeanServerUserEjb
standalone:
07/09/17 18:14:06 ormi://IP-ofTheHostOfOC4J:23791/default
07/09/17 18:14:06 MyBeanFacade: javax.naming.Reference:Reference Class Na
me: javax.ejb.EJBHome
Type: location
Content: MyBeanFacade
07/09/17 18:14:06 ejb: javax.naming.Context:[Context webapp: {MyBeanFacad
e=Reference Class Name: javax.ejb.EJBHome
Type: location
Content: MyBeanFacade
, ejb/MBeanServerUserEjb=Reference Class Name: javax.ejb.EJBHome
Type: location
Content: MBeanServerUserEjb
The difference is obvious.
Interestingly http://www.oracle.com/technology/oracleas/schema/orion-web-10_0.xsd
dosnt neither define jndi-properties-file nor remote-server-ref for ejb-ref-mapping. On the other hand, thats what one finds in the documentation.
Another problem is, that originally the oc4j tried to lookup with protocol ormis.
So i had first to delete ssl-port = "23943" from rmi.xml to see ormi.
Now on the first call of the Web Service after start of the server in fact the lookup goes to the remote-IP not to the IP-ofTheHostOfOC4J as written before. But the lookup fails with a namingexception anyway. After the second call the lookup goes to IP-ofTheHostOfOC4J again, even though the application is restarted or redeployed.
Its not very funny to go through this configuration issues with every new revision of the software. Perhaps the lack of feedback in this forum is a hint to open more often a tar than to post herein.
Regards chrisThank u both for your answers.
First of all this is not a Web Service specific issue at all, its about configuring ejb-references for web-components.
The difference was between embedded and standalone.
The reason for this behavior is a bug in 10.1.3.1 standalone.
I think this could be fixed in this 1/2 GB patch from july 2007, so why not upgrading to 10.1.3.3 for which i assume that it includes the fix as Olaf proposed following my proposal ;-)
Anyway you can work around it quite simple:
The reason is that during the deployment the contents of the custom (contained in the ear-file) orion-web.xml is not properly added to the generated orion-web.xml in applications-deployments.
The ejb-remote attrbiute is discarded.
So just add it to the generated orion-web.xml after the deployment and restart the oc4j. Dont redeploy or restart the application cause a redopleyment would overwrite your changes.
Thanks for my help :-)
Chris -
hi all,
when i have an enterprise application with a session bean and a webapp,
i can access the session bean either over an ejb-reference in the webapp or directly access the jndi entry. what is the advantage of using ejb references? here an example of what i mean (both from within a webapp):
ctx.lookup("myBean"); // without ejb ref
ctx.lookup("java:comp/env/ejb/myRef"); // with ejb ref
I get back the same, so whats the difference?
rgdsWith ejb-reference a container optimizes access to collocated beans. For example, say you have a deployment where beans A and B are both replicated in two different containers, for performance and/or availability reasons. For optimal use every instance of A in container would use instances of B also in container one. Likewise for container two. An EJB container can enforce this locality constraint using ejb-links, but not always using direct JNDI names.
-
hi,
i get this following error when i start the WL 7.0. The web application fails
to start but the ejbs are started properly. This is an example from the Monson
Haefel book, on the CMP: Entity bean relationships.
Can anybody tell me what is happening ??
-thanks
-vasanth
Error log:
=============
<Error> <HTTP> <101179> <[HTTP] Error parsing des criptor in Web appplication
"C:\bea\user_projects\mydomain\.\myserver\.wlnotdele
te\titan\titan.war" [Path="C:\eclipse\workspace\titan4\dist\titan.ear", URI="tit
an.war"
weblogic.xml.dom.ChildCountException: missing child home in ejb-ref
at weblogic.xml.dom.DOMUtils.getElementByTagName(DOMUtils.java:147)
at weblogic.xml.dom.DOMUtils.getValueByTagName(DOMUtils.java:128)
at weblogic.servlet.internal.dd.EJBReference.<init>(EJBReference.java:61
at weblogic.servlet.internal.dd.WebAppDescriptor.<init>(WebAppDescriptor
.java:247)
at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(Descri
ptorLoader.java:540)
at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader
.java:253)
at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader
.java:215)
at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.ja
va:282)
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
er.java:714)
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
er.java:555)
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
er.java:458)
at weblogic.management.deploy.slave.SlaveDeployer.prepareAllStagedApplic
ations(SlaveDeployer.java:490)
at weblogic.management.deploy.slave.SlaveDeployer.initialize(SlaveDeploy
er.java:253)
at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.initi
alize(DeploymentManagerServerLifeCycleImpl.java:150)
at weblogic.t3.srvr.ServerLifeCycleList.initialize(ServerLifeCycleList.j
ava:54)
at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:782)
at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
at weblogic.Server.main(Server.java:32)
>
<Jun 23, 2003 10:10:51 AM CDT> <Error> <Deployer> <149205> <The Slave Deployer
f
ailed to initialize the application titan due to error weblogic.management.Appli
cationException: Prepare failed. Task Id = null
Module Name: titan.war, Error: Could not load web application from 'C:\bea\user_
projects\mydomain\.\myserver\.wlnotdelete\titan\titan.war'
weblogic.management.ApplicationException: Prepare failed. Task Id = null
Module Name: titan.war, Error: Could not load web application from 'C:\bea\user_
projects\mydomain\.\myserver\.wlnotdelete\titan\titan.war'
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
er.java:720)
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
er.java:555)
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
er.java:458)
at weblogic.management.deploy.slave.SlaveDeployer.prepareAllStagedApplic
ations(SlaveDeployer.java:490)
at weblogic.management.deploy.slave.SlaveDeployer.initialize(SlaveDeploy
er.java:253)
at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.initi
alize(DeploymentManagerServerLifeCycleImpl.java:150)
at weblogic.t3.srvr.ServerLifeCycleList.initialize(ServerLifeCycleList.j
ava:54)
at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:782)
at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
at weblogic.Server.main(Server.java:32)
>It is working now.
For a local entity bean, i was using <ejb-ref> instead of <local-ejb-ref>
Once i changed that, it worlked.
thanks
-vasanth
"Sanjeev Chopra" <[email protected]> wrote:
correct url for doc...
http://e-docs.bea.com/wls/docs81/webapp/web_xml.html#1020090
"Sanjeev Chopra" <[email protected]> wrote in message
news:[email protected]...
Seems like titan.war's WEB-INF/web.xml has an ejb-ref element witha
missing
<home> element .
see http://e-docs/wls/docs81/webapp/web_xml.html#1020090
"Vasanth" <[email protected]> wrote in message
news:[email protected]...
hi,
i get this following error when i start the WL 7.0. The web applicationfails
to start but the ejbs are started properly. This is an example from
the
Monson
Haefel book, on the CMP: Entity bean relationships.
Can anybody tell me what is happening ??
-thanks
-vasanth
Error log:
=============
<Error> <HTTP> <101179> <[HTTP] Error parsing des criptor in Webappplication
"C:\bea\user_projects\mydomain\.\myserver\.wlnotdele
te\titan\titan.war" [Path="C:\eclipse\workspace\titan4\dist\titan.ear",URI="tit
an.war"
weblogic.xml.dom.ChildCountException: missing child home in ejb-ref
atweblogic.xml.dom.DOMUtils.getElementByTagName(DOMUtils.java:147)
at
weblogic.xml.dom.DOMUtils.getValueByTagName(DOMUtils.java:128)
atweblogic.servlet.internal.dd.EJBReference.<init>(EJBReference.java:61
atweblogic.servlet.internal.dd.WebAppDescriptor.<init>(WebAppDescriptor
java:247)
atweblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(Descri
ptorLoader.java:540)
atweblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader
java:253)
atweblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader
java:215)
atweblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.ja
va:282)
atweblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
er.java:714)
atweblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
er.java:555)
atweblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
er.java:458)
atweblogic.management.deploy.slave.SlaveDeployer.prepareAllStagedApplic
ations(SlaveDeployer.java:490)
atweblogic.management.deploy.slave.SlaveDeployer.initialize(SlaveDeploy
er.java:253)
atweblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.initi
alize(DeploymentManagerServerLifeCycleImpl.java:150)
atweblogic.t3.srvr.ServerLifeCycleList.initialize(ServerLifeCycleList.j
ava:54)
at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:782)
at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
at weblogic.Server.main(Server.java:32)
>
<Jun 23, 2003 10:10:51 AM CDT> <Error> <Deployer> <149205> <The SlaveDeployer
f
ailed to initialize the application titan due to errorweblogic.management.Appli
cationException: Prepare failed. Task Id = null
Module Name: titan.war, Error: Could not load web application from'C:\bea\user_
projects\mydomain\.\myserver\.wlnotdelete\titan\titan.war'
weblogic.management.ApplicationException: Prepare failed. Task Id
= null
Module Name: titan.war, Error: Could not load web application from'C:\bea\user_
projects\mydomain\.\myserver\.wlnotdelete\titan\titan.war'
atweblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
er.java:720)
atweblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
er.java:555)
atweblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
er.java:458)
atweblogic.management.deploy.slave.SlaveDeployer.prepareAllStagedApplic
ations(SlaveDeployer.java:490)
atweblogic.management.deploy.slave.SlaveDeployer.initialize(SlaveDeploy
er.java:253)
atweblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.initi
alize(DeploymentManagerServerLifeCycleImpl.java:150)
atweblogic.t3.srvr.ServerLifeCycleList.initialize(ServerLifeCycleList.j
ava:54)
at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:782)
at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
at weblogic.Server.main(Server.java:32)
> -
Ejb-ref element references to other beans
Hello,
Can anyone tell me what ejb references to other beans are for? (ejb-ref element).
I am completely missing the point and would be grateful if someone could tell me why I should have the overhead of writing this:
<ejb-ref>
<ejb-ref-name>ejb/waUserMgr</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.reuters.pds.webapp.bl.user.api.WAUserMgrHome</home>
<remote>com.reuters.pds.webapp.bl.user.api.WAUserMgr</remote>
<ejb-link>WAUserMgrEJB</ejb-link>
</ejb-ref>
Any comment welcome..
Julien.Hi,
The <ejb-ref> element is optional, you could use the actual JNDI name instead.
The advantage with using <ejb-ref> is that, if you deploy the bean on another server, probably with a different JNDI name,
your code can still continue using the same name as defined by <ejb-ref-name>.
Internally, the <ejb-ref-name> will be mapped to the actual JNDI location, maybe using symbolic links. -
How to lookup EJB3 beans using JNDI names without defining ejb-ref in DD?
Hi Kenneth,
I am just continuing the topic:
How Lookup SLSB from other SLSB? <HELP>
http://forum.java.sun.com/thread.jspa?threadID=5117484&tstart=0
(my original forums account failed, so I am using new one)
if I am not seeking portability I should be able to lookup a bean directly through JNDI without using the ejb-ref. (I just want to see how it can be done)
http://forum.java.sun.com/thread.jspa?forumID=13&threadID=751907
http://www.theserverside.com/discussions/thread.tss?thread_id=16402
I am using SJSAS PE 9.0 I am failing to lookup my beans from other beans directly without ejb-ref.
Is there some sample code to look at?
Thanks!Global JNDI names are vendor-specific and not known until deployment time. That is one
of the main reasons the Java EE component environment model defines a level of
indirection for accessing component dependencies. It is best to use either an ejb-ref
or @EJB annotation when accessing EJBs from a Java EE component.
If you choose not to, you just have to make sure the global JNDI name you use matches
the one assigned to the target EJB. We have a lot of information on how this works
in our EJB FAQ.
https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
If you're still encountering an error, please provide more specifics about your application,
the code you're using for the lookup, and the error message you're receiving. Just
saying "my looking fails" doesn't help us diagnose the problem :-)
--ken -
Ejb-ref and JNDI lookup problem
Hi,
I use WLS6.1sp2. I created one EntityBean and SessionBean jar files. I tried to
use session bean to refer entity bean, I failed. The details are as following:
In EntityBean's weblogic-ejb-jar.xml, I set:
<jndi-name>cabin.CabinHome</jndi-name>
In sessionbean's ejb-jar.xml
<ejb-ref>
<ejb-ref-name>ejb/CabinHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>com.titan.cabin.CabinHome</home>
<remote>com.titan.cabin.Cabin</remote>
</ejb-ref>
In sessionbean's weblogic-ejb-jar.xml
<reference-descriptor>
<ejb-reference-description>
<ejb-ref-name>ejb/CabinHome</ejb-ref-name>
<jndi-name>ejb/CabinHome</jndi-name>
</ejb-reference-description>
</reference-descriptor>
At sessionbean's client, I use
javax.naming.Context jndiContext = getInitialContext();
Object obj = jndiContext.lookup("java:comp/env/ejb/CabinHome");
When I run client file, I get the following error message:
- with nested exception:
[javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException:
Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining name
'CabinHome']; Link Remaining Name: 'ejb/CabinHome']>
javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException:
Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining name
'CabinHome'
<<no stack trace available>>
--------------- nested within: ------------------
javax.ejb.EJBException
- with nested exception:
[javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException:
Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining name
'CabinHome']; Link Remaining Name: 'ejb/CabinHome']
at com.titan.travelagent.TravelAgentBean.listCabins(TravelAgentBean.java:45)
at com.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl.listCabins(TravelAgentBean_a4c3ph_EOImpl.java:37)
at com.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl_WLSkel.invoke(Unknown
Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
####<Feb 1, 2002 11:32:40 PM PST> <Info> <Management> <dj> <travelServer> <ExecuteThread:
'14' for queue: 'default'> <system> <> <140009> <Configuration changes for domain
saved to the repository.>
Do you know what's wrong? how to fix this problem?
Thanks in advance.
DJSlava,
I took "cabin." out from weblogic-ejb-jar.xml, I got the same error.
DJ
"Slava Imeshev" <[email protected]> wrote:
Hi DJ,
I think you don't need "cabin." in weblogic-ejb-jar.xml :
<jndi-name>cabin.CabinHome</jndi-name>
Regards,
Slava Imeshev
"DJ" <[email protected]> wrote in message
news:[email protected]...
Hi,
I use WLS6.1sp2. I created one EntityBean and SessionBean jar files.I
tried to
use session bean to refer entity bean, I failed. The details are asfollowing:
In EntityBean's weblogic-ejb-jar.xml, I set:
<jndi-name>cabin.CabinHome</jndi-name>
In sessionbean's ejb-jar.xml
<ejb-ref>
<ejb-ref-name>ejb/CabinHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>com.titan.cabin.CabinHome</home>
<remote>com.titan.cabin.Cabin</remote>
</ejb-ref>
In sessionbean's weblogic-ejb-jar.xml
<reference-descriptor>
<ejb-reference-description>
<ejb-ref-name>ejb/CabinHome</ejb-ref-name>
<jndi-name>ejb/CabinHome</jndi-name>
</ejb-reference-description>
</reference-descriptor>
At sessionbean's client, I use
javax.naming.Context jndiContext = getInitialContext();
Object obj = jndiContext.lookup("java:comp/env/ejb/CabinHome");
When I run client file, I get the following error message:
- with nested exception:
[javax.naming.LinkException: [Root exception is
javax.naming.NameNotFoundException:>> Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining>name>> 'CabinHome'; Link Remaining Name: 'ejb/CabinHome']>
javax.naming.LinkException: . Root exception isjavax.naming.NameNotFoundException:
Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remainingname
'CabinHome'
<<no stack trace available>>
--------------- nested within: ------------------
javax.ejb.EJBException
- with nested exception:
[javax.naming.LinkException: [Root exception is
javax.naming.NameNotFoundException:>> Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining>name>> 'CabinHome'; Link Remaining Name: 'ejb/CabinHome']
atcom.titan.travelagent.TravelAgentBean.listCabins(TravelAgentBean.java:45)
atcom.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl.listCabins(TravelAgentBe
an_a4c3ph_EOImpl.java:37)
atcom.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl_WLSkel.invoke(Unknown
Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
atweblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
:93)
atweblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
atweblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:2
2)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
####<Feb 1, 2002 11:32:40 PM PST> <Info> <Management> <dj> <travelServer><ExecuteThread:
'14' for queue: 'default'> <system> <> <140009> <Configuration changesfor
domain
saved to the repository.>
Do you know what's wrong? how to fix this problem?
Thanks in advance.
DJ -
PageNotFound when using servlets as clients for EJB
Can anyone help me? I have a container managed EJB. I'm using servlets as my client. I placed my EJB's in a jar file and my servlets and html pages in a WAR file. I deployed them using J2EE's deploytool. I can access my html files but not my servlet files. It always says file not found or a 405 error (resource not allowed) I access my servlet this way...
http://localhost:8000/ReservationContextRoot/ReservationAlias
my web.xml file looks like the following:
<?xml version="1.0" encoding="Cp1252"?>
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN' 'http://java.sun.com/j2ee/dtds/web-app_2.2.dtd'>
<web-app>
<display-name>ReservationWAR</display-name>
<description>no description</description>
<servlet> <servlet-name>ReservationServlet</servlet-name>
<display-name>ReservationServlet</display-name>
<description>no description</description>
<servlet-class>ReservationServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ReservationServlet</servlet-name>
<url-pattern>ReservationAlias</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<resource-ref>
<description>no description</description>
<res-ref-name>jdbc/ReservationDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<ejb-ref> <description>no description</description>
<ejb-ref-name>ejb/Reservation</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>ReservationHome</home>
<remote>Reservation</remote>
</ejb-ref>
</web-app>Are you sure your servlet class itself can run without problem? Try debug in the these steps:
1. Change your servlet to simply output some HTML text, so you can be sure tomcat can get to your servlet. If this is OK, it means the servlet itself has problem, probably the EJB stuff.
2. Make sure the EJB container is running.
3. Make your servlet a standalone client (not a servlet) and see if it can run. Pay attention to how you do JNDI lookup of the EJB.
Yi
Maybe you are looking for
-
I updated my iTunes to 10.4.1 and now everytime I try to sync my iPhone 4 the program crashes and I cannot finish the process. It starts to sync without trouble, it finishes step 3 and syncs ok contacts, calendars, markers, notes but when it starts t
-
Hello everyone, I've recently started using Spry for a project I've been asked to work on and I've run in to a few issues since my spec changed on me today. So any help or advice anyone has is very much welcome as I'm very much out my comfort zone at
-
Windows 2012 License activation (MAK)
I have a Windows Server 2012 Std - via OpenLicense (Physical Host + DC and a VM for Exchange 2013) Needed to add Remote Desktop Services - so purchased another License for Windows 2012 Std on the OpenLicense again. Installed Windows 2012 on another P
-
Process and Form version question
a few questions related to the versions of Forms and Processes: 1) in WorkSpace, launch a process, then put the form in "Draft". then modify its XDP, the form gets a new version in the repository. what's going to happen to my Draft? when I launch the
-
HI Experts, I need to forward a workitem from one approver to the alternate approver while retaining the same workitem with the Initial approver, in the middle of a loop. How can I achieve the same as I am not able to get the Workitem ID at the run