Getting this error when i try to deploy a project (no Maven) with Weblogic Server. If i deploy with Weblogic 12.1.3 the error is
ClassNotFoundException: org.springframework.web.multipart.MultipartResolver.class
, and with WebLogic 12.2.1.4 the error is the following (error in the same jar):
It could be a jar conflict, but i have only one jar for org.springframework.web. In Properties -> Build Path i have all the jars inside WebApp Libraries:
The hierarchy, on Eclipse, is:
├── Ear project
├── Web project
└── Java Resources
└── resources
└── src (packages with Java classes)
└── Libraries (with all the jars imported from WEB-INF)
└── lib (some javax jar)
└── Web Content
└── assets
└── META-INF
└── WEB-INF
The project works on another machine. So what is the problem in my environment?
My weblogic.application.xml:
<?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.2/weblogic-application.xsd">
<!--weblogic-version:10.3.5.0-->
<wls:application-param>
<wls:param-name>webapp.encoding.default</wls:param-name>
<wls:param-value>UTF-8</wls:param-value>
</wls:application-param>
<wls:prefer-application-packages>
<wls:package-name>org.eclipse.persistence.*</wls:package-name>
<wls:package-name>org.springframework.*</wls:package-name>
<wls:package-name>javax.persistence.*</wls:package-name>
<wls:package-name>org.joda.time.*</wls:package-name>
<wls:package-name>org.apache.log4j.*</wls:package-name>
<wls:package-name>org.slf4j.*</wls:package-name>
<wls:package-name>com.sun.xml.messaging.saaj.*</wls:package-name>
<wls:package-name>javax.xml.soap.*</wls:package-name>
</wls:prefer-application-packages>
<wls:prefer-application-resources>
<wls:resource-name>org.springframework.*</wls:resource-name>
</wls:prefer-application-resources>
</wls:weblogic-application>
I found a solution, removing all the jar files from Webapp Libraries in Eclipse (Right click on the web project and Build Path/Libraries) and adding them on Build Path of the EAR project.