I have tried a lot of solutions/ try and error which I got from stackover flow and through googling. Using Weblogic 12.2.1.3 and my project weblogic.xml
<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://xmlns.oracle.com/weblogic/weblogic-web-app
http://xmlns.oracle.com/weblogic/weblogic-web-app/1.8/weblogic-web-app.xsd">
<security-role-assignment>
<role-name>admin</role-name>
<principal-name>Administrators</principal-name>
</security-role-assignment>
<wls:container-descriptor>
<wls:prefer-application-packages>
<wls:package-name>org.opensaml</wls:package-name>
</wls:prefer-application-packages>
<wls:show-archived-real-path-enabled>true</wls:show-archived-real-path-enabled>
</wls:container-descriptor>
</wls:weblogic-web-app>
The issue is, even I mentioned in weblogic.xml about opensaml that take from my project, then also Server is taking from Oracle weblogic. It is not taking from my project. I am using 2.6.6 version of opensaml jar for my project. I have tried with <wls:package-name>org.opensaml.*</wls:package-name> but no success.
The main reason to check weblogic.xml is that when I tried to open one specific url it is showing following error in the browser. But it works for Tomcat server when you open the same url. So my assumption is weblogic.xml --> prefer-application-packages tag is not working.
java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at weblogic.utils.classloaders.GenericClassLoader.defineClassInternal(GenericClassLoader.java:1113)
at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:1046)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1038)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:990)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:104)
at weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:611)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:543)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:496)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:72)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:53)
at org.springframework.security.saml.SAMLBootstrap.postProcessBeanFactory(SAMLBootstrap.java:42)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:284)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:179)
Work Around:
When you delete com.oracle.weblogic.security.opensaml2 from
weblogic-->Module folder, the issue get fix. No need to delete
com.oracle.weblogic.security.opensaml jar.
Related
Everything works fine in eclipse on my test machine, but when I deploy the WAR to the server I receive "Cannot locate JNDI Resource" errors on each attempt to connect with the database.
I am using a resource within WEB-INF/context.xml. The mysql-connector-java-5.1.25-bin.jar is located within the lib folder of the app. I've tried everything I can think of. I'm assuming its a tomcat specific problem because it works fine on the tomcat installation in eclipse. Is there a setting I am missing?
The context.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Resource
name="jdbc/appointmentree" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
url="jdbc:mysql://1.1.1.1/appointmentree"
driverClassName="com.mysql.jdbc.Driver"
username="appointmentree" password="password"
/>
</Context>
The resulting error:
fm.sprout.java.db.DatabaseConnectionException: appointmentree is missing in JNDI.
fm.sprout.java.db.DBConnection.<init>(DBConnection.java:17)
fm.sprout.java.db.MySqlDBHandler.find(MySqlDBHandler.java:108)
com.appointmentree.db.DBUser.findAll(DBUser.java:173)
com.appointmentree.db.DBUser.find(DBUser.java:146)
com.appointmentree.db.DBUser.find(DBUser.java:142)
com.appointmentree.obj.User.getInstance(User.java:39)
com.appointmentree.seeds.Login$1.handle(Login.java:39)
fm.sprout.java.forms.FormHandler.init(FormHandler.java:53)
fm.sprout.java.views.SeedBuilder.post(SeedBuilder.java:103)
com.appointmentree.seeds.Login.onLoad(Login.java:33)
fm.sprout.java.views.SeedPlanter.sow(SeedPlanter.java:131)
fm.sprout.java.session.RequestHandler.doPost(RequestHandler.java:30)
javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
com.appointmentree.session.UserSessionFilter.doFilter(UserSessionFilter.java:72)
root cause
javax.naming.NamingException: com.mysql.jdbc.Driver
org.apache.naming.NamingContext.lookup(NamingContext.java:859)
org.apache.naming.NamingContext.lookup(NamingContext.java:153)
org.apache.naming.NamingContext.lookup(NamingContext.java:830)
org.apache.naming.NamingContext.lookup(NamingContext.java:153)
org.apache.naming.NamingContext.lookup(NamingContext.java:830)
org.apache.naming.NamingContext.lookup(NamingContext.java:153)
org.apache.naming.NamingContext.lookup(NamingContext.java:830)
org.apache.naming.NamingContext.lookup(NamingContext.java:167)
org.apache.naming.SelectorContext.lookup(SelectorContext.java:156)
javax.naming.InitialContext.lookup(InitialContext.java:411)
fm.sprout.java.db.DBConnection.<init>(DBConnection.java:15)
fm.sprout.java.db.MySqlDBHandler.find(MySqlDBHandler.java:108)
com.appointmentree.db.DBUser.findAll(DBUser.java:173)
com.appointmentree.db.DBUser.find(DBUser.java:146)
com.appointmentree.db.DBUser.find(DBUser.java:142)
com.appointmentree.obj.User.getInstance(User.java:39)
com.appointmentree.seeds.Login$1.handle(Login.java:39)
fm.sprout.java.forms.FormHandler.init(FormHandler.java:53)
fm.sprout.java.views.SeedBuilder.post(SeedBuilder.java:103)
com.appointmentree.seeds.Login.onLoad(Login.java:33)
fm.sprout.java.views.SeedPlanter.sow(SeedPlanter.java:131)
fm.sprout.java.session.RequestHandler.doPost(RequestHandler.java:30)
javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
com.appointmentree.session.UserSessionFilter.doFilter(UserSessionFilter.java:72)
The resource in web.xml
<resource-env-ref>
<resource-env-ref-name>jdbc/appointmentree</resource-env-ref-name>
<resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type>
</resource-env-ref>
Try using this:
<resource-ref>
<res-ref-name>jdbc/appointmentree</res-ref-name>
<res-ref-type>javax.sql.DataSource</res-ref-type>
<res-auth>Container</res-auth>
</resource-ref>
I got this information from here: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Resource_Definitions
Turns out I hadn't included the mysql connector jar in the CATALINA_HOME/lib folder. I was under the impression that having the connector in the lib folder of the application was sufficient but I was wrong.
From another stackoverflow question/answer: Tomcat does not recognize the MySQL .jar library
It's not going to work in WEB-INF/lib since the container needs access to the library, and, that is putting it in the classloader of one web app, not the container. While I would have imagined the CLASSPATH approach would work, it's not the standard way to do this. Perhaps there is some other snag that's preventing it from working.
I have created a client to connect to external webservice. This was done by using wsimport to generate the artifacts and then copied the java classes in my existing web application.
I have tomcat on my workstation and this projects deploys and functions perfectly in this environment.
But as soon as I deploy the same to weblogic servers I get the below error.
Can you please help me understand the problem and its potential solution.
java.util.ServiceConfigurationError: javax.xml.ws.spi.Provider: Provider weblogic.wsee.jaxws.spi.WLSProvider could not be instantiated: java.lang.ClassCastException
at java.util.ServiceLoader.fail(ServiceLoader.java:207)
at java.util.ServiceLoader.access$100(ServiceLoader.java:164)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:353)
at java.util.ServiceLoader$1.next(ServiceLoader.java:421)
at javax.xml.ws.spi.Provider.getProviderUsingServiceLoader(Provider.java:180)
at javax.xml.ws.spi.Provider.provider(Provider.java:140)
at javax.xml.ws.Service.<init>(Service.java:92)
Thanks in advance!
In my case importing jaxb - api did the trick
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>...</version>
</dependency>
I changed the version of jaxws-api.jar library and it worked. I was using 2.2.5 and I changed it to 2.1-1 version and it worked for me.
Also, in the META-INF/weblogic-application.xml of your EAR, put
<?xml version="1.0" encoding="UTF-8"?> <weblogic-application xmlns="http://www.bea.com/ns/weblogic/90">
<application-param>
<param-name>webapp.encoding.default</param-name>
<param-value>UTF-8</param-value>
</application-param>
<prefer-application-packages>
<package-name>org.springframework.*</package-name>
<package-name>javax.jws.*</package-name>
<package-name>javax.wsdl.*</package-name>
<package-name>com.ctc.wstx.*</package-name>
<package-name>javax.xml.ws.*</package-name>
<package-name>com.sun.xml.messaging.saaj.*</package-name>
</prefer-application-packages>
This question already has an answer here:
How to properly install and configure JSF libraries via Maven?
(1 answer)
Closed 3 years ago.
I am developing a sample application using JSF 1.2 and PrimeFaces 3.5. I have RAD in my desktop and created a new dynamic web project. I have written xhtml file with primeface editor tag. But, when I ran the project.. it is throwing "java.lang.ClassNotFoundException" for FacesServlet though the servlet exists in the classpath.
My web.xml looks like this
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" 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">
<display-name>
PrimeFacesNew</display-name>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<!-- JSF mapping -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map these files with JSF -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>HelloWorld.xhtml</welcome-file>
</welcome-file-list>
</web-app>
and my HelloWorld.xhtml looks like this
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body>
<h1>Hello World PrimeFaces</h1>
<h:form>
<p:editor value="This is PrimeFace editor" />
</h:form>
</h:body>
</html>
I have added below jars in to my classpath..
myfaces-api-2.1.12.jar
myfaces-impl-2.1.12.jar
myfaces-bundle-2.1.12.jar
slf4j-api-1.7.5.jar
slf4j-simple-1.7.5.jar
primefaces-3.5.jar
and when I ran using tomcat 6.0 in RAD, it is throwing below exception..
SEVERE: Error loading WebappClassLoader
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader#78a978a9
javax.faces.webapp.FacesServlet
Throwable occurred: java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1083)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4045)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4351)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:599)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Jun 18, 2013 1:15:10 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /primefaces threw load() exception
Throwable occurred: java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1083)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4045)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4351)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:599)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
The prime face components are also displayed as question mark in the RAD. I tried all the possible solutions in Google, but it hasn't worked for me. Please correct me where I am doing wrong..
Thanks.
This issue occured to me because i didn't provide path in Deployement option in properties of project:
Right click on project ---> select "properties" --> Deployement assembly --> "ADD" option --> select "java build path entries" --> select path
Faces Servlet class is not recognized from what you added jars
myfaces-api-2.1.12.jar, myfaces-impl-2.1.12.jar
Add below jars to WEB-INF/lib
Download jsf-impl-2.2.5, jsf-api-2.2.5 or from maven dependency jsf-api, jsf-impl
You need to use jsf-impl.jar and jsf-api.jar since you are using JSF 1.2. Other people are also having this problem read this which talks about incompatibility and you specifies the same error which have described here. Hope this helps you resolve this classNotFound error.
if you get classnotfoundExecption error for servlets always check have you added the required
libraries in the WEB-INF/lib folder...
jars added to build path are not available to server components....
you must explicitly add the jars to WEB-INF/lib folder only...
Adding the following dependencies should solve the problem. I was creating a webapp with the JSF dependencies in the web.xml. So, had to add these in pom.xml to get the problem resolved.
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1.7</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.1.7</version>
</dependency>
Use whichever version you require.
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.
I am working on a webapp, using spring 3.0, hibernate. When I try to deploy my app on WAS 7.0, it gives me the error - Failed to load listener: org.springframework.web.context.ContextLoaderListener]: java.lang.ClassNotFoundException:
Here is how my web app looks:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>ABC</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
The exception being thrown is as follows,
com.ibm.ws.webcontainer.webapp.WebApp logError SRVE0293E: [Servlet Error]-[Failed to load listener: org.springframework.web.context.ContextLoaderListener]: java.lang.ClassNotFoundException: class java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
at java.beans.Beans.instantiate(Beans.java:190)
at java.beans.Beans.instantiate(Beans.java:75)
at com.ibm.ws.webcontainer.webapp.WebApp.loadListener(WebApp.java:1643)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.loadListener(WebAppImpl.java:671)
at com.ibm.ws.webcontainer.webapp.WebApp.loadLifecycleListeners(WebApp.java:1554)
So, is there anything wrong in web.xml ?
Edit: Sorry I did not mention, I am using Maven to get the jars. I have the required jar file in the WEB-INF folder too i.e. org.springframework.web.context
Have a look at the following link
http://forum.springsource.org/showthread.php?60812-ClassNotFoundException-org.springframework.web.con-text.ContextLoaderListener
It says you can fix this problem by going to project properties -> Deployment Assembly and adding the Maven Dependency Build Path entry
class java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
at java.beans.Beans.instantiate(Beans.java:190)
Is the .jar file containing org.springframework.web.context.ContextLoaderListener on the classpath?
You have the wrong definition of the spring-web dependency, instead of:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>org.springframework.web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
You should have what I've written in the comments:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
ArtifactId is spring-web. ${spring.version} of course is not important, just be sure it matches your defined version string.
Take any jars that you add to your project and make sure that they're also placed in your WEB-INF/lib directory. This is where your server looks at runtime when 3rd party libs are referenced. They aren't put there automatically; but there are ways you can automate this (ie using an ANT script or something like that). Just to get things up and running though, you can just manually copy/paste jars to that directory. If you add them to that directory outside of your IDE, make sure you refresh the folder from within your IDE after placing the files there.
the java engine fails too find the class (as your exception says: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener)
java will search for the class on the class-path. you have a folder in your web app structure (on the computer where your 'was'-server runs) where you can put jar-files containing classes. you need to put spring.jar or spring-web.jar in this folder. i'm guessing the folder is called lib, and it will probably be located in a folder called WEB-INF, but i'm not sure, cause i don't know 'was'.
after you've put the jar-file in there, you'll probably need to restart your web/app-server. hope this helps! ^^
Project> properties> deployment assembly> add > referenced project class path entries> maven dependencies
Deploy again.
It works for me
Dave is right! You need all the required JARs in two places:
If you are seeing exceptions when you start the server, then you do not have the required JARs in WEB-INF/lib dir, so you need to keep all the JARs there.
If you are seeing any compile errors in your Java code, then you do not have your build path configured correctly. Keep all the JARs you put in WEB-INF/lib in your build path as "Referenced Libraries".
struggled with this same error all day ...
i had the spring-web jar, but turns out that i also needed the spring-context-support jar.
i added it into my pom and everything is working now.
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${org.springframework-version}</version>
</dependency>
error log:
com.ibm.ws.webcontainer.annotation.WASAnnotationHelper collectClasses unable to instantiate class
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
SRVE0293E: [Servlet Error]-[Failed to load listener: org.springframework.web.context.ContextLoaderListener]:
java.lang.ClassNotFoundException: class java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
loadLifecycleListeners SRVE0279E: Error occured while processing global listeners for the application {0}: {1}
java.lang.NullPointerException
at com.ibm.ws.webcontainer.annotation.WASAnnotationHelper.inject(WASAnnotationHelper.java:266)
I had the same exact problem.
Hopefully this helps someone.
Some of my dependency jars were missing from my WEB-INF/lib folder but were there in Referenced libraries.
I had to to do a maven clean install again to make sure all the jars were pulled into the lib folder.
The problem might be in your pom.xml too if it is not able to pull in the jars properly. So keep an eye out for that as well.
Project-> Maven clean and build -> lib folder refresh and make sure all jars are there (or the particular jar that throws the exception)