OpenBD / openbd-core

The original open source Java powered GPL CFML runtime engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SOAP/WSDL generation fails on nightly

MFernstrom opened this issue · comments

Trying to generate a WSDL by adding ?WSDL to a cfc fails with an Internal Server Error (java.lang.RuntimeException: No compiler found in your classpath! (you may need to add 'tools.jar'))

<cffunction name="ImRemote" access="remote" returnType="string">		
	<cfreturn "I'm a returned string">
</cffunction>

I do have the classpath variable JDK_TOOLS pointing to tools.jar for Java 8, as well as tools.jar as an external jar.

I can run OpenBD just fine, but not when trying to run the WSDL generation.

I'm trying to untangle this but I have a feeling it's beyond my Java skill at the moment.

Here's the full error and screenshot of it (console output is awkward on Github)
screen shot 2018-01-12 at 10 44 18 am

java.lang.RuntimeException: No compiler found in your classpath! (you may need to add 'tools.jar')
at org.apache.axis.components.compiler.Javac.compile(Javac.java:156)
at com.naryx.tagfusion.cfm.xml.ws.dynws.DynamicWebServiceTypeGenerator.buildClasses(DynamicWebServiceTypeGenerator.java:421)
at com.naryx.tagfusion.cfm.xml.ws.dynws.DynamicWebServiceTypeGenerator.generateType(DynamicWebServiceTypeGenerator.java:105)
at com.naryx.tagfusion.cfm.xml.ws.cfcHandler.setupService(cfcHandler.java:204)
at com.naryx.tagfusion.cfm.xml.ws.cfcHandler.generateWSDL(cfcHandler.java:122)
at org.apache.axis.strategies.WSDLGenStrategy.visit(WSDLGenStrategy.java:33)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.generateWSDL(SimpleChain.java:104)
at org.apache.axis.server.AxisServer.generateWSDL(AxisServer.java:454)
at org.apache.axis.transport.http.QSWSDLHandler.invoke(QSWSDLHandler.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.axis.transport.http.AxisServlet.processQuery(AxisServlet.java:1233)
at org.apache.axis.transport.http.AxisServlet.doGet(AxisServlet.java:249)
at com.naryx.tagfusion.cfm.cfcServlet.doGet(cfcServlet.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:336)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1496)
at com.newatlanta.filters.SearchEngineFriendlyURLFilter.doFilter(SearchEngineFriendlyURLFilter.java:194)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1476)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:370)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:745)

Looks like I'm not using the JDK but the JRE (1.8.0_73), not sure if that would affect things, and if that would be required on a deployed server.

The functionality in question generates java code on the fly. That code needs to be compiled and hence requires the java compiler which doesn't come with a JRE. However including tools.jar in the classpath is meant to solve that.

I have tools.jar listed under Libraries in the project settings/properties

screen shot 2018-01-12 at 11 02 07 am

Same error.

I added it to WEB-INF/lib/tools.jar, I removed the old reference, and it's listed in the classpath list of jars when starting the engine.

Could the JDK version of the tools.jar matter?

I'm running it through Eclipse using the Jetty 3.9.0 plugin (The yellow icon one)

So it appears that in Java 8, invoking com.sun.tools.javac.main.Main.compile() returns com.sun.tools.javac.main.Main$Result rather than an integer as the Axis code expects in org.apache.axis.components.compiler.Javac. To account for that, the Axis code would need to be updated and shipped with OpenBD as opposed to the official version.

A workaround is to use the Java 7 tools.jar.

Interesting, thanks for looking into it.

I might take a stab at this at some point.