cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Oliver <res1c...@verizon.net>
Subject Re: Accessing Java classes from flow
Date Sat, 24 Jan 2004 18:07:33 GMT
It seems the documentation on the Cocoon web site isn't synchronized 
properly with the current release.

Jake Meier wrote:

>OK, that may be my problem.  It appears to me that you committed 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.  I grabbed the cvs snapshot from yesterday and changed my <classpath>
in cocoon.xconf to be resource://project/srcdir and it works like a charm.  Thanks for the
help.
>
>If I'm correct, and this functionality isn't in 2.1.3, perhaps putting a note on http://cocoon.apache.org/2.1/userdocs/flow/java.html
would help clarify, for future users, what version dynamic compilation is available in.
>
>Anyway, thanks again.
>
>-Jake
>
>
>
>On Fri, Jan 23, 2004 at 05:05:46PM -0800, Christopher Oliver wrote:
>  
>
>>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.
>>
>>HTH,
>>
>>Chris
>>
>>Jake Meier wrote:
>>
>>    
>>
>>>I am using 2.1.3
>>>
>>>Where should I go looking for the java code related to finding .java files 
>>>in that <classpath> element, the dynamic compilation, and then the 
>>>classloading of those files?  I'd be happy to debug the problem, I just 
>>>wanted to make sure that I wasn't missing something obvious before I 
>>>started.  If you can give me a starting point into the src that would be 
>>>helpful.  If you have any ideas, that'd be great too.  Thanks.
>>>
>>>-Jake
>>>
>>>On Fri, Jan 23, 2004 at 07:16:14AM -0800, Christopher Oliver wrote:
>>>
>>>
>>>      
>>>
>>>>That should have worked. What version of Cocoon are you using?
>>>>
>>>>Jake Meier wrote:
>>>>
>>>>  
>>>>
>>>>        
>>>>
>>>>>In the cocoon.xconf I added:
>>>>><classpath>file://myproject/src/java</classpath>
>>>>>just under the check-time element, under 
>>>>>flow-interpreters/component-instance.
>>>>>
>>>>>In webapp/myproject/java/src I have my/package/TestFile.java
>>>>>However, when from flowscript I try:
>>>>>print(new Packages.my.package.TestFile().testMethod("parameter"));
>>>>>I get a 500 error: The undefined value has no properties
>>>>>If, however, I compile this class and put it in my WEB-INF/classes 
>>>>>folder everything works as expected.  What am I missing?
>>>>>
>>>>>-Jake
>>>>>
>>>>>On Thu, Jan 22, 2004 at 06:46:40PM -0800, Christopher Oliver wrote:
>>>>>
>>>>>
>>>>>    
>>>>>
>>>>>          
>>>>>
>>>>>>Not sure if this is the problem but the classpath property requires

>>>>>>URL's, e.g. file://myProject/src. Also only source files will be loaded

>>>>>>      
>>>>>>
>>>>>>            
>>>>>>
>>>>>>from these locations. Your compiled classes still need to go into
your 
>>>>>    
>>>>>
>>>>>          
>>>>>
>>>>>>webapp. Can you provide more information?
>>>>>>
>>>>>>Jake Meier wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>      
>>>>>>
>>>>>>            
>>>>>>
>>>>>>>I am running cocoon on JBoss 3.2.2RC2, and am trying to access
a java 
>>>>>>>object from a flowscript.  I see that if I put the compiled class
in 
>>>>>>>my cocoon webapps WEB-INF/classes directory that I can access
it.  Is 
>>>>>>>this the only place I can put them.  I see that on 
>>>>>>>http://cocoon.apache.org/2.1/userdocs/flow/java.html, there is
a 
>>>>>>>reference to a classpath property in the cocoon.xconf, but I can't

>>>>>>>seem to get it to work.  Regardless of the value that I set for
the 
>>>>>>>classpath I can't seem to load up class or source files.  Ideally
I'd 
>>>>>>>like a place that I could put my .java files and have cocoon compile

>>>>>>>them and use them automagically.  Any help or direction would
be 
>>>>>>>greatly appreciated.
>>>>>>>
>>>>>>>-Jake Meier
>>>>>>>
>>>>>>>---------------------------------------------------------------------
>>>>>>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>>>>>>For additional commands, e-mail: users-help@cocoon.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  
>>>>>>>
>>>>>>>        
>>>>>>>
>>>>>>>              
>>>>>>>
>>>>>>---------------------------------------------------------------------
>>>>>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>>>>>For additional commands, e-mail: users-help@cocoon.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>      
>>>>>>
>>>>>>            
>>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>>>>For additional commands, e-mail: users-help@cocoon.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>    
>>>>>
>>>>>          
>>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>>>For additional commands, e-mail: users-help@cocoon.apache.org
>>>>
>>>>  
>>>>
>>>>        
>>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>>For additional commands, e-mail: users-help@cocoon.apache.org
>>>
>>>
>>>
>>>
>>>      
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>  
>



Mime
View raw message