How to deploy EJB and War modules at same time in NetBeans 8.2 and GlassFish 4.1.1 - ejb

I have a problem to deploy EJB and WAR modules at the same time in NetBeans 8.2 on GlassFish 4.1.1. The following message is shown:
[[ Exception Occurred :Error occurred during deployment: Exception while preparing the app : Could not resolve a persistence unit corresponding to the persistence-context-ref-name [ejb.NewMessage/em] in the scope of the module called [TestEJB-ejb]. Please verify your application.. Please see server.log for more details.]]
When I checked server.log file of GlassFish server, I faced with the following erreor message:
[2018-07-28T12:59:45.406+0430] [glassfish 4.1] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=427 _ThreadName=admin-listener(7)] [timeMillis: 1532766585406] [levelValue: 1000] [[
Exception while preparing the app : Could not resolve a persistence unit corresponding to the persistence-context-ref-name [ejb.NewEntityFacade/em] in the scope of the module called [TestEJB-ejb]. Please verify your application.]]
Is there any solution for that?
Thanks for your help.

If you did not start to create your app or if you did not choose your programming framework, you can switch to Java Spring with less headache!
Read the first paragraph of the following link:
https://en.wikipedia.org/wiki/Spring_Framework

Related

WebSphere 8.5, Why AdminApp returns "exception information: websphere.management.application.client.AppDeploymentException"

I have a very simply Jython script over Unix. It was working perfectly during WebSphere 7 and now, after we upgraded to WAS 8.5 it isn't working anymore. Obviously, I changed the path to point to WAS8.5. I spent the whole day struglling to find the reason for this falling and I am completely stuck. The exception descrition doesn't help much.
From a JCL JOB I call the Jython script.
/WebSphere/was85/dtl85cel/ledm85nd/DeploymentManager/profiles/default/bin/wsadmin.sh -lang jython -f /WebSphereDevelopment/scripts/dtl/WAS85/Install.jy
The Jython script is really simple.
Basically, I call AdminApp.install("myEAR path", ...with the options below:
-nopreCompileJSPs -installed.ear.destination /WebSphereDevelopment/MYAPP/dtl/curr/deployment/ -distributeApp -nouseMetaDataFromBinary -nodeployejb -appname DVL-MYAPP -createMBeansForResources -noreloadEnabled -nodeployws -validateinstall warn -processEmbeddedConfig -filepermission ..dll=755#. .so=755#..a=755#.*.sl=755 -noallowDispatchRemoteInclude -noallowServiceRemoteInclude -asyncRequestDispatchType DISABLED -nouseAutoLink -contextroot / -MapModulesToServers ÝÝ MyApp MyApp.war,WEB-INF/web.xml WebSphere:cell=dtl85cel,node=wleMyAppa,server=WLEMYAPP¨¨
)
The error log is:
WASX7017E: Exception received while running file "/WebSphereDevelopment/scripts dtl/MYAPP/MYAPP_DTL_DEPLOY.jy"; exception information: com.ibm.websphere.management.application.client.AppDeploymentException: com.ibm.websphere.management.appliccation.client.AppDeploymentException: ÝRoot exception is java.lang.RuntimeException: Deploying /WebSphere/was85/dtl85cel/ledm85nd/DeploymentManager/profiles/d java.lang.RuntimeException: java.lang.RuntimeException: Deploying /WebSphere/wa s85/dtl85cel/ledm85nd/DeploymentManager/profiles/default/temp/app69105293327198772690.ear failed.
Turn on tracing under wsadmin.properties:
com.ibm.ws.scripting.traceString

Error log faced while deploying ADF in Glassfish3

An application which developed with EJB, ADFFaces on JDeveloper 11.1.2.4 ide. Could be deployed on server at last, but many error lines out about .xsd files. How can i solve that issue?
brgds
...
File: file:/C:/glassfish3/glassfish/domains/domain1/generated/jsp/RestaurantAuto
mation/RestaurantAutomation_RestAutomationVC_webapp1_war/loader_962515257/oracle
/adfdt/model/dvt/schema/binding/gauge.xsd
[Error]: Line -1, Column -1: Invalid reference: ':ledStyleEnum'
[#|2013-11-08T17:27:25.647+0200|INFO|glassfish3.1.2|javax.enterprise.system.cont
ainer.web.com.sun.enterprise.web|_ThreadID=18;_ThreadName=admin-thread-pool-4848
(3);|WEB0671: Loading application [RestaurantAutomation#RestaurantAutomation_Res
tAutomationVC_webapp1.war] at [RestAutomation]|#]
[#|2013-11-08T17:27:26.068+0200|INFO|glassfish3.1.2|javax.enterprise.system.tool
s.admin.org.glassfish.deployment.admin|_ThreadID=18;_ThreadName=admin-thread-poo
l-4848(3);|RestaurantAutomation was successfully deployed in 75,528 milliseconds
.|#]

Getting error while deploying WAR file

I am getting below error while deploying war file .Here JDK version on development machine and deployment machines is same then also i am getting this error.
[05/Jun/2013:11:20:42] failure ( 5712): WebModule[/cover]: WEB2671: Error configuring application listener of class com.bt.cover.ContextListener
java.lang.UnsupportedClassVersionError: com/bt/cover/ContextListener (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1717)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:983)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1431)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1301)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3349)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3743)
at com.iplanet.ias.web.WebModule.start(WebModule.java:251)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:652)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355)
at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431)
at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500)
at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161)
Based on this answer: Unsupported major.minor version 49.0, it looks like you may be running on a different JVM from what you used to compile your code. Hope this helps.

Configure Message Driven Bean using ejb-jar.xml

I am trying to configure Message Driven Bean using ejb-jar. I am using EJB 3.1, Netbeans 7.3 and Glassfish 3.1.2, but I am getting exception:
Exception while deploying the app: org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 29; Deployment descriptor file META-INF/ejb-jar.xml in archive [classes]. Element type "messaging-type" must be declared.. Please see server.log for more details.
Where do I make mistake?
You say that you are using Glassfish 3.1.2, but you validate your ejb-jar-xml file with ejb-jar_2_0.dtd. Instead you must use XSD validation for Glassfish 3.1.2. Here is the xsd:
http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd

RAD 8.5 unable to run standalone java app that calls EJB and MQ

I used to be able to run my standalone java app that calls EJB and MQ using JNDI on RAD 7.5.5. I upgraded to RAD 8.5 and when I tried to run it, I received the error Failed to create InitialContext using factory specified in hashtable. I'm also using the same WAS 7.0.0.9 for both RAD version so I'm not sure why it's not working now.
Is there anything special that I need to do in RAD 8.5?
This is my bootstrap classpath entries: WAS v7.0 JRE, %WAS_RUNTIME%\com.ibm.ws.ejb.thinclient_7.0.0.jar, WAS v7.0 lib.
Below are the lines where I set up the environment (the second line seems to be needed for RAD 8.5):
System.setProperty(Context.PROVIDER_URL, "iiop://localhost:2809");
System.setProperty("com.ibm.ws.naming.wsn.factory.initial", "com.ibm.websphere.naming.WsnInitialContextFactory");
Below is the stack trace from my code:
2012-11-30 16:50:14,945 main FATAL ram.hs.edi.EDIDaemon(line 183) - Unable to get running status: javax.naming.NoInitialContextException: Failed to create InitialContext using factory specified in hashtable. Root exception is java.lang.NullPointerException
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:243)
at javax.naming.InitialContext.initializeDefaultInitCtx(InitialContext.java:327)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:357)
at javax.naming.InitialContext.internalInit(InitialContext.java:295)
at javax.naming.InitialContext.<init>(InitialContext.java:212)
at ram.hs.edi.utils.MQReader.open(MQReader.java:85)
at ram.hs.edi.EDIDaemon.isRunning(EDIDaemon.java:406)
at ram.hs.edi.EDIDaemon.run(EDIDaemon.java:168)
at ram.hs.edi.EDIDaemon.main(EDIDaemon.java:898)
Caused by: java.lang.NullPointerException
at com.ibm.ws.naming.util.CommonHelpers$2.run(CommonHelpers.java:268)
at com.ibm.ws.naming.util.CommonHelpers$2.run(CommonHelpers.java:264)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:63)
at com.ibm.ws.naming.util.CommonHelpers.mergeJndiProviderProperties(CommonHelpers.java:263)
at com.ibm.ws.naming.util.CommonHelpers.mergeWsnJndiProperties(CommonHelpers.java:159)
at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(WsnInitialContextFactory.java:186)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:235)
... 8 more
Thanks
This may be little late answering it but please try to do the following:
1) Add the jar "com.ibm.ws.orb_7.0.0.jar" or equivalent jar on the Bootstrap path of your standalone Java Class.
2) Add the jar "com.ibm.ws.webservices.thinclient_7.0.0" or equivalent jar on the JVM Class path.
After doing the above I was able to get the InitalContext successfully. Hope this helps.

Resources