cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gelo1234 <gelo1...@gmail.com>
Subject Re: Cocoon java function call Byte code verification failed
Date Tue, 05 Feb 2019 11:51:46 GMT
Hello,

What strikes me the most is the fact that old Cocoon 2.x works fine
(flawlessly) with OpenJDK 8 implementation :) It was a total shock!! for
us. Even though
you can't tell it is absolutely 100% compliant (someone should be writing
TCK for this), you still find Java revision to be 1.0!!! in byte-code
compiler recognition.
So it is actually running Java 1.0 not 8 if you want Cocoon to compile your
JSP/XSP pages :) - If you want to use java byte-compiling process by Cocoon
Engine (e.g. XSP)
Why?  Because there is a Cocoon-own implementation of Java Compiler
_HEADER_ which uses first revisions of Javac spec 1.0 spec :)   - very
SIMPLE javac implementation

setCookie_xsp.class: compiled Java class data, version 45.3    (looks like
Java 1.0.2 from Sun:)
https://ldapwiki.com/wiki/Java%20Versions%20And%20Running%20Programs

Although if you compile your Java classes with standard Javac 8 Compiler
and place them into WEB-INF/lib (.jar) or WEB-INF/classes
you get the LATEST FULL version:
Config.class: compiled Java class data, version 52.0 (Java 1.8)

Unfortunately all those "beauties" were thrown out in the Cocoon3.0 :(
(even Cocoon 2.x doesn't have that kind of FLEXIBILITY and
interchangability of Java Compilers).
New releases were trimmed down to have only neccessary basic blocks of
functionality, but as you see OLD Cocoon can suprise everybody with its
"modern vision of PREDICTABLE
future requirements". And that is absolutely AWESOME! Brilliant!!! I'm so
disappointed that Continuations were thrown out as well as Jasper Engine 1
(JSP) that cannot inject its own code into "compilation Unit" - that is why
XSP is no longer supported. The programmers believed it was too COMPLICATED
to further manage that kind of Code. Jasper Engine 2 is also very small and
trimmed down to be as small as possible. Maybe it's right, but for some
reasons this might be a flaw in the Palette of available tools.

With the 1990's technology and software we could make our Computers fly to
the Moon and even beyond. With the current technology stack we cannot leave
the Earth Surface ;)
We made our Life simpler and more comfortable but in my opinion we lost
some bigger picture of what important is when it comes to Software.
Maybe I'm old protagonist yet a stubborn Backer of Simplicity in the World
(after da Vinci) but this trend to slim down every single piece of
component will head us into Lemmings world,
where every one of us is a hard working specie to achieve something that
could be achieved long long before the Computers were born, easier, faster
and wiser :)

But there is at least one good sign on the Horizon. Not everything is going
commercial and not everything Open-Source is getting slimmed down (for
addons you have to pay!).
If you take into the consideration that future Oracle Java updates/releases
will be commercial/paid only via subscriptions :( most of Open-Source World
is switching to OpenJDK now :)

Greetings,
Greg



wt., 5 lut 2019 o 11:56 gelo1234 <gelo1234@gmail.com> napisał(a):

> 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.Thangavel@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
>>
>

Mime
View raw message