Webapp deployment fails with interface not visible from class loader exception - java

I have a fresh weblogic 12c server where I was trying to deploy a spring hibernate based Webapp and the deployment is failing with following exception:
<Mar 13, 2019 12:58:51,096 PM IST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID "346350192983496" for task "0" on [partition-name: DOMAIN]. Error is: "weblogic.application.ModuleException: java.lang.IllegalArgumentException: interface javax.persistence.EntityManagerFactory is not visible from class loader"
weblogic.application.ModuleException: java.lang.IllegalArgumentException: interface javax.persistence.EntityManagerFactory is not visible from class loader
at weblogic.application.internal.ExtensibleModuleWrapper.prepare(ExtensibleModuleWrapper.java:114)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:192)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:187)
at weblogic.application.utils.StateMachineDriver$ParallelChange.run(StateMachineDriver.java:83)
Truncated. see log file for complete stacktrace
Caused By: java.lang.IllegalArgumentException: interface javax.persistence.EntityManagerFactory is not visible from class loader
at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:581)
at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:557)
at java.lang.reflect.WeakCache$Factory.get(WeakCache.java:230)
at java.lang.reflect.WeakCache.get(WeakCache.java:127)
at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:419)
Truncated. see log file for complete stacktrace
I am using java 8 based web application, here are the versions of the different solutions/ libraries:
Weblogic : 12.2.1.3.0 spring: 5.0.6 hibernate: 5.1.0
weblogic.xml:
<weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app"
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/ejb-jar_3_0.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd">
<context-root>/iamws/adc</context-root>
<wls:container-descriptor>
<wls:prefer-web-inf-classes>false</wls:prefer-web-inf-classes>
<wls:prefer-application-packages>
<wls:package-name>org.springframework.*</wls:package-name>
<wls:package-name>org.joda.*</wls:package-name>
<wls:package-name>com.sun.activation.*</wls:package-name>
<wls:package-name>javax.activation.*</wls:package-name>
<wls:package-name>com.sun.mail.*</wls:package-name>
<wls:package-name>javax.mail.*</wls:package-name>
<wls:package-name>org.slf4j.*</wls:package-name>
<wls:package-name>org.jboss.*</wls:package-name>
<wls:package-name>org.apache.log4j.*</wls:package-name>
<wls:package-name>javax.persistence.*</wls:package-name>
</wls:prefer-application-packages>
</wls:container-descriptor>
</weblogic-web-app>

I was able to solve this by adding following to weblogic.xml:
<wls:package-name>org.hibernate.*</wls:package-name>

Related

WEBLOGIC 14 Issue - "java.lang.ClassNotFoundException: com.ocpsoft.pretty.faces.event.PrettyPhaseListener"

I have to deploy my EAR at Weblogic 14. When I Run application and try to publish this . I face the below errors:
java.lang.Exception: Exception received from deployment driver. See Error Log view for more detail.
at oracle.eclipse.tools.weblogic.server.internal.DeploymentProgressListener.watch(DeploymentProgressListener.java:193)
at oracle.eclipse.tools.weblogic.server.internal.WlsJ2EEDeploymentHelper.redeploy(WlsJ2EEDeploymentHelper.java:686)
at oracle.eclipse.tools.weblogic.server.internal.WlsJ2EEDeploymentHelper.deploy(WlsJ2EEDeploymentHelper.java:495)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishWeblogicModules(WeblogicServerBehaviour.java:1486)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishToServer(WeblogicServerBehaviour.java:944)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishOnce(WeblogicServerBehaviour.java:735)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publish(WeblogicServerBehaviour.java:584)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:776)
at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3184)
at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:357)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: weblogic.application.ModuleException: java.lang.ClassNotFoundException: com.ocpsoft.pretty.faces.event.PrettyPhaseListener
java.lang.ClassNotFoundException: com.ocpsoft.pretty.faces.event.PrettyPhaseListener
I have downloaded various versions of ocpsoft-pretty-faces.jar but it didn't work at all.
Below the faces-config.xml of the project.
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">
.
.
.
<application>
<view-handler>com.ocpsoft.pretty.faces.application.PrettyViewHandler</view-handler>
<navigation-handler>com.ocpsoft.pretty.faces.application.PrettyNavigationHandler</navigation-handler>
</application>
<lifecycle>
<phase-listener>com.ocpsoft.pretty.faces.event.PrettyPhaseListener</phase-listener>
</lifecycle>
How to fix this error.

MyFaces basic project won't start

I'm trying to launch a very basic project found here:
The HelloWorld example of JSF 2.2 with Myfaces
Just cloned the git from here.
Now, I've tried different approach but just can't amend the JSF Mojarra co-existence in my App Server, since I think that this problem:
<27-ott-2018 23.44.46,046 CEST> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 9 task for the application "jsf_myfaces" on [partition-name: DOMAIN].>
<27-ott-2018 23.44.46,048 CEST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application "jsf_myfaces".>
<27-ott-2018 23.44.46,048 CEST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.application.ModuleException: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory.
at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:233)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:228)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
Truncated. see log file for complete stacktrace
Caused By: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory.
at javax.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:561)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:283)
at org.apache.myfaces.context.servlet.FacesContextImplBase.getApplication(FacesContextImplBase.java:169)
at org.apache.myfaces.context.servlet.FacesContextImplBase.getELContext(FacesContextImplBase.java:231)
at javax.faces.component.UIViewRoot.setLocale(UIViewRoot.java:1488)
Truncated. see log file for complete stacktrace
Is just related to that.
Tried JBoss Wildfly 8.2 and Weblogic 12c R2, same story.
This was the correct way to start the project keeping myfaces dependencies jars in front of the ones in the server container:
weblogic-prefer-application-packages-not-working
Probably a simple deployment-descriptor for JBoss would accomplish the same task.

weblogic 12.1.3 ,deployement exception,cannot inherit from final class

I have a ATG application on version 10.2,I am trying to deploy the appplication on weblogic 12.1.3 and facing this exception while server startup
Here is the logs snippet:
<Dec 22, 2017 3:51:04 PM IST> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application "vsi_store".
weblogic.management.DeploymentException: java.lang.VerifyError: Cannot inherit from final class at weblogic.application.internal.BaseDeployment.throwAppException(BaseDeployment.java:123) at weblog
ic.application.internal.BaseDeployment.activate(BaseDeployment.java:260)
at
weblogic.application.internal.EarDeployment.activate(EarDeployment.java:61)
at
weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:16)
at
weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
Truncated. see log file for complete stacktrace
Caused By: java.lang.VerifyError: Cannot inherit from final class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
2)
at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericCla
ssLoader.java:412)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
ClassLoader.java:366)
This issue was happening because of inbuild guava classes in 12.1.3 version of weblogic.They were interfaring with my application guava classes
I solved it by using version 12.1.2.
or you can solve it in 12.1.3 by changing entries of weblogic-application.xml as below:
<wls:prefer-application-packages>
<wls:package-name>com.fasterxml.jackson.*</wls:package-name>
<wls:package-name>com.github.fge.*</wls:package-name>
<wls:package-name>org.joda.*</wls:package-name>
<wls:package-name>com.google.common.*</wls:package-name>
<wls:package-name>com.sun.jersey.*</wls:package-name>
<wls:package-name>org.glassfish.jersey.*</wls:package-name>
<wls:package-name>org.glassfish.hk2.*</wls:package-name>
<wls:package-name>org.jvnet.hk2.*</wls:package-name>
<wls:package-name>jersey.repackaged.org.objectweb.asm.*</wls:package-name>
<wls:package-name>com.sun.research.ws.wadl.*</wls:package-name>
<wls:package-name>com.sun.ws.rs.ext.*</wls:package-name>
<wls:package-name>org.codehaus.jackson.*</wls:package-name>
<wls:package-name>com.fasterxml.jackson.*</wls:package-name>
<wls:package-name>org.codehaus.jettison.*</wls:package-name>
<wls:package-name>javax.ws.rs.*</wls:package-name>
<wls:package-name>org.objectweb.asm.*</wls:package-name>
<wls:package-name>antlr.*</wls:package-name>
</wls:prefer-application-packages>
</wls:weblogic-application>

Oracle Weblogic: The root element web-app is missing in the descriptor file

I am trying to use JAX-RS to create a web service hosted on an Oracle Weblogic server. I am new to this technology, so I just followed tutorials given by my instructor. Here is my code:
WebContent/WEB-INF/web.xml
<servlet>
<servlet-name>Jersey REST Service</servlet-name>
<servlet-class>
com.sun.jersey.spi.container.servlet.ServletContainer
</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.edu.cs157b.restful </param-name>
<param-value>AssignmentTwo</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
<servlet-mapping>
<servlet-name>Jersey REST Service</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
</servlet>
WebContent/WEB-INF/weblogic.xml
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" 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 http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.5/weblogic-web-app.xsd">
<wls:weblogic-version>12.1.2</wls:weblogic-version>
<wls:context-root>AssignmentTwo</wls:context-root>
</wls:weblogic-web-app>
Here is the error I am getting
<Mar 11, 2014 5:32:16 PM PDT> <Error> <HTTP> <BEA-101064> <[WebAppModule(_auto_generated_ear_:AssignmentTwo)] Error parsing descriptor in Web appplication "/**/AssignmentTwo/WebContent"
weblogic.application.descriptor.MissingRootElementException: [Munger:2156204]The root element web-app is missing in the descriptor file /**/AssignmentTwo/WebContent/WEB-INF/web.xml.
at weblogic.application.descriptor.BasicMunger2._onStartElement(BasicMunger2.java:506)
at weblogic.application.descriptor.BasicMunger2.next(BasicMunger2.java:441)
at weblogic.application.descriptor.VersionMunger._next(VersionMunger.java:342)
at weblogic.application.descriptor.VersionMunger.next(VersionMunger.java:230)
at weblogic.application.descriptor.VersionMunger.consumeInputStream(VersionMunger.java:595)
Truncated. see log file for complete stacktrace
>
<Mar 11, 2014 5:32:16 PM PDT> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID "1394584335621" for task "6". Error is: "weblogic.application.ModuleException: [HTTP:101064][WebAppModule(_auto_generated_ear_:AssignmentTwo)] Error parsing descriptor in Web appplication "/**/AssignmentTwo/WebContent"
weblogic.application.descriptor.MissingRootElementException: [Munger:2156204]The root element web-app is missing in the descriptor file /**/AssignmentTwo/WebContent/WEB-INF/web.xml.
at weblogic.application.descriptor.BasicMunger2._onStartElement(BasicMunger2.java:506)
at weblogic.application.descriptor.BasicMunger2.next(BasicMunger2.java:441)
at weblogic.application.descriptor.VersionMunger._next(VersionMunger.java:342)
at weblogic.application.descriptor.VersionMunger.next(VersionMunger.java:230)
at weblogic.application.descriptor.VersionMunger.consumeInputStream(VersionMunger.java:595)
at weblogic.application.descriptor.VersionMunger.init(VersionMunger.java:485)
at weblogic.application.descriptor.VersionMunger.<init>(VersionMunger.java:86)
at weblogic.application.descriptor.VersionMunger.<init>(VersionMunger.java:62)
at weblogic.application.descriptor.VersionMunger.<init>(VersionMunger.java:50)
at weblogic.servlet.internal.WebAppReader2.<init>(WebAppReader2.java:47)
at weblogic.servlet.internal.WebAppDescriptor$MyWebAppDescriptor.createXMLStreamReader(WebAppDescriptor.java:275)
at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescriptorBean(AbstractDescriptorLoader2.java:406)
at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBeanWithoutPlan(AbstractDescriptorLoader2.java:778)
at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBean(AbstractDescriptorLoader2.java:787)
at weblogic.servlet.internal.WebAppDescriptor.getWebAppBean(WebAppDescriptor.java:142)
at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:1446)
at weblogic.servlet.internal.WebAppModule.init(WebAppModule.java:244)
at weblogic.servlet.internal.WebAppModule.init(WebAppModule.java:681)
at weblogic.application.internal.flow.ScopedModuleDriver.init(ScopedModuleDriver.java:162)
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.ActivateOperation.doPrepare(ActivateOperation.java:96)
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)
[Munger:2156204]The root element web-app is missing in the descriptor file /**/AssignmentTwo/WebContent/WEB-INF/web.xml."
weblogic.application.ModuleException: [HTTP:101064][WebAppModule(_auto_generated_ear_:AssignmentTwo)] Error parsing descriptor in Web appplication "/**/AssignmentTwo/WebContent"
weblogic.application.descriptor.MissingRootElementException: [Munger:2156204]The root element web-app is missing in the descriptor file /**/AssignmentTwo/WebContent/WEB-INF/web.xml.
at weblogic.application.descriptor.BasicMunger2._onStartElement(BasicMunger2.java:506)
at weblogic.application.descriptor.BasicMunger2.next(BasicMunger2.java:441)
at weblogic.application.descriptor.VersionMunger._next(VersionMunger.java:342)
at weblogic.application.descriptor.VersionMunger.next(VersionMunger.java:230)
at weblogic.application.descriptor.VersionMunger.consumeInputStream(VersionMunger.java:595)
at weblogic.application.descriptor.VersionMunger.init(VersionMunger.java:485)
at weblogic.application.descriptor.VersionMunger.<init>(VersionMunger.java:86)
at weblogic.application.descriptor.VersionMunger.<init>(VersionMunger.java:62)
at weblogic.application.descriptor.VersionMunger.<init>(VersionMunger.java:50)
at weblogic.servlet.internal.WebAppReader2.<init>(WebAppReader2.java:47)
at weblogic.servlet.internal.WebAppDescriptor$MyWebAppDescriptor.createXMLStreamReader(WebAppDescriptor.java:275)
at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescriptorBean(AbstractDescriptorLoader2.java:406)
at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBeanWithoutPlan(AbstractDescriptorLoader2.java:778)
at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBean(AbstractDescriptorLoader2.java:787)
at weblogic.servlet.internal.WebAppDescriptor.getWebAppBean(WebAppDescriptor.java:142)
at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:1446)
at weblogic.servlet.internal.WebAppModule.init(WebAppModule.java:244)
at weblogic.servlet.internal.WebAppModule.init(WebAppModule.java:681)
at weblogic.application.internal.flow.ScopedModuleDriver.init(ScopedModuleDriver.java:162)
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.ActivateOperation.doPrepare(ActivateOperation.java:96)
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)
[Munger:2156204]The root element web-app is missing in the descriptor file /**/AssignmentTwo/WebContent/WEB-INF/web.xml.
at weblogic.servlet.internal.WebAppModule.createModuleException(WebAppModule.java:1824)
at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:1473)
at weblogic.servlet.internal.WebAppModule.init(WebAppModule.java:244)
at weblogic.servlet.internal.WebAppModule.init(WebAppModule.java:681)
at weblogic.application.internal.flow.ScopedModuleDriver.init(ScopedModuleDriver.java:162)
Truncated. see log file for complete stacktrace
Caused By: weblogic.application.descriptor.MissingRootElementException: [Munger:2156204]The root element web-app is missing in the descriptor file /**/AssignmentTwo/WebContent/WEB-INF/web.xml.
at weblogic.application.descriptor.BasicMunger2._onStartElement(BasicMunger2.java:506)
at weblogic.application.descriptor.BasicMunger2.next(BasicMunger2.java:441)
at weblogic.application.descriptor.VersionMunger._next(VersionMunger.java:342)
at weblogic.application.descriptor.VersionMunger.next(VersionMunger.java:230)
at weblogic.application.descriptor.VersionMunger.consumeInputStream(VersionMunger.java:595)
Truncated. see log file for complete stacktrace
>
<Mar 11, 2014 5:32:16 PM PDT> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating distribute task for application "_auto_generated_ear_".>
<Mar 11, 2014 5:32:16 PM PDT> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.application.ModuleException: [HTTP:101064][WebAppModule(_auto_generated_ear_:AssignmentTwo)] Error parsing descriptor in Web appplication "/**/AssignmentTwo/WebContent"
weblogic.application.descriptor.MissingRootElementException: [Munger:2156204]The root element web-app is missing in the descriptor file /**/AssignmentTwo/WebContent/WEB-INF/web.xml.
at weblogic.application.descriptor.BasicMunger2._onStartElement(BasicMunger2.java:506)
at weblogic.application.descriptor.BasicMunger2.next(BasicMunger2.java:441)
at weblogic.application.descriptor.VersionMunger._next(VersionMunger.java:342)
at weblogic.application.descriptor.VersionMunger.next(VersionMunger.java:230)
at weblogic.application.descriptor.VersionMunger.consumeInputStream(VersionMunger.java:595)
at weblogic.application.descriptor.VersionMunger.init(VersionMunger.java:485)
at weblogic.application.descriptor.VersionMunger.<init>(VersionMunger.java:86)
at weblogic.application.descriptor.VersionMunger.<init>(VersionMunger.java:62)
at weblogic.application.descriptor.VersionMunger.<init>(VersionMunger.java:50)
at weblogic.servlet.internal.WebAppReader2.<init>(WebAppReader2.java:47)
at weblogic.servlet.internal.WebAppDescriptor$MyWebAppDescriptor.createXMLStreamReader(WebAppDescriptor.java:275)
at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescriptorBean(AbstractDescriptorLoader2.java:406)
at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBeanWithoutPlan(AbstractDescriptorLoader2.java:778)
at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBean(AbstractDescriptorLoader2.java:787)
at weblogic.servlet.internal.WebAppDescriptor.getWebAppBean(WebAppDescriptor.java:142)
at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:1446)
at weblogic.servlet.internal.WebAppModule.init(WebAppModule.java:244)
at weblogic.servlet.internal.WebAppModule.init(WebAppModule.java:681)
at weblogic.application.internal.flow.ScopedModuleDriver.init(ScopedModuleDriver.java:162)
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.ActivateOperation.doPrepare(ActivateOperation.java:96)
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)
[Munger:2156204]The root element web-app is missing in the descriptor file /**/AssignmentTwo/WebContent/WEB-INF/web.xml.
at weblogic.servlet.internal.WebAppModule.createModuleException(WebAppModule.java:1824)
at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:1473)
at weblogic.servlet.internal.WebAppModule.init(WebAppModule.java:244)
at weblogic.servlet.internal.WebAppModule.init(WebAppModule.java:681)
at weblogic.application.internal.flow.ScopedModuleDriver.init(ScopedModuleDriver.java:162)
Truncated. see log file for complete stacktrace
Caused By: weblogic.application.descriptor.MissingRootElementException: [Munger:2156204]The root element web-app is missing in the descriptor file /**/AssignmentTwo/WebContent/WEB-INF/web.xml.
at weblogic.application.descriptor.BasicMunger2._onStartElement(BasicMunger2.java:506)
at weblogic.application.descriptor.BasicMunger2.next(BasicMunger2.java:441)
at weblogic.application.descriptor.VersionMunger._next(VersionMunger.java:342)
at weblogic.application.descriptor.VersionMunger.next(VersionMunger.java:230)
at weblogic.application.descriptor.VersionMunger.consumeInputStream(VersionMunger.java:595)
Truncated. see log file for complete stacktrace
>
The root element web-app is missing in the descriptor file
Your web.xml is missing the root element <web-app>. The nesting is also incorrect. The <servlet-mapping> element is a top-level element like the <servlet> element, not nested inside it.
Your web.xml should have a structure similar to this:
<web-app 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_3_0.xsd"
version="3.0">
<servlet>
<servlet-name>Jersey REST Service</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.edu.cs157b.restful </param-name>
<param-value>AssignmentTwo</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Jersey REST Service</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
</web-app>
If you use an IDE (like Netbeans, Eclipse) when you create a Web-app it will generate a valid web.xml for you. If you create a REST web service it will probably even configure a JAX-RS web.xml for you.

What causes java.net.MalformedURLException: no protocol: when trying to deploy .ear in weblogic?

I am trying to deploy an EAR file. I am new to weblogic. I am using oracle enterprise pack for eclipse. I have a running weblogic server. I created an Enterprise Application Project
My application.xml is:
<?xml version="1.0" encoding="ASCII"?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" version="5">
<display-name>My App</display-name>
<module>
<ejb>appEJB.jar</ejb>
</module>
<module>
<web>
<web-uri>app.war</web-uri>
<context-root>app</context-root>
</web>
</module>
</application>
my weblogic-application.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-application xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic- application" 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/javaee_5.xsd http://xmlns.oracle.com/weblogic/weblogic-application http://xmlns.oracle.com/weblogic/weblogic-application/1.1/weblogic-application.xsd">
<!--weblogic-version:10.3.3-->
<wls:application-param>
<wls:param-name>webapp.encoding.default</wls:param-name>
<wls:param-value>UTF-8</wls:param-value>
</wls:application-param>
</wls:weblogic-application>
I get the error Module named 'EARNAME' failed to deploy. See Error log.
The error log has this stack Trace:
java.lang.Exception: Exception received from deployment driver. See Error Log view for more detail.
at oracle.eclipse.tools.weblogic.server.internal.DeploymentProgressListener.watch(DeploymentProgressListener.java:190)
at oracle.eclipse.tools.weblogic.server.internal.WlsJ2EEDeploymentHelper.deploy(WlsJ2EEDeploymentHelper.java:506)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishWeblogicModules(WeblogicServerBehaviour.java:1466)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishToServer(WeblogicServerBehaviour.java:898)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishOnce(WeblogicServerBehaviour.java:686)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publish(WeblogicServerBehaviour.java:539)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3108)
at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.net.MalformedURLException: no protocol: Files/OracleWebLogic/Middleware/wlserver_10.3/server/lib/../../../modules/features/weblogic.server.modules_10.3.3.0.jar
at java.net.URL.<init>(URL.java:567)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:751)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at java.rmi.MarshalledObject.get(MarshalledObject.java:142)
at javax.management.remote.rmi.RMIConnectionImpl$6.run(RMIConnectionImpl.java:1513)
at java.security.AccessController.doPrivileged(Native Method)
at javax.management.remote.rmi.RMIConnectionImpl.unwrap(RMIConnectionImpl.java:1505)
at javax.management.remote.rmi.RMIConnectionImpl.access$500(RMIConnectionImpl.java:72)
at javax.management.remote.rmi.RMIConnectionImpl$7.run(RMIConnectionImpl.java:1548)
at java.security.AccessController.doPrivileged(Native Method)
at javax.management.remote.rmi.RMIConnectionImpl.unwrap(RMIConnectionImpl.java:1544)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:771)
at javax.management.remote.rmi.RMIConnectionImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
What could be the cause of this failur to deploy? I know the server is running and when I successfully access the gui at localhost:7001/console
I exported the .ear file to the autodeploy folder. Also put a module (.jar) in it.
New Exception:
java.lang.Exception: Exception received from deployment driver. See Error Log view for more detail.
at oracle.eclipse.tools.weblogic.server.internal.DeploymentProgressListener.watch(DeploymentProgressListener.java:190)
at oracle.eclipse.tools.weblogic.server.internal.WlsJ2EEDeploymentHelper.deploy(WlsJ2EEDeploymentHelper.java:506)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishWeblogicModules(WeblogicServerBehaviour.java:1466)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishToServer(WeblogicServerBehaviour.java:898)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishOnce(WeblogicServerBehaviour.java:686)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publish(WeblogicServerBehaviour.java:539)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3108)
at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: weblogic.application.ModuleException:
at weblogic.ejb.container.deployer.EJBModule.init(EJBModule.java:332)
at weblogic.application.internal.flow.ModuleListenerInvoker.init(ModuleListenerInvoker.java:167)
at weblogic.application.internal.flow.InitModulesFlow.initModule(InitModulesFlow.java:285)
at weblogic.application.internal.flow.InitModulesFlow.initModules(InitModulesFlow.java:298)
at weblogic.application.internal.flow.InitModulesFlow.prepare(InitModulesFlow.java:330)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:1221)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:367)
at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:58)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:207)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
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:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: java.io.FileNotFoundException: Unable to find ejb-jar with uri appEJB.jar in ear at C:\Users\Jonathan.Rosenski\workspace\.metadata\.plugins\org.eclipse.core.resources\.projects\EAR\beadep\base_domain\EAR\split_src
at weblogic.ejb.spi.EJBJar.<init>(EJBJar.java:81)
at weblogic.ejb.container.deployer.EJBModule.buildClassFinder(EJBModule.java:199)
at weblogic.ejb.container.deployer.EJBModule.init(EJBModule.java:311)
This looks like a problem caused by a space in a directory name. Looking at the error message:
Caused by: java.net.MalformedURLException:
no protocol:
Files/OracleWebLogic/Middleware/wlserver_10.3/server/lib/../../../modules/features/weblogic.server.modules_10.3.3.0.jar
It seems that the jar file is being referenced by URL as "file://c:/Program Files/OracleWebLogic..." and the space in "Program Files" is causing the exception.
Can you try moving your Install to a different directory, like c:/OracleWebLogic?
This might help somebody.
Remove all occurrences of "wls:" from weblogic.xml (in your case it is weblogic-application.xml) & hopefully it should run fine.
At least it worked for me.
Following on from EJK's correct answer above, I'd just like to add the following work around for anyone getting a similar error.
The way to resolve this is to repace all spaces in the path name with %20, and is a consequence of this Java nuance: MaformedURLException Bug.
For me, this issue arose when trying to specify java VM arguments - more specifically, when trying to specify a codebase for my registry whose path contained spaces.
rmiregistry -J-Djava.rmi.server.codebase="file:/Users/matt/Path With Spaces/"
As the path is in fact treated as a URL, the correct path should be:
rmiregistry -J-Djava.rmi.server.codebase="file:/Users/matt/Path%20With%20Spaces/"
For completeness, I'd like to point out that this error will not actually be thrown when the rmiregistry is run, but when you try run a program that connects to the registry.

Categories

Resources