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

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..

Related

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?

Worklight 6.2 - java.lang.NullPointerException

In Worklight 6.2, there is new method to deploy the Worklight Project, which is using IBM Worklight Server Configuration Tool
refer here :
http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.deploy.doc/deploy/c_using_server_config_tool.html
After setup Worklight admin, and deploy Worklight Project WAR through that. From my understanding, the worklight project will be called runtime
I found errors on the Websphere Logs as below:
[10/3/14 0:37:55:758 MYT] 0000007e FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on /apps/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/ffdc/server1_6adbbbb2_14.10.03_00.37.55.7436943857084851194341.txt com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters -RE 1123
[10/3/14 0:37:55:758 MYT] 0000007e LocalTranCoor E WLTC0017E: Resources rolled back due to setRollbackOnly() being called.
[10/3/14 0:37:55:769 MYT] 0000007e webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[ServletNameNotFound]: java.lang.NullPointerException
in the http://localhost:9080/worklightconsole/index.html#
Got display as below:
Below is the proof that runtime/worklight project is deployed successfully:
​Next action is to troubleshoot why the runtime/worklight project is not working.
How I can rectify this problem? Thanks.
The exception is in a web container class of WebSphere. You must look at the content of the ffdc file
/apps/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/ffdc/server1_6adbbbb2_14.10.03_00.37.55.7436943857084851194341.txt to see if there are more details in particular the servlet that cannot be found.
But it seems that something is wrong in the Worklight configuration under WAS (viewing the "Servlet not found" error).
The Worklight servlets are in the jar "worklight-jee-library.jar" that is configured as a shared library in WAS.
Without all the WAS logs it is not possible to find the real cause. So you can review the WAS configuration after the deployment by following :
http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.installconfig.doc/admin/t_configuring_websphere_application_server_for_wladmin_manually.html,
http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.installconfig.doc/admin/t_configuring_websphere_application_server_for_oracle_manually_for_wladmin.html,
http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.deploy.doc/admin/t_configuring_websphere_application_server_for_oracle_manually.html,
http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.deploy.doc/admin/t_configuring_websphere_application_server_manually.html
The other reason could be that your Worklight project is not a 6.2 project. How do you build you war file ?

Getting - weblogic.application.ModuleException - No ComponentMBean was found in Application sample with the URI sample/sampleadapter.rar

I'm currently migration our product from J2EE 1.3 to JAVA SE 5. there is a resource adapter called SAMPLEAdapter in our product. I have migrated the ra.xml specific to weblogic to http://xmlns.oracle.com/weblogic/weblogic-connector/1.4/weblogic-connector.xsd and ra.xml to connector_1_5.xsd
After installing the ear when I try to start the ear I get the following error -
weblogic.application.ModuleException: No ComponentMBean was found in Application sample with the URI sample/sampleadapter.rar
at weblogic.application.internal.BaseJ2EEModule.findComponentMBean(BaseJ2EEModule.java:64)
at weblogic.connector.deploy.ConnectorModule.initAndSetClassLoader(ConnectorModule.java:555)
at weblogic.connector.deploy.ConnectorModule.init(ConnectorModule.java:532)
at weblogic.application.internal.ExtensibleModuleWrapper.init(ExtensibleModuleWrapper.java:98)
at weblogic.application.internal.flow.ModuleListenerInvoker.init(ModuleListenerInvoker.java:84)
at weblogic.application.internal.flow.InitModulesFlow.initModule(InitModulesFlow.java:342)
at weblogic.application.internal.flow.InitModulesFlow.initModules(InitModulesFlow.java:355)
at weblogic.application.internal.flow.InitModulesFlow.prepare(InitModulesFlow.java:383)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:706)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:237)
at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:61)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:158)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:61)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:207)
at weblogic.deploy.internal.targetserver.operations.StartOperation.createAndPrepareContainer(StartOperation.java:95)
at weblogic.deploy.internal.targetserver.operations.StartOperation.doPrepare(StartOperation.java:108)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:233)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:749)
at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1238)
at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:252)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:172)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:550)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:295)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:254)
Could any one point to me what the exception might be due to ?

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>

Error testing ejb 3.1 (netbeans-glassifish-junit4)

I'm trying to unit testing a EJB with entity crud operations. I already was capable of testing it just running my web application (and all works), but I want to do it with JUnit.
So, my environment is Netbeans 7, Glassfish 3.1 (JavaDB, EclipseLink), JUnit4.
When I create a test class for my EJB, the code template uses the following line of code that throw an exception when I run the code:
EJBContainer container = javax.ejb.embeddable.EJBContainer.createEJBContainer();
the exception is:
java.lang.RuntimeException: Invalid resource : jdbc/mine__pm
Exception while preparing the app : Invalid resource : jdbc/mine__pm
My EJB has an injected EntityManager that points to my persistence unit. This persistence unit is referencing a data source that I JNDI named jdbc/mine created by Netbeans for my Glassfish. It runs and I can see it on my server. I tried using a glassfish-resource.xml to do the same thing too.
Why doesn't it work?