On Sun, 2011-01-23 at 01:25 +0100, Des Magner wrote:
> Hi
> 
> I am trying to add some custom code to be called from my flowscript but 
> with no success. I followed the instructions in the user documentation 
> to the letter (http://cocoon.apache.org/2.1/userdocs/flow/java.html). I 
> have added my source directory entry to the component-instance in the 
> format "file:/path/to/my/source" but it doesn't seem to want to pick up 
> the code. Say I have the following code in my flowscript:
> 
> var resource = new Packages.Test();
> 
> with the file Test.java placed in my source dir as specified above, I 
> consistently get the following error:
> 
> org.mozilla.javascript.EvaluatorException: "file:///....js", line ..: 
> Not a Java class: [JavaPackage Test]
> 
> I can get around it by placing the compiled class in the 
> cocoon/WEB-INF/classes directory but this is not a very elegant solution.
> 
> Any help would be greatly appreciated.
> Thanks
> Des

Did you see
http://www.mail-archive.com/[email protected]/msg08996.html

"the CompilingClassLoader on 12/26. Since I'm using 2.1.3, which was
released mid-November, this functionality isn't included in 2.1.3.

...

Did you restart Cocoon after modifying adding <classpath>? I just tested
this and got the same error as you before doing so, but then it worked
as expected after a restart. 

If that doesn't work, set a breakpoint on
org.apache.cocoon.components.flow.javascript.fom.CompilingClassLoader.loadClass(),
 and step through and try to see why it isn't finding your class. In particular 
see if its sourcePath field contains your classpath entry.
..."

When we use java objects in flow (or jx) we normally create it in the
same module/block or add the dep to the pom.xml. Then a mvn install and
everything gets build and is available in the flow. 

However as I understand your post you are mainly looking into the
CompilingClassLoader
http://www.mail-archive.com/[email protected]/msg10144.html

salu2
-- 
Thorsten Scherler <thorsten.at.apache.org>
codeBusters S.L. - web based systems
<consulting, training and solutions>
http://www.codebusters.es/


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to