Hello Senthilkumar,

The problem is related to String Pool implementation that has changed in
the Java 8 spec. I suppose you were running the previous Java release (7,
6?) and switched now to Java 8?
Unfortunately you cannot use Java8 with the current Cocoon 2.1.11 stack
unless you change the Java compiler underneath or write your own
Classloader code to be compliant with the new String Pool
implementation used by Java8. The EASIEST way is to replace the current
Java compiler with NATIVE Java8 javac compiler inside Cocoon stack :) It
helped us get our Application "UNTOUCHED" onto Java 8 successfully :)

HERE is how:
1. Just look for "Programming languages" in WEB-INF/cocoon.xconf (old
config from Cocoon before Spring - from Avalon framework)

<!-- Programming Languages: -->
  <programming-languages>
    <java-language logger="core.language.java" name="java">
      <!-- Specifies which formatter to use to format source code.
           This parameter is optional.
           It is commented out because of bug #5689: Java "code-formatter"
incorrectly formats double values
      <parameter name="code-formatter"
value="org.apache.cocoon.components.language.programming.java.JstyleFormatter"/>
      -->
      <!-- A singleton-like implementation of a ClassLoader -->
      <parameter name="class-loader"
value="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl"/>

      <!-- Compiler parameter specifies which class to use to compile Java.
           Possible variants are:
             Javac. Requires javac.jar (included with JDK as
lib/toools.jar).
             Pizza. Requires pizza.jar (included with Cocoon distribution).
             Jikes. Requires IBM jikes compiler to be present in the PATH
-->
      <parameter name="compiler"
value="org.apache.cocoon.components.language.programming.java.Javac"/>
</java-language>

    <!-- Interpreted JavaScript language -->
    <js-language logger="core.language.js" name="js"/>
</programming-languages>

You have 3 options:
1. Standard Javac
2. Pizza (open source)
3. Jikes from IBM

We tried Pizza but without success, that is why we switched to Oracle Javac
- just drop down: tools.jar (from standard Java SDK) into
WEB-INF/lib and Java8 support is added :) No fuss no sweat :)

Greetings,
Greg


wt., 5 lut 2019 o 06:06 Thangavel, Senthil Kumar (LNG-CON)
<senthilkumar.thanga...@lexisnexis.com.invalid> napisaƂ(a):

> HI,
>
> I am currently running in to the below issue while executing my cocoon
> based web app.
>
> I use cocoon 2.1.11 version, Tomcat 9 and Java 8.
>
>
>
> Could some one help me in identifying the problem and possible fix. Thanks
> in advance.
>
>
>
> Caused by: org.apache.bcel.verifier.exc.StructuralCodeConstraintException: 
> Instruction GETFIELD constraint violated: Class 'java.lang.String' is 
> referenced, but cannot be loaded and resolved: 'VERIFIED_REJECTED
>
> full exception chain stacktrace
>
> org.apache.cocoon.ProcessingException: Sitemap: error calling function 
> 'idCheck'
>
>             at <map:call> - 
> file:/C:/Users/IYAMPEAX/Desktop/LN/apache-tomcat-9.0.11/webapps/ROOT/tabula-rasa/sitemap.xmap:1463:34
>
>             at <map:serialize type="xml"> - 
> file:/C:/Users/IYAMPEAX/Desktop/LN/apache-tomcat-9.0.11/webapps/ROOT/tabula-rasa/sitemap.xmap:1479:32
>
>             at <map:serialize type="xhtml"> - 
> file:/C:/Users/IYAMPEAX/Desktop/LN/apache-tomcat-9.0.11/webapps/ROOT/tabula-rasa/sitemap.xmap:1146:34
>
>             at <map:transform> - 
> file:/C:/Users/IYAMPEAX/Desktop/LN/apache-tomcat-9.0.11/webapps/ROOT/tabula-rasa/sitemap.xmap:1141:67
>
>             at <map:mount> - 
> file:/C:/Users/IYAMPEAX/Desktop/LN/apache-tomcat-9.0.11/webapps/ROOT/sitemap.xmap:692:121
>
>             at 
> org.apache.cocoon.ProcessingException.throwLocated(ProcessingException.java:113)
>
>             at 
> org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:141)
>
>             at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
>
>             at 
> org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
>
>             at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
>
>             at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
>
>             at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
>
>             at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
>
>             at 
> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
>
>             at 
> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.buildPipeline(ConcreteTreeProcessor.java:193)
>
>             at 
> org.apache.cocoon.components.source.impl.SitemapSource.init(SitemapSource.java:333)
>
>             at 
> org.apache.cocoon.components.source.impl.SitemapSource.<init>(SitemapSource.java:215)
>
>             at 
> org.apache.cocoon.components.source.impl.SitemapSourceFactory.getSource(SitemapSourceFactory.java:68)
>
>             at 
> org.apache.excalibur.source.impl.SourceResolverImpl.resolveURI(SourceResolverImpl.java:208)
>
>             at 
> org.apache.cocoon.components.CocoonComponentManager.resolveURI(CocoonComponentManager.java:558)
>
>             at 
> org.apache.cocoon.components.CocoonComponentManager.resolveURI(CocoonComponentManager.java:558)
>
>             at 
> org.apache.cocoon.components.CocoonComponentManager.resolveURI(CocoonComponentManager.java:558)
>
>             at 
> org.apache.cocoon.environment.AbstractEnvironment.resolveURI(AbstractEnvironment.java:554)
>
>             at 
> org.apache.cocoon.environment.AbstractEnvironment.resolveURI(AbstractEnvironment.java:541)
>
>             at 
> org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade.resolveURI(MutableEnvironmentFacade.java:299)
>
>             at 
> org.apache.cocoon.sitemap.ContentAggregator.setup(ContentAggregator.java:290)
>
>             at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setupPipeline(AbstractProcessingPipeline.java:385)
>
>             at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.preparePipeline(AbstractProcessingPipeline.java:501)
>
>             at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.prepareInternal(AbstractProcessingPipeline.java:515)
>
>             at 
> org.apache.cocoon.components.source.impl.SitemapSource.init(SitemapSource.java:343)
>
>             at 
> org.apache.cocoon.components.source.impl.SitemapSource.<init>(SitemapSource.java:215)
>
>             at 
> org.apache.cocoon.components.source.impl.SitemapSourceFactory.getSource(SitemapSourceFactory.java:68)
>
>             at 
> org.apache.excalibur.source.impl.SourceResolverImpl.resolveURI(SourceResolverImpl.java:208)
>
>             at 
> org.apache.cocoon.components.CocoonComponentManager.resolveURI(CocoonComponentManager.java:558)
>
>             at 
> org.apache.cocoon.environment.AbstractEnvironment.resolveURI(AbstractEnvironment.java:554)
>
>             at 
> org.apache.cocoon.environment.AbstractEnvironment.resolveURI(AbstractEnvironment.java:541)
>
>             at 
> org.apache.cocoon.sitemap.ContentAggregator.setup(ContentAggregator.java:290)
>
>             at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setupPipeline(AbstractProcessingPipeline.java:385)
>
>             at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.preparePipeline(AbstractProcessingPipeline.java:501)
>
>             at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:453)
>
>             at 
> org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:144)
>
>             at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
>
>             at 
> org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
>
>             at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
>
>             at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
>
>             at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
>
>             at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
>
>             at 
> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
>
>             at 
> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:177)
>
>             at 
> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:254)
>
>             at 
> org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:118)
>
>             at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
>
>             at 
> org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
>
>             at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
>
>             at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
>
>             at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
>
>             at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
>
>             at 
> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
>
>             at 
> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:177)
>
>             at 
> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:254)
>
>             at org.apache.cocoon.Cocoon.process(Cocoon.java:699)
>
>             at 
> org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1154)
>
>             at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
>
>             at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
>
>             at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>
>             at 
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
>
>             at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>
>             at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>
>             at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
>
>             at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
>
>             at 
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
>
>             at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
>
>             at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
>
>             at 
> org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
>
>             at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
>
>             at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
>
>             at 
> org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
>
>             at 
> org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
>
>             at 
> org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:770)
>
>             at 
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)
>
>             at 
> org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
>
>             at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>
>             at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>
>             at 
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
>
>             at java.lang.Thread.run(Thread.java:748)
>
> Caused by: org.apache.avalon.framework.configuration.ConfigurationException: 
> Cannot initialize JavaInterpreter
>
>             at 
> org.apache.cocoon.components.flow.java.JavaInterpreter.initialize(JavaInterpreter.java:104)
>
>             at 
> org.apache.cocoon.components.flow.java.JavaInterpreter.callFunction(JavaInterpreter.java:124)
>
>             at 
> org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:139)
>
>             ... 78 more
>
> Caused by: org.apache.bcel.verifier.exc.StructuralCodeConstraintException: 
> Instruction GETFIELD constraint violated: Class 'java.lang.String' is 
> referenced, but cannot be loaded and resolved: 'VERIFIED_REJECTED
>
> Method 'public boolean contentEquals(CharSequence cs)' has an argument type 
> that does not pass verification pass 1: 'VERIFIED_REJECTED
>
> Invalid byte tag in constant pool: 18
>
>
>
>
>
> Regards,
>
> Senthilkumar.T
>

Reply via email to