[J2EE:160167] uses ejb-links but no EJB modules
Dear All
Seeking support/assistance to resolve the below problem. I'm using laster Jdeveloper 11g software publish in 2011.
weblogic.deployment.EnvironmentException: [J2EE:160167]The module abc-ViewController-context-root in application abc_Project1_abc uses ejb-links but no EJB modules were found for this application
Please provide guidelines why this appears and how to resolve it.
Best Regards
Shahebaz Shaikh
The module abc-ViewController-context-root in application abc_Project1_abc uses ejb-links but no EJB modules were found for this application
Is the application deployed as an EAR application with web and ejb modules? If not, deploy as an EAR application.
Similar Messages
-
Most EJB Links broken on ejb 3 Howto's
Most of the links on this page don't work to access pertinent examples for ejb 3. Definately irritating. Is there a new location for EJB 3 howto documentation.
http://www.oracle.com/technology/tech/java/ejb30.html
Thanks.Hi and Welcome to the Community!
So, the one thing you don't say you tried is to use AutoLoader to reload your current OS version. This actually is very important...with 10.3.2, you cannot fall back to 10.3.1 or earlier...you must stay on 10.3.2. This is due to the governmental requirement for a "kill switch", and this exists in 10.3.2 only and not prior versions, and falling back would put BB out of compliance with those regulations...so falling back to earlier is blocked.
So, I suggest you obtain an AutoLoader for your current OS version, and use that to cleanly reload the current OS onto your device. If it still doesn't work, try other 10.3.2 OS AutoLoaders...maybe there is something in the version you installed that is a problem.
Good luck and let us know! -
Hi,
I am trying to hook up a web service that talks to one of my EJBs. I feel that
I have followed the instructions to the letter, but no matter what I do I keep
getting a ServletException when I try to deploy it.
The EJB I am trying to invoke is deployed in an ejb module called SunstartEJBModule
which is deployed within an application called SunstartApplication.
This is the build file I am using:
<project name="buildWebservice" default="generate-typeinfo">
<target name="generate-typeinfo">
<source2wsdd
javaSource="sunstart/ejbs/webservices/StudentWS.java"
ejbLink="SunstartEJBModule.jar#ejb/StudentWS"
ddFile="ddfiles/web-services.xml"
serviceURI="/StudentService"
/>
</target>
<target name="generate-webservice">
<wspackage
output="ears/SunstartApplication.ear"
contextURI="web_services"
webAppClasses="com.sun.ad.sunstart.ejbs.webservices.StudentWS"
ddFile="ddfiles/web-services.xml"
overwrite="false"
/>
</target>
</project>
The SunstartWS ejb is definitely deployed as I can access it using my ServiceLocator
using java:comp/env/ejb/StudentWS. I notice in the server error log it is trying
to use a slightly different JNDI name to this - java:/app/ejb/SunstartEJBModule.jar#ejb/StudentWS/home
but I can't see how I can control this in the ant script because whenever I remove
the "SunstartEJBModule.jar#ejb/StudentWS" part and change it to "ejb/StudentWS"
it won't even deploy.
The full exception trace I am seeing is:
javax.servlet.ServletException: ERROR: The EJB component named: StudentWS specified
an ejb-link to SunstartEJBModule.jar#ejb/StudentWS, but this ejb-link could not
be found in JNDI. Please ensure that this ejb-link refers to a valid EJB, and
this EJB has already deployed. The exception was: javax.naming.NamingException:
Could not lookup EJB home, tried java:/app/ejb/SunstartEJBModule.jar#ejb/StudentWS/home
and java:/app/ejb/SunstartEJBModule.jar#ejb/StudentWS/localhome
at weblogic.webservice.server.servlet.WebServiceServlet.initLocal(WebServiceServlet.java:132)
at weblogic.webservice.server.servlet.WebServiceServlet.init(WebServiceServlet.java:86)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:993)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:869)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:848)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:787)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:3252)
at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3197)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:3174)
at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServletContext.java:5647)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:869)
at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer.java:2022)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2063)
at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2592)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2515)
at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2317)
at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2399)
at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2311)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2479)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:798)
at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:507)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:465)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>
If anyone know what I Am doing wrong I would be grateful if they would let me
know as this has been driving me nuts over the past few days!
Cheers,
Lucas.Here is am working example of how to use source2wsdd
with an EJB.
http://manojc.com/?sample10
Please check if this works ok for you.
Regards,
-manoj
http://manojc.com
"Lucas King" <[email protected]> wrote in message
news:40d9b346$1@mktnews1...
>
Hi,
I am trying to hook up a web service that talks to one of my EJBs. I feelthat
I have followed the instructions to the letter, but no matter what I do Ikeep
getting a ServletException when I try to deploy it.
The EJB I am trying to invoke is deployed in an ejb module calledSunstartEJBModule
which is deployed within an application called SunstartApplication.
This is the build file I am using:
<project name="buildWebservice" default="generate-typeinfo">
<target name="generate-typeinfo">
<source2wsdd
javaSource="sunstart/ejbs/webservices/StudentWS.java"
ejbLink="SunstartEJBModule.jar#ejb/StudentWS"
ddFile="ddfiles/web-services.xml"
serviceURI="/StudentService"
/>
</target>
<target name="generate-webservice">
<wspackage
output="ears/SunstartApplication.ear"
contextURI="web_services"
webAppClasses="com.sun.ad.sunstart.ejbs.webservices.StudentWS"
ddFile="ddfiles/web-services.xml"
overwrite="false"
/>
</target>
</project>
The SunstartWS ejb is definitely deployed as I can access it using myServiceLocator
using java:comp/env/ejb/StudentWS. I notice in the server error log it istrying
to use a slightly different JNDI name to this -java:/app/ejb/SunstartEJBModule.jar#ejb/StudentWS/home
but I can't see how I can control this in the ant script because wheneverI remove
the "SunstartEJBModule.jar#ejb/StudentWS" part and change it to"ejb/StudentWS"
it won't even deploy.
The full exception trace I am seeing is:
javax.servlet.ServletException: ERROR: The EJB component named: StudentWSspecified
an ejb-link to SunstartEJBModule.jar#ejb/StudentWS, but this ejb-linkcould not
be found in JNDI. Please ensure that this ejb-link refers to a valid EJB,and
this EJB has already deployed. The exception was:javax.naming.NamingException:
Could not lookup EJB home, triedjava:/app/ejb/SunstartEJBModule.jar#ejb/StudentWS/home
and java:/app/ejb/SunstartEJBModule.jar#ejb/StudentWS/localhome
atweblogic.webservice.server.servlet.WebServiceServlet.initLocal(WebServiceSer
vlet.java:132)
atweblogic.webservice.server.servlet.WebServiceServlet.init(WebServiceServlet.
java:86)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
atweblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubI
mpl.java:993)
atweblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec
t.java:317)
atweblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
atweblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java
:869)
atweblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.ja
va:848)
atweblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.jav
a:787)
atweblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletC
ontext.java:3252)
atweblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServlet
Context.java:3197)
atweblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServle
tContext.java:3174)
atweblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServletConte
xt.java:5647)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:869)
atweblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer.java:2
022)
atweblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.jav
a:2063)
atweblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activat
eContainer(SlaveDeployer.java:2592)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2515)
atweblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.jav
a:2317)
atweblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDep
loyer.java:2399)
atweblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.ja
va:2311)
atweblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDep
loyer.java:2479)
atweblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeplo
yer.java:798)
atweblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.ja
va:507)
atweblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.j
ava:465)
atweblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.ja
va:25)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>
If anyone know what I Am doing wrong I would be grateful if they would letme
know as this has been driving me nuts over the past few days!
Cheers,
Lucas. -
i seen every one using media link but i dont want to pay to use it. any apple apps out there for free?
Unfortunately iWeb cannot read or import previously published files, only generate them. You'll have to recreate your site from scratch.
However, Chapter 2.3 on the iWeb FAQ.org site has tips on using some of the existing files, image, audio, video, etc., from the published site in the recreation of the site.
OT -
Ejb-link is still required when using local references?
Hi!
In BEA's link (http://e-docs.bea.com/wls/docs81/ejb/DDreference-ejb-jar.html#1114738) there is the following comment for weblogic-ejb-jar.xml element 'jndi-name':
"Assigning a JNDI name to a bean is not recommended. Global JNDI names generate heavy multicast traffic during clustered server startup. See Using EJB Links for the better practice."
Since we're using local references (local-jndi-name) to access our ejbs instead of remote references, is this still recommendation still pertinent?
Thanks
ChristianneIt is enough if you add the ejb-ref & ejb-link in the session bean. The
session will look up relative to java:comp/env
The following doc shows an example of accessing an ejb from a web app using
ejb-link.
http://e-docs.bea.com/wls/docs81/webapp/components.html#146848
--Sathish
<Christianne Carvalho> wrote in message news:[email protected]..
I'm not getting very well how the ejb-link is used. In my case I have
entity beans that are referenced in session beans.
In my entity beans I have the following XDoclet tag.
* @ejb.bean
* name="ProductDescription"
* display-name="ProductDescription"
* jndi-name="ejb/ProductDescription"
* local-jndi-name="ejb/ProductDescriptionLocal"
* view-type="local"
* type="CMP"
In my session bean I'm currently getting the reference for the entity bean
using the following code:
productDescriptionLocalHome=(ProductDescriptionLocalHome)
lookupLocalHome(ProductDescriptionLocalHome.JNDI_NAME);
If I add the following XDoclet tag to my session bean, in ejb-jar.xml a
<ejb-link> is created inside <ejb-local_ref> tag.
* @ejb.ejb-ref ejb-name="ProductDescription" view-type="local"
Considering the info above:
1) In the entity bean, is there any extra tag to define the ejb-link or is
the ejb-link only defined in the session bean?
2) Re session bean, only adding the @ejb-ref xdoclet tag is enough for
using the ejb-link or do I also have to change my lookup? If I do, what do
I have to search for in the lookup?
Thanks! -
i have deploy an EJB in weblogic 6.1,but how to use jsp to invoke the EJB's method?
thanks!You'd do something like:
<%
//vvv this part can potentially be done in initialization
Context ctx = getInitialContext();
BeanHome home =
(BeanHome)PortableRemoteObject.narrow(ctx.lookup("the.jndi.name"),
BeanHome.class);
Bean b = home.create();
//^^^
Result r = b.invokeMethod();
%>
"toxin" <[email protected]> wrote in message
news:3d2e95e5$[email protected]..
>
i have deploy an EJB in weblogic 6.1,but how to use jsp to invoke theEJB's method?
thanks! -
Error: Unresolved ejb-link :
I want to call a session bean from a servlet.while deploying i am getting the error
Error: Unresolved <ejb-link>:
I am using Netbeans 6.0 IDE. here i am posting my code.
Calling code in servlet :
Context ctx = new InitialContext();
Object objref = ctx.lookup("java:comp/env/ejb/Etrack");
testBean=(MyHome)PortableRemoteObject.narrow(objref,MyHome.class);
web.xml :
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>MyClientServlet</servlet-name>
<servlet-class>MyClientServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MyClientServlet</servlet-name>
<url-pattern>/MyClientServlet</url-pattern>
</servlet-mapping>
<ejb-local-ref>
<ejb-ref-name>ejb/Etrack</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>MyHome</local-home>
<local>MyRemote</local>
<ejb-link>Etrack</ejb-link>
</ejb-local-ref>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
My ejb-jar.xml :
<?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>
<enterprise-beans>
<session>
<display-name>Etrack Bean</display-name>
<ejb-name>Etrack</ejb-name>
<local-home>MyHome</local-home>
<local>MyRemote</local>
<ejb-class>MyEjbClass</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/Etrack</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>MyHome</local-home>
<local>MyRemote</local>
<ejb-link>Etrack</ejb-link>
</ejb-local-ref>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>Etrack</ejb-name>
<method-intf>Local</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
My sun-ejb-jar.xml :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1 EJB 2.1//EN" "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_2_1-1.dtd">
<sun-ejb-jar>
<enterprise-beans>
<ejb>
<ejb-name>Etrack</ejb-name>
<stateless-session-descriptor>
<bean-pool>
<steady-pool-size>10</steady-pool-size>
<resize-quantity>10</resize-quantity>
<max-pool-size>100</max-pool-size>
<pool-idle-timeout-in-seconds>600</pool-idle-timeout-in-seconds>
</bean-pool>
</stateless-session-descriptor>
<jndi-name>ejb/Etrack</jndi-name>
<pass-by-reference>true</pass-by-reference>
<ejb-ref>
<ejb-name>Etrack</ejb-name>
<ejb-ref-name>ejb/Etrack</ejb-ref-name>
<jndi-name>ejb/Etrack</jndi-name>
</ejb-ref>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
Can anyone help me in resolving this issue.It will be a great help for me.Thanks in advanceYou could always try removing the ejb-link, and see if the container can inject a reference in the runtime environment (accessible using jndi java:comp/env/ejb/Etrack).
If it doesn't, check these:
1) http://www.redhat.com/docs/manuals/rhaps/jonas-guide/ch-beans-ejbref.html
2) the ejb 2.0 spec, which the original poster was using (although this is the same in 2.1 and 3.0), states the folowing:
+20.3.2 Application Assembler’s responsibilities+
The Application Assembler can use the ejb-link element in the deployment descriptor to link an*
EJB reference to a target enterprise bean.*
The Application Assembler specifies the link between two enterprise beans as follows:*
+• The Application Assembler uses the optional ejb-link element of the ejb-ref or+
ejb-local-ref element of the referencing enterprise bean. The value of the ejb-link*
element is the name of the target enterprise bean. (It is the name defined in the ejb-name element*
of the target enterprise bean.) The target enterprise bean can be in any ejb-jar file in the*
same J2EE application as the referencing application component.*
+• Alternatively, to avoid the need to rename enterprise beans to have unique names within an+
entire J2EE application, the Application Assembler may use the following syntax in the*
ejb-link element of the referencing application component. The Application Assembler*
specifies the path name of the ejb-jar file containing the referenced enterprise bean and*
appends the ejb-name of the target bean separated from the path name by # . The path name*
is relative to the referencing application component jar file. In this manner, multiple beans with*
the same ejb-name may be uniquely identified when the Application Assembler cannot*
change ejb-names.*
+• The Application Assembler must ensure that the target enterprise bean is type-compatible with+
the declared EJB reference. This means that the target enterprise bean must be of the type indicated*
in the ejb-ref-type element, and that the home and component interfaces of the target*
enterprise bean must be Java type-compatible with the interfaces declared in the EJB*
reference.*
The following illustrates an ejb-link in the deployment descriptor.*
+...+
*+<enterprise-beans>+*
*+<session>+*
+...+
*+<ejb-name>EmployeeService</ejb-name>+*
*+<ejb-class>com.wombat.empl.EmployeeServiceBean</ejb-class>+*
+...+
*+<ejb-ref>+*
*+<ejb-ref-name>ejb/EmplRecord</ejb-ref-name>+*
*+<ejb-ref-type>Entity</ejb-ref-type>+*
*+<home>com.wombat.empl.EmployeeRecordHome</home>+*
*+<remote>com.wombat.empl.EmployeeRecord</remote>+*
*+<ejb-link>EmployeeRecord</ejb-link>+*
*+</ejb-ref>+*
+...+
*+</session>+*
+...+
*+<entity>+*
*+<ejb-name>EmployeeRecord</ejb-name>+*
*+<home>com.wombat.empl.EmployeeRecordHome</home>+*
*+<remote>com.wombat.empl.EmployeeRecord</remote>+*
+...+
*+</entity>+*
+...+
*+</enterprise-beans>+*
+...+
The Application Assembler uses the ejb-link element to indicate that the EJB reference “Empl-*
Record” declared in the EmployeeService enterprise bean has been linked to the EmployeeRecord*
enterprise bean.</stro
The following example illustrates using the ejb-link element to indicate an enterprise bean reference*
to the ProductEJB enterprise bean that is in the same J2EE application unit but in a different ejb-jar*
file.*
*+<entity>+*
+...+
*+<ejb-name>OrderEJB</ejb-name>+*
*+<ejb-class>com.wombat.orders.OrderBean</ejb-class>+*
+...+
*+<ejb-ref>+*
*+<ejb-ref-name>ejb/Product</ejb-ref-name>+*
*+<ejb-ref-type>Entity</ejb-ref-type>+*
*+<home>com.acme.orders.ProductHome</home>+*
*+<remote>com.acme.orders.Product</remote>+*
*+<ejb-link>../products/product.jar#ProductEJB</ejb-link>+*
*+</ejb-ref>+*
+...+
*+</entity>+* -
Ejb-link not working when i access ejb in different ear
Hi All
I am here trying to access ejb's which is in different ear, I am providing ejb-link inside web.xml of war file deployed inside deffirent ear file.
I am using wls8.1sp5. I tried different combination with elb-link name , but its not working . <ejb-ref>
<ejb-ref-name>ejb/AuditService</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.onstar.audit.ejb.AuditServiceHome</home>
<remote>com.onstar.audit.ejb.AuditService</remote>
<ejb-link>ccarenewal.jar#AuditService</ejb-link>
</ejb-ref>
<ejb-ref>
<ejb-ref-name>ejb/AccountService</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.onstar.account.ejb.AccountServiceHome</home>
<remote>com.onstar.account.ejb.AccountService</remote>
<ejb-link>ccarenewal.jar#AccountService</ejb-link>
</ejb-ref>
Exception:weblogic.management.ApplicationException: activate failed for sbwo Module: sbwo Error: weblogic.management.DeploymentException: Could not setup environment - with nested exception: [weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'ccarenewal.jar#AuditService' declared in the ejb-ref or ejb-local-ref 'ejb/AuditService' in the application module 'accountadj.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.] weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'ccarenewal.jar#AuditService' declared in the ejb-ref or ejb-local-ref 'ejb/AuditService' in the application module 'accountadj.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct. at weblogic.deployment.EnvironmentBuilder.addEJBLinkRef(EnvironmentBuilder.java:658) at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:467) at weblogic.servlet.internal.CompEnv.init(CompEnv.java:123) at weblogic.servlet.internal.WebAppServletContext.activate
I will appreciate any help.
RajivRob,
Thanks for your reply.
Below is all deployment descriptor entries i have(ejb-jar.xml, weblogic-ejb-jar.xml, web.xml, weblogic.xml)
please correct me if i have wrong entries any where.
ejb-jar.xml
ejb-ref>
<description />
<ejb-ref-name>ejb/AccountService</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.onstar.account.ejb.AccountServiceHome</home>
<remote>com.onstar.account.ejb.AccountService</remote>
<ejb-link>AccountService</ejb-link>
</ejb-ref>
weblogic-ejb-jar.xml
<ejb-reference-description>
<ejb-ref-name>ejb/AccountService</ejb-ref-name>
<jndi-name>cca/AccountService</jndi-name>
</ejb-reference-description>
web.xml
<ejb-ref>
<ejb-ref-name>ejb/AccountService</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.onstar.account.ejb.AccountServiceHome</home>
<remote>com.onstar.account.ejb.AccountService</remote>
<ejb-link>ccarenewal.jar#AccountService</ejb-link>
</ejb-ref>
weblogic.xml
<ejb-reference-description>
<ejb-ref-name>ejb/AccountService</ejb-ref-name>
<jndi-name>cca/AccountService</jndi-name>
</ejb-reference-description>
I appreciate your help.
Thanks
Rajiv -
Question about using ejb remote home vs ejb reference
hi guys
i am new to EJB and want to understand the difference between these two. i notice that the ejb reference is declared in the ejb-jar.xml so that the calling ejb can get the home object by using
initCtx.lookup("java:comp/env/ejb/CabinHome");which is declared in
<ejb-ref>
<description>Cruise ship cabin</description>
<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-link>CabinBean</ejb-link>
</ejb-ref>how does this differ from using the JNDI to get the home interface. which one is preferred?
thanks for your help.Right, portable Java EE applications always access resources via their component environment rather than doing a direct global JNDI lookup. Declaring the ejb dependency provides a level of indirection that allows it to be mapped to the appropriate target ejb in each application server without requiring any code changes. The same principle is used for other kinds of component dependencies such as data sources, queues, etc.
The downside to this in J2EE 1.4 and earlier was the overhead/complexity of declaring the ejb-ref/ejb-local-ref in the deployment descriptor. Java EE 5 improves this by introducing environment annotations such as @EJB that make it easy to declare the dependencies. In Java EE 5, @EJB is equivalent to ejb-ref/ejb-local-ref but doesn't require the use of .xml.
The bottom line is if you're writing code that's running within a Java EE component, always access Java EE resources/dependencies through your component environment or use an environment annotation.
--ken -
Javax.naming.NameNotFoundException: Unable to resolve ejb-link.
Env: JDK 1.3.1_08
Weblogic: 7.0
We are attempting to use EJB's (session) and have it all localized in a jar.
The Business and Custom Logic is all compiled to WEB-INF/classes. All the jars including the EJB jar is under WEB-INF/lib.
On Startup Weblogic throws the error message
weblogic.management.ApplicationException: activate failed for application
Module Name: application, Error: weblogic.j2ee.DeploymentException: Could not setup environment - with nested exception:
[javax.naming.NameNotFoundException: Unable to resolve ejb-link. Appejb.jar#AppServerBean is not in the context. The context includes the following link bindings: {} Make sure the link reference is relative to the URI of the referencing module.]
I have tried using the ../ notation before the Appejb.jar in the web.xml and what not, but that does not work either.
I have sucesfully deployed the EJB jar through the weblogic console.
Any Clues or suggestions will be most appreciated..
thanks
-aCreate a ear application from the ejb jar and web application war.
Copy ear application to the applications directory.
In the ejb-link element in web.xml specify the relative path to the ejb jar.
<ejb-link>../Appejb.jar</ejb-link>
thanks,
Deepak
Akshay <[email protected]> wrote:
Env: JDK 1.3.1_08
Weblogic: 7.0
We are attempting to use EJB's (session) and have it all localized in
a jar.
The Business and Custom Logic is all compiled to WEB-INF/classes. All
the jars including the EJB jar is under WEB-INF/lib.
On Startup Weblogic throws the error message
weblogic.management.ApplicationException: activate failed for application
Module Name: application, Error: weblogic.j2ee.DeploymentException: Could
not setup environment - with nested exception:
[javax.naming.NameNotFoundException: Unable to resolve ejb-link. Appejb.jar#AppServerBean
is not in the context. The context includes the following link bindings:
{} Make sure the link reference is relative to the URI of the referencing
module.]
I have tried using the ../ notation before the Appejb.jar in the web.xml
and what not, but that does not work either.
I have sucesfully deployed the EJB jar through the weblogic console.
Any Clues or suggestions will be most appreciated..
thanks
-a -
I am fairly new to weblogic and have the following problem on deployment. It complains
about an ejb-link property that cannot be resolved, but I have done a bunch of
research and cannot figure out why I'm getting this problem. The ejb in the ejb-link
is in the same jar as the ejb-jar.xml. The entries look correct. Strange thing
is, the ejb it complains about not being able to deploy isn't even referencing
the other ejb in question. I've attached the ejb-jar.xml we're using. The app
server we were using was fairly liberal with this sort of thing and we got away
with it. There probably is a problem, but it's not clear what. Any help would
be appreciated. I've included the output from weblogic.
[Deployer:149033]preparing application Armanta on Armanta-Custom
[Deployer:149033]prepared application Armanta on Armanta-Custom
[Deployer:149033]activating application Armanta on Armanta-Custom
[Deployer:149033]failed application Armanta on Armanta-Custom
[Deployer:149034]An exception occurred for task [Deployer:149026]Deploy application
Armanta on Armanta-Custom.:
Exception:weblogic.management.ApplicationException: activate failed for ArmantaCustomEJB.jar
Module: ArmantaCustomEJB.jar Error: Exception activating module: EJBModule(ArmantaCustomEJB.jar,status=PREPARED)
Unable to deploy EJB: ejb/CouponType from ArmantaCustomEJB.jar:
weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'ejb/SysProperty'
declared in the ejb-ref or ejb-local-ref 'ejb/SysProperty' in the application
module 'ArmantaCustomEJB.jar' could not be resolved. The target EJB for the ejb-ref
could not be found. Please ensure the link is correct.
at weblogic.ejb20.deployer.EnvironmentBuilder.addEJBLinkRef(EnvironmentBuilder.java:738)
at weblogic.ejb20.deployer.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:537)
at weblogic.ejb20.deployer.EJBDeployer.bindEJBReferences(EJBDeployer.java:1609)
at weblogic.ejb20.deployer.EJBDeployer.activate(EJBDeployer.java:1375)
at weblogic.ejb20.deployer.EJBModule.activate(EJBModule.java:610)
at weblogic.j2ee.J2EEApplicationContainer.activateModule(J2EEApplicationContainer.java:3127)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2081)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2062)
at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2592)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2515)
at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2317)
at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2399)
at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2311)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2479)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:798)
at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:507)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:465)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
[ejb-jar.xml]Thanks Deepak. It's strange that the O'reilly 3rd edition enterprise javabeans
book doesn't mention this.
"Deepak Vohra" <[email protected]> wrote:
>
Refer to http://e-docs.bea.com/wls/docs81/webserv/wsp.html#ejb-link
"Eric Kaplan" <[email protected]> wrote:
I am fairly new to weblogic and have the following problem on deployment.
It complains
about an ejb-link property that cannot be resolved, but I have donea
bunch of
research and cannot figure out why I'm getting this problem. The ejb
in the ejb-link
is in the same jar as the ejb-jar.xml. The entries look correct. Strange
thing
is, the ejb it complains about not being able to deploy isn't even referencing
the other ejb in question. I've attached the ejb-jar.xml we're using.
The app
server we were using was fairly liberal with this sort of thing andwe
got away
with it. There probably is a problem, but it's not clear what. Any help
would
be appreciated. I've included the output from weblogic.
[Deployer:149033]preparing application Armanta on Armanta-Custom
[Deployer:149033]prepared application Armanta on Armanta-Custom
[Deployer:149033]activating application Armanta on Armanta-Custom
[Deployer:149033]failed application Armanta on Armanta-Custom
[Deployer:149034]An exception occurred for task [Deployer:149026]Deploy
application
Armanta on Armanta-Custom.:
Exception:weblogic.management.ApplicationException: activate failedfor
ArmantaCustomEJB.jar
Module: ArmantaCustomEJB.jar Error: Exception activating module: EJBModule(ArmantaCustomEJB.jar,status=PREPARED)
Unable to deploy EJB: ejb/CouponType from ArmantaCustomEJB.jar:
weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link
'ejb/SysProperty'
declared in the ejb-ref or ejb-local-ref 'ejb/SysProperty' in the application
module 'ArmantaCustomEJB.jar' could not be resolved. The target EJBfor
the ejb-ref
could not be found. Please ensure the link is correct.
at weblogic.ejb20.deployer.EnvironmentBuilder.addEJBLinkRef(EnvironmentBuilder.java:738)
at weblogic.ejb20.deployer.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:537)
at weblogic.ejb20.deployer.EJBDeployer.bindEJBReferences(EJBDeployer.java:1609)
at weblogic.ejb20.deployer.EJBDeployer.activate(EJBDeployer.java:1375)
at weblogic.ejb20.deployer.EJBModule.activate(EJBModule.java:610)
at weblogic.j2ee.J2EEApplicationContainer.activateModule(J2EEApplicationContainer.java:3127)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2081)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2062)
at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2592)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2515)
at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2317)
at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2399)
at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2311)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2479)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:798)
at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:507)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:465)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) -
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 -
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. -
Using a Java application as EJB consumer
Hi everybody,
I'm new to EJB, and I have to develop a desktop application that will interact with some EJBs. I've done so using JSPs/Servlets as the EJBs consumers, but I can't get it to work with my Java app.
I thought it would be as easy as including some JNDI code in my app, lookup the beans and invoke their methods, but all I get is an exception.
I've read in some tutorials, that the client needs to be registered in the server, or deployed at the same time (or I completely misunderstood it), but I'm still in a development stage, so I don't want to jar everything and redeploy...
I'm using Orion, and I get the following exception:
javax.naming.NamingException: META-INF/application-client.xml resource not found (see J2EE spec, application-client chapter for requirements and format of the file)
I've included though that META-INF/application-client.xml in my app jar.
I've been thinking about using web services as a more standard way to communicate, which do you think will be better?
Anyway, what am I doing wrong, or what should I do to make it work?
What other app server do you recomend?
thanks in advance!
Luis Javier<--I've read in some tutorials, that the client needs to be registered in the server, or deployed at the same time (or I completely misunderstood it), but I'm still in a development stage, so I don't want to jar everything and redeploy...-->
No, client doesnt need to be registered in the server. If your client is a Java App you have to make sure that your app client classpath includes :
1) An Initial Context Factory class to create JNDI context, and it depends on server you deployed EJB components
2) An client support jar file, that contains Home,Remote interfaces and
their implementations of EJBs client will call. This support could be provided by your J2EE server deploy tool at deploying time. J2EE RI deploy tool, for axample, asks deployer if he wants to generate this jar file as he deploy an application containing some EJB module.
Fil -
How to use ADF Query search with EJB 3.0
Hi,
In ADF guide http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/web_search_bc.htm#CIHIJABA
The steps to create query search with ADF Business Components says:
"+From the Data Controls panel, select the data collection and expand the Named Criteria node to display a list of named view criteria.+"
But with EJB, I'm not able to find Named Criteria node. Can we use ADF query search component with EJB? If yes, can you please show me some example, tutorial etc.?
Thanks
BJFor EJBs you'll need to implement the query model on your own.
An example of how the model should look like is in the ADF Faces components demo.
http://jdevadf.oracle.com/adf-richclient-demo/faces/components/query.jspx
Code here:
http://www.oracle.com/technology/products/adf/adffaces/11/doc/demo/adf_faces_rc_demo.html
Maybe you are looking for
-
My new 4th generation iPod touch won't let me view my pictures.. It lets me get into the app but when I try to look at an album it crashes. I've tried resetting and turning it off for a while and nothing has worked. What do I do?
-
ISE 1.3 Upgrade LDAP Issue
We recently upgraded to 1.3 and everything seems fine except that we noticed that the catalyst switches we use AD authentication through ISE for stopped dropping us automatically in enable mode. I did rejoin the device to AD as required post upgrade
-
OOTB Fact table contains Employee detailed Dates
Hi Experts, we Have 4 date columns (pos_entry_dt, grade_entry_dt etc) in HR Fact out of Box fact table(W_WRKFC_EVT_MONTH_F_SNAPSHOT) which are not populated into presentation layer or BMM Layer and is not linked with day dimension. but the dates are
-
Hi, In our SLD under Business Systems definitions all of our "Related integrated Server " fields have no values (No Intgration Server is defined"). I am trying to understand where I am missing an entry in SLD for the integration servers. Thanks
-
WHEN-TREE-NODE-SELECTED want to return parent_id ?
Hello all, In WHEN-TREE-NODE-SELECTED Trigger i want to return the parent_id from the database i have already returned the pk as follows: DECLARE pk INSP_EQUIPMENT.EQUIPMENT_ID%TYPE; PARENT_PK INSP_EQUIPMENT.PARENT_ID%T