Failed Glassfish deploy - "Referencing error: this bundle has no bean of name [ClientBean]" - glassfish

I'm trying to run the example from this page : GlassFish-to-GlassFish Remote EJB Invocation
But I get this error when I try to deploy the client on glassfish ("asadmin> deploy client-ejb.jar"):
"Exception while deploying the app [client-ejb] : Referencing error: This bundle has no bean of name [ClientBean]"
I need help, thanks.

I encountered a a similar problem when trying to deploy my application (Exception while deploying the app [my-app] : Referencing error : This bundle has no bean of name [myBeanFacade] ) .Rather weird but all that was needed to solve this was to go to the properties of [my-app] under the build category tree, choose compile and tick the compile on save option. Redeployed my application and viola !!
NB [my-app] contains 2 ejb jars and a web application, one of the ejbs is a library in the web app.

This problem occurred because the guy forgot to add the ServiceIF.class reference in client-ejb.jar.
Execute the command:
jar cvf client-ejb.jar test/ServiceIF.class test/ClientIF.class test/ClientBean.class META-INF/glassfish-ejb-jar.xml
get the new .jar and it will work.

In case you are using a deployment descriptor, then the EJB name should be the same in both the descriptor file.
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>Hello</ejb-name>
<home>com.ejb.test.HelloHome</home>
<remote>com.ejb.test.HelloObject</remote>
<ejb-class>com.ejb.test.HelloBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
**<ejb-name>Hello</ejb-name>**
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
<glassfish-ejb-jar>
<enterprise-beans>
<ejb>
**<ejb-name>Hello</ejb-name>**
<jndi-name>jndi/Hello</jndi-name>
</ejb>
</enterprise-beans>
</glassfish-ejb-jar>

Related

CXF 3.0.2 throwing " java.lang.AssertionError: UNIMPLEMENTED " exception in weblogic10.3

We are trying to make a webservice call using CXF framework involving CXF - ws security and the application being deployed in weblogic 10.3 , but receiving the below exception and seems like the weblogic specific jars are picked up , though the xercesimpl jar is present in the application in /WEB-INF/lib .
Options tried , but did not help:
Setting the weblogic container descriptor with
web-inf preferences
true .
Setting the JVM arguments or system property as -
-Djavax.xml.soap.MessageFactory=com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl
-Djavax.xml.soap.SOAPFactory=com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl
-Djavax.xml.soap.SOAPConnectionFactory=weblogic.wsee.saaj.SOAPConnectionFactoryImpl
Adding xercesimpl jar to maven pom.
Exception
]] Root cause of ServletException.
java.lang.AssertionError: UNIMPLEMENTED
at weblogic.xml.domimpl.NodeImpl.setTextContent(NodeImpl.java:216)
at org.apache.jcp.xml.dsig.internal.dom.XmlWriterToTree.writeAttribute(XmlWriterToTree.java:137)
at org.apache.jcp.xml.dsig.internal.dom.XmlWriterToTree.writeNamespace(XmlWriterToTree.java:114)
at org.apache.jcp.xml.dsig.internal.dom.DOMXMLSignature.marshal(DOMXMLSignature.java:211)
at org.apache.jcp.xml.dsig.internal.dom.DOMXMLSignature.sign(DOMXMLSignature.java:329)
at org.apache.wss4j.dom.message.WSSecSignature.computeSignature(WSSecSignature.java:578)
at org.apache.wss4j.dom.action.SignatureAction.execute(SignatureAction.java:151)
at org.apache.wss4j.dom.handler.WSHandler.doSenderAction(WSHandler.java:226)
at org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor.access$100(WSS4JOutInterceptor.java:54)
at org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptorInternal.handleMessageInternal(WSS4JOutInterceptor.java:282)
at org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java:154)
at org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java:141)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)enter code here
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:98)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:138)
Thanks,
Soumya
I finally found the answer without modifying any weblogic startup script (tested on CXF 2.7.0 and weblogic 10.3.6
The reason for this issue is that CXF is not compatible with weblogic implementation of SAAJ. http://cxf.apache.org/docs/application-server-specific-configuration-guide.html
1.
Q: I have this error: javax.xml.ws.WebServiceException: Cannot create SAAJ factory instance.
A: Please make sure you have the saaj-impl-1.3.jar in the classpath and make sure your app picks up this one instead of weblogic one.
The same issue is also causing the UNIMPLEMENTED error in the question
So my solution is
1) put saaj-impl in classpath. If you are using maven, put the dependency on pom.xml
2) in weblogic.xml (in your resources folder) put
<wls:container-descriptor>
<wls:prefer-application-packages>
<wls:package-name>com.sun.xml.messaging.saaj.*</wls:package-name>
</wls:prefer-application-packages>
</wls:container-descriptor>
3) Restart your server through Node Manager and by right the CXF WS-Security should be working
Hope it helps!

Ejb deployment to WebLogic Server 11g

I am using WebLogic 11g. I am using Eclipse. I have created a EJB project. This project is called 'remote-ejb'.
The bean class HelloWorldBean implements a remote interface HelloWorldBeanRemote with just on method; public String getName();
I then deployed this project as an application successfully.
I then created a second EJB project called cart-ejb. This project uses the bean from the first project. When I deploy this
project I get the following error:
Module named 'cart-ejb' failed to deploy. See Error Log view for more detail.
weblogic.application.ModuleException: java.lang.ClassNotFoundException: beans.HelloWorldBeanRemote
Exception received from deployment driver. See Error Log view for more detail.
How can I fix this error?

Error in transporting an application from development worklight to Worklight Server Consumer Edition

I am using IBM Worklight environment. I have created a small application "SampleHybridProject" using Worklight Developer studio and tested it successfully.
Now when I am trying to deploy it on the Worklight Server Consumer Edition, and hitting the following URL: http://mymachine.com:9080/SampleHybridProject/console
I am getting this error in my browser:
Error 404: com.ibm.ws.webcontainer.servlet.exception.NoTargetForURIException: No target servlet configured for uri: /SampleHybridProject/console
I am using Worklight Edition 5.0.6. The Worklight Server is default "WAS with Liberty profile".
Here are the properties that I changed in worklight.properties file.
publicWorkLightHostname=localhost
publicWorkLightProtocol=http
publicWorkLightPort=9080
publicWorkLightContext=/SampleHybridProject
wl.db.type=MYSQL
wl.db.url=jdbc:mysql://mysqlinstalledonmypc:3306/WRKLGHT
wl.db.username=root
wl.db.password=admin
Here are the changes that I made in application-descriptor.xml:
<worklightServerRootURL>http://${local.IPAddress}:9080/SampleHybridProject</worklightServerRootURL>
Can you tell me what I am doing wrong or what I need to do?
I have found the problem and solved it. The problem is I was having this error in console.log file:
Error creating bean with name 'txManager' defined in URL [jar:file:/C:/ProgramData/IBM/Worklight/WAS85liberty-server/wlp/usr/shared/resou‌​rces/lib/worklight-jee-library.jar!/conf/core.xml]: Invocation of init method failed; nested exception is java.lang.LinkageError: loader constraint violation: loader (instance of com/ibm/ws/classloading/internal/UnifiedClassLoader) previously initiated loading for a different type with name "javax/sql/DataSource"
This was because I had a jar in the server/lib folder of my project which was causing this problem. I removed the jar from server/lib folder and redeployed the .war file. Now the console is getting loaded.
Are you getting any deployment errors in your liberty logs? A 404 on the context root generally means either the WAR was not found, or the context root defaults to something other than 'SampleHybridProject'. If the WAR appears to be loading correctly, it will output where it is listening on similar to:
[AUDIT ] CWWKT0016I: Web application available (default_host): http://[hostname]:port/SampleHybridProject/*
If it says the context root is anything other than SampleHybridProject, you can set it in the tag in liberty's server.xml:
<application id="SampleHybridProject" name="SampleHybridProject"
location="SampleHybridProject.war" type="war"
context-root="SampleHybridProject">
...
</application>

Drools Guvnor on Glassfish error

I'm trying to deploy Guvnor (guvnor-5.5.0.Final-tomcat-6.0) to a fresh
glassfish server ( 3.1.2.2 build 5) and am getting the error below.
I did try the other WARs without any luck and I get the same error on
OSX and windows.
Error occurred during deployment: Exception while loading the app :
java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException:
java.lang.NoClassDefFoundError: org/apache/AnnotationProcessor. Please
see server.log for more details
Are there any work-around for this ?
Add the jasper-xxx.jar to your lib. It should work. If you deploy in tomcat, it should be in catalina.jar.
Unfortunately JBOSS 7 doesn't use tomcat instead it uses JBossWeb. That's why you have this problem.
Take the guvnor-5.5.0.Final-jboss-as-7.0.war binary war file
add dom4j-1.6.1.jar
remove javassit*.jars
add resteasy-jaxb-provider-2.2.3.GA.jar
add resteasy-jaxrs-2.2.3.GA.jar
Add the a glassfish-web.xml file to WEB-INF https://github.com/snowch/glassfish-guvnor/blob/master/src/main/webapp/WEB-INF/glassfish-web.xml
Replace WEB-INF/web.xml with this https://github.com/snowch/glassfish-guvnor/blob/master/src/main/webapp/WEB-INF/web.xml
Repackage the binary war file and deploy to glassfish

cannot find EJB reference while deploying ADF Fusion Webapp into oracle weblogic server

I created a Fusion Webapplication project with Oracle jdeveloper 11g (11.1.5 but the same problem occours with the 11.2.1 version). Then I created a jsf page and I deployed the project to an external weblogic server (WL 10.3) with the ADF runtime support and evrithing where working.
Then I created the POJOs object (to the model project, because I have 2 proj: Model and ViewController for the web pages and backing beans) from the DB tables and a session bean who provides queries methods. After that (and so far everything it's ok) I added an ADF Data Control bound to the session bean and then I bound (via editor) one of these methods into the jsf page using an ADF table.
If I run the project using the run button everything work, but if I deploy it into both the external deployment WL server and in the internal one I get the following error
[05:30:04 PM] [Deployer:149193]Operation 'deploy' on application 'Prova_application1' has failed on 'AdminServer'
[05:30:04 PM] [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application Prova_application1 on AdminServer.: Could not setup environment.
[05:30:04 PM] Weblogic Server Exception: weblogic.application.ModuleException: Could not setup environment
[05:30:04 PM] Caused by: weblogic.deployment.EnvironmentException: [J2EE:160167]The module Prova-ViewController-context-root in application Prova_application1 uses ejb-links but no EJB modules were found for this application.
[05:30:04 PM] See server logs or server console for more details.
[05:30:04 PM] weblogic.application.ModuleException: Could not setup environment
[05:30:04 PM] #### Deployment incomplete. ####
[05:30:04 PM] Remote deployment failed
but there is such refernce into the web.xml and I bound the Model project into the deployment descriptor. I red every post in the web but I still can't face the problem.
The web.xml in the ViewController project contains the EJB reference (automatically created from jdeveloper) and I bound everithing the Model project but it still doesn't work.
In JDeveloper IDE
you need to set ejb-jar.xml path.
- Right click on your project
- Choose Project Properties
- Go to EJB Module
- Set EJB Version (For example: "2.1")
- Set ejb-jar.xml path (For example: "..\src\META-INF\ejb-jar.xml")
I hope it works..