Re: Problem with JavaLoader on AWS (Linux-Railo)

94 views
Skip to first unread message

Mark Mandel

unread,
Jan 15, 2013, 10:09:40 PM1/15/13
to javaloa...@googlegroups.com
Does railo give you a full stack trace, so you can see all the calling methods?

Mark


On Wed, Jan 16, 2013 at 2:07 PM, jim collins <jimco...@gmail.com> wrote:
I have javaloader under the model directory , as well as ta-lib. This code works fine on my localhost, but I cant get it to work on my ec2 instance.

<cfset paths[1] =  "/var/lib/tomcat7/webapps/ROOT/cfstox/model/ta-lib.jar" />
<cfset server.loader = createObject("component", "JavaLoader").init(paths) />

Please note the path it's complaining about is not the path I'm sending as an argument.

The error is:

Railo 3.3.4.003 Error (The path you have specified could not be found)
Message PathNotFoundException
Detail /usr/share/tomcat7/1 does not exist
Stacktrace The Error Occurred in
/var/lib/tomcat7/webapps/ROOT/WEB-INF/lib/railo-server/context/library/function/throw.cfm: line 11
9: name="extendedInfo" type="string" required="no" hint="extended information to the exception."><cfargument
10: name="object" type="any" required="no" hint="Throws a Java exception from a CFML tag. This attribute is mutually exclusive with all other argments of this function."><!---
11: ---><cfthrow attributeCollection="#arguments#"><!---
12: ---></cffunction>

called from/var/lib/tomcat7/webapps/ROOT/cfstox/model/JavaLoader.cfc: line 77
75: if(NOT file.exists())
76: {
77: throw("PathNotFoundException", "The path you have specified could not be found", file.getAbsolutePath() & " does not exist");
78: }
79:

called from/var/lib/tomcat7/webapps/ROOT/cfstox/model/TA.cfc: line 25
23: <cffunction name="init">
24: <cfset paths[1] = "/var/lib/tomcat7/webapps/ROOT/cfstox/model/ta-lib.jar" />
25: <cfset server.loader = createObject("component", "JavaLoader").init(paths) />
26: <cfset talib = server.loader.create("com.tictactec.ta.lib.Core") />
27: <cfset Minteger1 = server.loader.create("com.tictactec.ta.lib.MInteger") />

--
You received this message because you are subscribed to the Google Groups "javaloader-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/javaloader-dev/-/b0e3uLIs6XUJ.
To post to this group, send email to javaloa...@googlegroups.com.
To unsubscribe from this group, send email to javaloader-de...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaloader-dev?hl=en.



--
E: mark....@gmail.com
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

2 Devs from Down Under Podcast

jim collins

unread,
Jan 16, 2013, 12:20:05 AM1/16/13
to javaloa...@googlegroups.com
Full dump:

Railo 3.3.4.003 Error (The path you have specified could not be found)
Message PathNotFoundException
Detail /usr/share/tomcat7/1 does not exist
Stacktrace
The Error Occurred in
/var/lib/tomcat7/webapps/ROOT/WEB-INF/lib/railo-server/context/library/function/throw.cfm: line 11
9: name="extendedInfo" type="string" required="no" hint="extended information to the exception."><cfargument
10: name="object" type="any" required="no" hint="Throws a Java exception from a CFML tag. This attribute is mutually exclusive with all other argments of this function."><!---
11: ---><cfthrow attributeCollection="#arguments#"><!---
12: ---></cffunction>

called from/var/lib/tomcat7/webapps/ROOT/cfstox/model/JavaLoader.cfc: line 77
75: if(NOT file.exists())
76: {
77: throw("PathNotFoundException", "The path you have specified could not be found", file.getAbsolutePath() & " does not exist");
78: }
79:

called from/var/lib/tomcat7/webapps/ROOT/cfstox/model/TA.cfc: line 25
23: <cffunction name="init">
24: <cfset paths[1] = "/var/lib/tomcat7/webapps/ROOT/cfstox/model/ta-lib.jar" />
25: <cfset server.loader = createObject("component", "JavaLoader").init(paths) />
26: <cfset talib = server.loader.create("com.tictactec.ta.lib.Core") />
27: <cfset Minteger1 = server.loader.create("com.tictactec.ta.lib.MInteger") />

called from/var/lib/tomcat7/webapps/ROOT/cfstox/controllers/controller.cfc: line 197
195: <cfset session.objects.Indicators = createobject("component","cfstox.model.Indicators").init() />
196: <cfset session.objects.Utility = createobject("component","cfstox.model.Utility").init() />
197: <cfset session.objects.ta = createObject("component","cfstox.model.ta").init() />
198: <cfset session.objects.http = createObject("component","cfstox.model.http").init() />
199: <cfset session.objects.System = createObject("component","cfstox.model.system").init() />

called from/var/lib/tomcat7/webapps/ROOT/cfstox/controllers/controller.cfc: line 3
1: <cfcomponent displayname="controller" output="false">
2: <cffunction name="init" description="init method" access="public" displayname="" output="false" returntype="controller">
3: <cfset loadObjects() />
4: <cfset this.diagnostics = false />
5: <cfreturn this/>

called from/var/lib/tomcat7/webapps/ROOT/cfstox/controllers/controller.cfm: line 4
2: <!--- load the controller object if not already loaded and set the controller flag --->
3: <!--- <cfif NOT structKeyExists(session,"controllerLoaded") or StructKeyExists(url,"reload")> --->
4: <cfset session.objects.controller = createObject("component","controller").init() />
5: <cfset session.controllerLoaded = True />
6: <!--- </cfif> --->

Java Stacktrace PathNotFoundException
   at railo.runtime.tag.Throw._doStartTag(Throw.java:142):142
   at railo.runtime.tag.Throw.doStartTag(Throw.java:131):131
   at throw_cfm$cf.udfCall(/var/lib/tomcat7/webapps/ROOT/WEB-INF/lib/railo-server/context/library/function/throw.cfm:11):11
   at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:215):215
   at railo.runtime.type.UDFImpl._call(UDFImpl.java:434):434
   at railo.runtime.type.UDFImpl.call(UDFImpl.java:384):384
   at railo.runtime.functions.system.CFFunction.call(CFFunction.java:71):71
   at cfstox.model.javaloader_cfc$cf._1(/var/lib/tomcat7/webapps/ROOT/cfstox/model/JavaLoader.cfc:77):77
   at cfstox.model.javaloader_cfc$cf.udfCall(/var/lib/tomcat7/webapps/ROOT/cfstox/model/JavaLoader.cfc):-1
   at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:215):215
   at railo.runtime.type.UDFImpl._call(UDFImpl.java:434):434
   at railo.runtime.type.UDFImpl.call(UDFImpl.java:384):384
   at railo.runtime.ComponentImpl._call(ComponentImpl.java:615):615
   at railo.runtime.ComponentImpl._call(ComponentImpl.java:502):502
   at railo.runtime.ComponentImpl.call(ComponentImpl.java:1815):1815
   at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:733):733
   at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1480):1480
   at cfstox.model.ta_cfc$cf._1(/var/lib/tomcat7/webapps/ROOT/cfstox/model/TA.cfc:25):25
   at cfstox.model.ta_cfc$cf.udfCall(/var/lib/tomcat7/webapps/ROOT/cfstox/model/TA.cfc):-1
   at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:215):215
   at railo.runtime.type.UDFImpl._call(UDFImpl.java:434):434
   at railo.runtime.type.UDFImpl.call(UDFImpl.java:384):384
   at railo.runtime.ComponentImpl._call(ComponentImpl.java:615):615
   at railo.runtime.ComponentImpl._call(ComponentImpl.java:502):502
   at railo.runtime.ComponentImpl.call(ComponentImpl.java:1815):1815
   at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:733):733
   at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1480):1480
   at cfstox.controllers.controller_cfc$cf._2(/var/lib/tomcat7/webapps/ROOT/cfstox/controllers/controller.cfc:197):197
   at cfstox.controllers.controller_cfc$cf.udfCall(/var/lib/tomcat7/webapps/ROOT/cfstox/controllers/controller.cfc):-1
   at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:215):215
   at railo.runtime.type.UDFImpl._call(UDFImpl.java:434):434
   at railo.runtime.type.UDFImpl.call(UDFImpl.java:384):384
   at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:738):738
   at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1480):1480
   at cfstox.controllers.controller_cfc$cf._1(/var/lib/tomcat7/webapps/ROOT/cfstox/controllers/controller.cfc:3):3
   at cfstox.controllers.controller_cfc$cf.udfCall(/var/lib/tomcat7/webapps/ROOT/cfstox/controllers/controller.cfc):-1
   at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:215):215
   at railo.runtime.type.UDFImpl._call(UDFImpl.java:434):434
   at railo.runtime.type.UDFImpl.call(UDFImpl.java:384):384
   at railo.runtime.ComponentImpl._call(ComponentImpl.java:615):615
   at railo.runtime.ComponentImpl._call(ComponentImpl.java:502):502
   at railo.runtime.ComponentImpl.call(ComponentImpl.java:1815):1815
   at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:733):733
   at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1480):1480
   at cfstox.controllers.controller_cfm$cf.call(/var/lib/tomcat7/webapps/ROOT/cfstox/controllers/controller.cfm:4):4
   at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:799):799
   at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:751):751
   at railo.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.java:35):35
   at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:24):24
   at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2035):2035
   at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2002):2002
   at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:297):297
   at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:722):722
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305):305
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210):210
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225):225
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169):169
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472):472
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168):168
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98):98
   at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:680):680
   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927):927
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118):118
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407):407
   at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999):999
   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565):565
   at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307):307
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110):1110
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603):603
   at java.lang.Thread.run(Thread.java:679):679









Mark Mandel

unread,
Jan 16, 2013, 12:41:23 AM1/16/13
to javaloa...@googlegroups.com
Looks like you are adding that to your path array somewhere.

Maybe try:
<cfset paths =  ["/var/lib/tomcat7/webapps/ROOT/cfstox/model/ta-lib.jar"] />

paths[1] leaves me a little nervous there could be an already set [2] or [3] as I can't see all you code.

The code in JavaLoader for this part is not particularly complicated - you can see it here:

Mark


--
You received this message because you are subscribed to the Google Groups "javaloader-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/javaloader-dev/-/AS6RqwIpoVoJ.

To post to this group, send email to javaloa...@googlegroups.com.
To unsubscribe from this group, send email to javaloader-de...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaloader-dev?hl=en.

Mark Mandel

unread,
Jan 16, 2013, 12:42:46 AM1/16/13
to javaloa...@googlegroups.com
Another crazy idea - weird permission issue? Is the .jar file readable by the user that Railo is using?

Mark

Jamie Krug

unread,
Jan 16, 2013, 8:53:28 AM1/16/13
to javaloa...@googlegroups.com

That's my first thought - permission.

jim collins

unread,
Jan 16, 2013, 12:56:16 PM1/16/13
to javaloa...@googlegroups.com
It looks like JL is trying to write a file and failing. This works fine on Windows. Theres no other sets, thats it.
It looks like this is failing:
file = createObject("java", "java.io.File").init(iterator.next());

and why is the path it's reporting to not exist not the same as the one I'm passing?

jim collins

unread,
Jan 16, 2013, 12:57:41 PM1/16/13
to javaloa...@googlegroups.com
I did chmod -R 777 on the whole directory .

jim collins

unread,
Jan 20, 2013, 12:27:28 PM1/20/13
to javaloa...@googlegroups.com
So now I have a new error, it can find the jar file but cant create the classes

Railo 3.3.4.003 Error (java.lang.ClassNotFoundException)
Message com.tictactec.ta.lib.Core
Cause java.lang.ClassNotFoundException
Stacktrace The Error Occurred in
/var/lib/tomcat7/webapps/ROOT/cfstox/model/JavaLoader.cfc: line 100
98: <cfargument name="className" hint="The name of the class to create" type="string" required="Yes">
99: <cfscript>
100: var class = getURLClassLoader().loadClass(arguments.className);
101:
102: return createJavaProxy(class);

called from/var/lib/tomcat7/webapps/ROOT/cfstox/model/TA.cfc: line 26
24: <cfset paths[1] = "/var/lib/tomcat7/webapps/ROOT/cfstox/model/ta-lib.jar" />
25: <cfset server.loader = createObject("component", "JavaLoader").init(paths) />
26: <cfset talib = server.loader.create("com.tictactec.ta.lib.Core") />
27: <cfset Minteger1 = server.loader.create("com.tictactec.ta.lib.MInteger") />
28: <cfset Minteger2 = server.loader.create("com.tictactec.ta.lib.MInteger") />

called from/var/lib/tomcat7/webapps/ROOT/cfstox/controllers/controller.cfc: line 197
195: <cfset session.objects.Indicators = createobject("component","cfstox.model.Indicators").init() />
196: <cfset session.objects.Utility = createobject("component","cfstox.model.Utility").init() />
197: <cfset session.objects.ta = createObject("component","cfstox.model.ta").init() />
198: <cfset session.objects.http = createObject("component","cfstox.model.http").init() />
199: <cfset session.objects.System = createObject("component","cfstox.model.system").init() />

called from/var/lib/tomcat7/webapps/ROOT/cfstox/controllers/controller.cfc: line 3






called from/var/lib/tomcat7/webapps/ROOT/cfstox/controllers/controller.cfm: line 4






Java Stacktrace com.tictactec.ta.lib.Core
   at com.compoundtheory.classloader.NetworkClassLoader.loadClass(NetworkClassLoader.java:360):360
   at java.lang.ClassLoader.loadClass(ClassLoader.java:266):266
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method):-2
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57):57
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43):43
   at java.lang.reflect.Method.invoke(Method.java:616):616
   at railo.runtime.reflection.pairs.MethodInstance.invoke(MethodInstance.java:37):37
   at railo.runtime.reflection.Reflector.callMethod(Reflector.java:699):699
   at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:742):742
   at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1480):1480
   at cfstox.model.javaloader_cfc$cf._1(/var/lib/tomcat7/webapps/ROOT/cfstox/model/JavaLoader.cfc:100):100

   at cfstox.model.javaloader_cfc$cf.udfCall(/var/lib/tomcat7/webapps/ROOT/cfstox/model/JavaLoader.cfc):-1
   at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:215):215
   at railo.runtime.type.UDFImpl._call(UDFImpl.java:434):434
   at railo.runtime.type.UDFImpl.call(UDFImpl.java:384):384
   at railo.runtime.ComponentImpl._call(ComponentImpl.java:615):615
   at railo.runtime.ComponentImpl._call(ComponentImpl.java:502):502
   at railo.runtime.ComponentImpl.call(ComponentImpl.java:1815):1815
   at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:733):733
   at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1480):1480
   at cfstox.model.ta_cfc$cf._1(/var/lib/tomcat7/webapps/ROOT/cfstox/model/TA.cfc:26):26
Reply all
Reply to author
Forward
0 new messages