2016-07-08 19 views
5

Otrzymuję następujący błąd podczas wdrażania pliku wojny w serwerze weblogic. Stworzyłem to za pomocą Maven.Błąd 500 - Wewnętrzny błąd serwera java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config

java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config 
at org.springframework.web.servlet.support.JstlUtils.exposeLocalizationContext(JstlUtils.java:97) 
at org.springframework.web.servlet.view.JstlView.exposeHelpers(JstlView.java:135) 
at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:211) 
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:264) 
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208) 
at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992) 
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939) 
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) 
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) 
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) 
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) 
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) 
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) 
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301) 
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184) 
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3750) 
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3714) 
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) 
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) 
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2283) 
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2182) 
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1491) 
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:252) 
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221) 

Mam również jstl-1.2 w lib i jstl-1.2 w weblogic.Ale uzyskać ten sam wyjątek.

Próbowałem również usunąć plik jstl-1.2 z folderu wojny lib.Nawet uzyskując ten sam wyjątek.

Jaki może być tego powód?

To mój pom

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
 
    <modelVersion>4.0.0</modelVersion> 
 
    <groupId>se.jo.joassivosWebApp</groupId> 
 
    <artifactId>MApp</artifactId> 
 
    <packaging>war</packaging> 
 
    <version>0.0.1-SNAPSHOT</version> 
 
    <name>MApp Maven Webapp</name> 
 
    <url>http://maven.apache.org</url> 
 
    <dependencies> 
 

 
<dependency> 
 
    <groupId>javax.servlet</groupId> 
 
    <artifactId>servlet-api</artifactId> 
 
    <version>2.4</version> 
 
</dependency> 
 

 

 
<dependency> 
 
\t <groupId>javax.servlet</groupId> 
 
\t <artifactId>jstl</artifactId> 
 
\t <version>1.2</version> 
 
</dependency> 
 

 
<dependency> 
 
\t <groupId>antlr</groupId> 
 
\t <artifactId>antlr</artifactId> 
 
\t <version>2.7.7</version> 
 
</dependency> 
 

 
<dependency> 
 
\t <groupId>commons-collections</groupId> 
 
\t <artifactId>commons-collections</artifactId> 
 
\t <version>3.2</version> 
 
</dependency> 
 
<dependency> 
 
\t <groupId>commons-logging</groupId> 
 
\t <artifactId>commons-logging</artifactId> 
 
\t <version>1.1.1</version> 
 
</dependency> 
 
<dependency> 
 
\t <groupId>dom4j</groupId> 
 
\t <artifactId>dom4j</artifactId> 
 
\t <version>1.6.1</version> 
 
</dependency> 
 

 
<dependency> 
 
\t <groupId>org.hibernate</groupId> 
 
\t <artifactId>hibernate</artifactId> 
 
\t <version>3.2.6.ga</version> 
 
</dependency> 
 
<dependency> 
 
\t <groupId>org.hibernate</groupId> 
 
\t <artifactId>hibernate-annotations</artifactId> 
 
\t <version>3.3.0.ga</version> 
 
</dependency> 
 
<dependency> 
 
\t <groupId>org.hibernate</groupId> 
 
\t <artifactId>hibernate-commons-annotations</artifactId> 
 
\t <version>3.3.0.ga</version> 
 
</dependency> 
 

 
<dependency> 
 
\t <groupId>org.codehaus.jackson</groupId> 
 
\t <artifactId>jackson-mapper-asl</artifactId> 
 
\t <version>1.6.3</version> 
 
</dependency> 
 

 
<dependency> 
 
\t <groupId>javax.transaction</groupId> 
 
\t <artifactId>jta</artifactId> 
 
\t <version>1.1</version> 
 
</dependency> 
 
<dependency> 
 
\t <groupId>log4j</groupId> 
 
\t <artifactId>log4j</artifactId> 
 
\t <version>1.2.12</version> 
 
</dependency> 
 

 
<dependency> 
 
\t <groupId>org.springframework</groupId> 
 
\t <artifactId>spring-orm</artifactId> 
 
\t <version>3.1.0.RELEASE</version> 
 
</dependency> 
 

 
<dependency> 
 
\t <groupId>org.springframework</groupId> 
 
\t <artifactId>spring-webmvc</artifactId> 
 
\t <version>3.1.0.RELEASE</version> 
 
</dependency> 
 
<dependency> 
 
     <groupId>com.oracle</groupId> 
 
     <artifactId>ojdbc14</artifactId> 
 
     <version>10.2.0.2.0</version> 
 
</dependency> 
 
    
 
    </dependencies> 
 
<!-- <build> 
 
    <finalName>MApp</finalName> 
 
    </build> --> 
 
    
 
<build> 
 
     <finalName>MApp</finalName> 
 
     <plugins> 
 
      <plugin> 
 
       <groupId>org.apache.tomcat.maven</groupId> 
 
       <artifactId>tomcat7-maven-plugin</artifactId> 
 
       <version>2.0</version> 
 
      </plugin> 
 
      <plugin> 
 
       <groupId>org.apache.maven.plugins</groupId> 
 
       <artifactId>maven-compiler-plugin</artifactId> 
 
       <version>2.3.2</version> 
 
       <configuration> 
 
        <source>1.6</source> 
 
        <target>1.6</target> 
 
       </configuration> 
 
      </plugin> 
 
      <plugin> 
 
       <groupId>org.apache.maven.plugins</groupId> 
 
       <artifactId>maven-war-plugin</artifactId> 
 
       <version>2.1.1</version> 
 
       <configuration> 
 
        <warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory> 
 
        <packagingExcludes>WEB-INF/lib/xercesImpl-2.0.2.jar,WEB-INF/lib/xml-apis-1.0.b2.jar</packagingExcludes> 
 
        
 
       </configuration> 
 
      </plugin> 
 
      <plugin> 
 
       <groupId>org.apache.maven.plugins</groupId> 
 
       <artifactId>maven-surefire-plugin</artifactId> 
 
       <version>2.17</version> 
 
       <configuration> 
 
        <argLine>-XX:-UseSplitVerifier</argLine> 
 
       </configuration> 
 
      </plugin> 
 
     </plugins> 
 
     
 
    </build> 
 
    
 
    
 
</project>

To jest moja wojna lib

enter image description here

enter image description here

+1

Czy możesz pokazać swój plik pom? – Jens

+0

Założę się, że istnieje konflikt bibliotek JSTL różnych wersji. Znajdź wszystkie wersje zainstalowanej biblioteki, w swoim pliku EAR, w swoich WARach oraz w instalacji WebLogic. Sprawdź również zatwierdzone biblioteki. Jakie wersje Spring, WebLogic, JSF używasz? –

+0

przy użyciu weblogic 10.3.6.0 – smith

Odpowiedz

0

Problemem jest weblogic.xml.I didnot dodać weblogic.xml.After dodanie weblogic.xml z tagiem preferują-WEB-INF-klasy Teraz działa dobrze. Dodałem wersję weblogic.xml na wiosnę i hibernację z tagiem prefer-web-inf-classes.

+0

Ustawiając tę ​​wartość, mówisz weblogowi, aby faworyzował wszystko, co znajduje się w folderze WEB-INF/lib, nad tym, co jest dostarczane z serwerem aplikacji. Pozwól mi się nie zgodzić, że naprawdę chcesz zastąpić aplet serwletu. To, co zrobiłeś, to obejście problemu, nie jest rozwiązaniem. Skutecznie, czego chcesz, to usunięcie z folderu lib wszystkiego, co nie jest potrzebne. –

8

Proszę ustawić th Zakres zależności w maven dla servlet-api w pom.xml do "provided". Zrób to samo dla zależności od jstl. Są już częścią twojego Weblogic. Nie ma absolutnie żadnego powodu, aby pakować serwlety do twojego słoika.

Upewnij się, że nie ma ich w folderze biblioteki wojny. Jeśli nadal musisz sprawdzić zależności przechodnie. Możesz je znaleźć za pomocą polecenia "mwn dependency: tree".

+1

Niektóre inne kontenery na serwlety, takie jak Tomcat, wymagają zainstalowania pliku jstl.jar ze swoją wojną, ale na serwerach aplikacji takich jak Weblogic, gdzie jest już dostarczony przez serwer, zdecydowanie nie chcesz pakować go ze swoją wojną. –

0

java.lang.NoClassDefFoundError: Ten błąd zostanie zgłoszony, gdy nie ma pliku .class w czasie ładowania klas klas ładujących klasy w środowisku wykonawczym. Ten wyjątek jest również wywoływany, gdy plik klasy jest również obecny. Te sytuacje są,

  • Podczas inicjowania zmiennych statycznych.
  • Wyjątek podniesiony podczas inicjowania bloków statycznych.

W twoim przypadku zadeklaruj "dostarczone" w twoim "aplet-api" i "jstl". Jeśli nie masz problemu zadeklaruj to samo dla większości zależności. kiedy deklarujesz określoną zależność w POM.XML, powinieneś sprawdzić, czy inne zależności będą z nią kompatybilne czy nie.

-1

Zasadniczo szuka corelib core z jstl jar. Spróbuj dodać do pom poniżej lub zastąpienia istniejącego zależność JSTL:

<dependency> 
    <groupId>javax.servlet.jsp.jstl</groupId> 
    <artifactId>jstl-api</artifactId>   
</dependency> You can also add <version>4.0.0-b01</version> if it needs. 
Hope this helps. 
Powiązane problemy