Showing posts with label javac. Show all posts
Showing posts with label javac. Show all posts

Jul 27, 2016

Error Starting Dyn Admin on Prod. ( java.io.IOException: Cannot run program "javac")

Error

Error : The detailed exception is: java.io.IOException: Cannot run program "javac": CreateProcess error=206, The filename or extension is too long
atg.servlet.pagecompile.jsp11.JSPPageProcessor.javaToClass(JSPPageProcessor.java:421) [_DAS_slib_sclasses.jar:]

APPLIES TO:

Oracle Commerce Platform - Version 9.4 and later
Information in this document applies to any platform.

CAUSE

Above error is Java compiler error, where java compiler fails to compile.

SOLUTION

1. Follow the steps in sequence
  • Go to location "servers/atg_config/local_prod1a_cbsbuild/localconfig/atg/dynamo/servlet" in your code base.
  • Add folder pagecompile under servlet.
  • Add two files with name "ExtendedJhtmlPageProcessor.properties" and "PageProcessor.properties"
  • In Extend file add following code snippet
    $class = atg.servlet.pagecompile.jsp11.JSPPageProcessor
    javaCompilerClassName=atg.servlet.pagecompile.SunJavaSourceCompiler 
  • In PageProcessor.properties add following code
    javaCompilerClassName=atg.servlet.pagecompile.SunJavaSourceCompiler
  • Build your project again and restart the server.

java.lang.NoClassDefFoundError: com/sun/tools/javac/Main

error

JBWEB000309: type JBWEB000066: Exception report
JBWEB000068: message JBWEB000248: Servlet execution threw an exception
JBWEB000069: description JBWEB000145: The server encountered an internal error that prevented it from fulfilling this request.
JBWEB000070: exception
javax.servlet.ServletException: JBWEB000248: Servlet execution threw an exception
JBWEB000071: root cause
java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
atg.servlet.pagecompile.SunJavaSourceCompiler.javaToClass(SunJavaSourceCompiler.java:110)
atg.servlet.pagecompile.jsp11.JSPPageProcessor.javaToClass(JSPPageProcessor.java:405)
atg.servlet.pagecompile.PageProcessor.compilePageClass(PageProcessor.java:2437)
atg.servlet.pagecompile.PageProcessor.getPageInfo(PageProcessor.java:1787)
atg.servlet.pagecompile.jsp12.Jsp12PageProcessor.getPageInfo(Jsp12PageProcessor.java:324)
atg.servlet.minimal.MinimalServletContainer.compileServlet(MinimalServletContainer.java:153)
atg.servlet.pagecompile.PageCompileServlet.service(PageCompileServlet.java:306)



APPLIES TO

Oracle Commerce Platform - Version 9.4 and later
Information in this document applies to any platform.


SOLUTION

1. Follow the steps in sequence

  • create folder structure under your jboss/modules as "com\sun\tools\javac\main"
  • Copy and paste attached one file to this location. "module.xml" & Copy tools.jar from jre/lib location on your system.module.xml
  • Copy "tools.jar" to jboss_home/standalone/deployments/<prod_server>.
  • Copy "tools.jar" to code base location "/<module>/<sub-module>/lib"
  • Go to code base location "<project>/<module>/META-INF" and open file "MANIFEST.mf"
  • Add "lib/tools.jar" to ATG-Class-Path in the file.
  • Stop Servers if running & Re-Build the ear's.
  • Restart the server and make sure <module>.<sub-module> is started with parameters in Server Startup.
  • Similar way can fix Pub if there is same error.
  • create folder structure under your jboss/modules as "com\sun\tools\javac\main".