Forum Stats

  • 3,780,773 Users
  • 2,254,438 Discussions
  • 7,879,446 Comments

Discussions

JAVA Cloud Service : java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config error with S

ouwais.chaoui
ouwais.chaoui Member Posts: 41
edited Jun 30, 2016 4:17AM in Java Cloud Service

Hello folks,

I would like to deploy on the Java Cloud Service a simple MVC application coded with JAVA and the framework SPRING 4.0.

After testing it locally in my laptop, I deployed it and got this error:

[[email protected][app:XXXX module:XXXX.war path:/XXXX spec-version:2.5]] Root cause of ServletException.:TRACE

java.lang.Throwable: 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:133)

at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:209)

at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:257)

at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1183)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:902)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)

at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

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.TailFilter.doFilter(TailFilter.java:26)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60)

at weblogic.servlet.security.internal.WebGateRedirectFilter.doFilter(WebGateRedirectFilter.java:200)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60)

at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)

at java.security.AccessController.doPrivileged(Native Method)

at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324)

at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)

at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)

at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)

at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60)

at oracle.security.wls.filter.SSOSessionSynchronizationFilter.doFilter(SSOSessionSynchronizationFilter.java:292)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60)

at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:163)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60)

at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60)

at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3801)

at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3767)

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:2336)

at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2235)

at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1545)

at weblogic.work.ExecuteThread.execute(ExecuteThread.java:268)

at weblogic.work.ExecuteThread.run(ExecuteThread.java:226)

Even If I added JSTL trough maven, I still get the java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config.


Any ideas why isn't it working on the Cloud ?


For info:

pom.xml :

<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>XXXX</groupId>

  <artifactId>XXXX</artifactId>

  <version>0.0.1</version>

  <packaging>war</packaging>

  <build>

   <sourceDirectory>src</sourceDirectory>

   <plugins>

     <plugin>

       <artifactId>maven-compiler-plugin</artifactId>

       <version>3.1</version>

       <configuration>

         <source>1.7</source>

         <target>1.7</target>

       </configuration>

     </plugin>

     <plugin>

       <artifactId>maven-war-plugin</artifactId>

       <version>2.3</version>

       <configuration>

         <warSourceDirectory>WebContent</warSourceDirectory>

         <failOnMissingWebXml>false</failOnMissingWebXml>

       </configuration>

     </plugin>

   </plugins>

  </build>

  <dependencies>

  <dependency>

  <groupId>org.springframework</groupId>

  <artifactId>spring-context</artifactId>

  <version>4.2.5.RELEASE</version>

  </dependency>

  <dependency>

  <groupId>org.springframework</groupId>

  <artifactId>spring-aop</artifactId>

  <version>4.2.5.RELEASE</version>

  </dependency>

  <dependency>

  <groupId>org.springframework</groupId>

  <artifactId>spring-webmvc</artifactId>

  <version>4.2.5.RELEASE</version>

  </dependency>

  <dependency>

  <groupId>org.springframework</groupId>

  <artifactId>spring-web</artifactId>

  <version>4.2.5.RELEASE</version>

  </dependency>

  <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>

  <dependency>

  <groupId>javax.servlet.jsp</groupId>

  <artifactId>jsp-api</artifactId>

  <version>2.1</version>

  </dependency>

  <dependency>

  <groupId>javax.servlet</groupId>

  <artifactId>servlet-api</artifactId>

  <version>2.5</version>

  </dependency>

  <dependency>

  <groupId>javax.servlet</groupId>

  <artifactId>jstl</artifactId>

  <version>1.2</version>

  </dependency>

  <dependency>

  <groupId>commons-logging</groupId>

  <artifactId>commons-logging</artifactId>

  <version>1.1.3</version>

  </dependency>

  </dependencies>

</project>

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.7/weblogic-web-app.xsd">

    <wls:weblogic-version>12.1.3</wls:weblogic-version>

    <wls:context-root>XXXX</wls:context-root>

    <wls:library-ref>

        <wls:library-name>jstl</wls:library-name>

        <wls:specification-version>1.2</wls:specification-version>

        <wls:exact-match>false</wls:exact-match>

    </wls:library-ref>

</wls:weblogic-web-app>

Thanks in advance.

Regards,

Answers

  • ouwais.chaoui
    ouwais.chaoui Member Posts: 41
    edited Jun 21, 2016 4:01AM

    No ideas folks ?

  • Juan S.
    Juan S. Member Posts: 98 Bronze Badge
    edited Jun 22, 2016 9:23AM

    Hi Ouwais,

    Maybe what I'm about to write is very basic, but it might help though.

    I have no experience in Cloud development, but I have many years programming in Java and I can tell you this: when you get a NoClassDefFoundError is because you have at least one .jar missing. There is no other option.

    You have to figure out in which .jar you have the class javax/servlet/jsp/jstl/core/Config and then you have to add this .jar to the Cloud lib path. And bear in mind that a JSTL in not an actual Java library. This is why even adding the JSTL explicity to the configuration, the error continues to appear.

    Hope it helps.

    Juan

  • ouwais.chaoui
    ouwais.chaoui Member Posts: 41
    edited Jun 24, 2016 9:42AM

    Hi Juan,

    The java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config means (I checked in several forums) that the jstl.jar is missing.

    Even after adding it in my Maven pom.xml file, I get the same error.

    Nobody can help me with that ?


      <span class="token tag" style="color: #990055;"><span class="token tag"><span class="token punctuation" style="color: #999999;"><</span>dependency</span><span class="token punctuation" style="color: #999999;">></span></span><br/> <span class="token tag" style="color: #990055;"><span class="token tag"><span class="token punctuation" style="color: #999999;"><</span>groupId</span><span class="token punctuation" style="color: #999999;">></span></span>javax.servlet<span class="token tag" style="color: #990055;"><span class="token tag"><span class="token punctuation" style="color: #999999;"></</span>groupId</span><span class="token punctuation" style="color: #999999;">></span></span><br/> <span class="token tag" style="color: #990055;"><span class="token tag"><span class="token punctuation" style="color: #999999;"><</span>artifactId</span><span class="token punctuation" style="color: #999999;">></span></span>jstl<span class="token tag" style="color: #990055;"><span class="token tag"><span class="token punctuation" style="color: #999999;"></</span>artifactId</span><span class="token punctuation" style="color: #999999;">></span></span><br/> <span class="token tag" style="color: #990055;"><span class="token tag"><span class="token punctuation" style="color: #999999;"><</span>version</span><span class="token punctuation" style="color: #999999;">></span></span>1.2<span class="token tag" style="color: #990055;"><span class="token tag"><span class="token punctuation" style="color: #999999;"></</span>version</span><span class="token punctuation" style="color: #999999;">></span></span><br/>  <span class="token tag" style="color: #990055;"><span class="token tag"><span class="token punctuation" style="color: #999999;"></</span>dependency</span><span class="token punctuation" style="color: #999999;">></span></span>

  • Srinath Menon-Oracle
    Srinath Menon-Oracle Posts: 6,291 Employee
    edited Jun 27, 2016 1:07AM
    For the pom.xml:
    
    <dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>jstl</artifactId>
    <version>1.2</version>
    <scope>provided</scope>
    </dependency>
    

    Try this and see if the issue still persists ?

  • ouwais.chaoui
    ouwais.chaoui Member Posts: 41
    edited Jun 30, 2016 4:17AM

    No it doesn't work same problem.

This discussion has been closed.