You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jake Meier <li...@razedworld.com> on 2004/01/23 01:05:30 UTC

Accessing Java classes from flow

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


2.1.4 release (was Re: Accessing Java classes from flow)

Posted by Upayavira <uv...@upaya.co.uk>.
Joerg Heinicke wrote:

> That was the reason for only committing the latest changes to CVS, but 
> not checking out them on the web server. But on request (for Ant 
> specific documentation) I guess Steven checked out the complete stuff. 
> They should be synchronized in general, but are not at the moment. 
> What about releasing 2.1.4? 2.1.3 is already two months old.

I agree. There are some real goodies (SitemapComponentTestCase, 
CompilingClassLoader, Woody stuff) that would be good to get into a 
released version. But then, I'm not the one who would be doing the work...

Upayavira



Re: Accessing Java classes from flow

Posted by Litrik De Roy <co...@litrik.com>.
Joerg Heinicke wrote:

> That was the reason for only committing the latest changes to CVS, but 
> not checking out them on the web server. But on request (for Ant 
> specific documentation) I guess Steven checked out the complete stuff. 
> They should be synchronized in general, but are not at the moment. 
> What about releasing 2.1.4? 2.1.3 is already two months old.
>
+1 (from just an ordinary user)

I already asked about a 2.1.4 a couple of weeks ago 
(http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=107281479605001&w=2) 
but I did not get a lot of replies. I guess most developers were too 
busy celebrating the holidays ;-)

> Joerg

-- 

Litrik De Roy
www.litrik.com



Re: Accessing Java classes from flow

Posted by Joerg Heinicke <jo...@gmx.de>.
That was the reason for only committing the latest changes to CVS, but 
not checking out them on the web server. But on request (for Ant 
specific documentation) I guess Steven checked out the complete stuff. 
They should be synchronized in general, but are not at the moment. What 
about releasing 2.1.4? 2.1.3 is already two months old.

Joerg

On 24.01.2004 19:07, Christopher Oliver wrote:
> 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

RE: Flow redirecting (was [Flow and auth-fw redirects not working under sub sitemap])

Posted by JD Daniels <jd...@datatrio.com>.
Am I asking a dumb question? I can't find an answer searching the
list........

JD

-----Original Message-----
From: JD Daniels [mailto:jd@datatrio.com]
Sent: 2004-01-26 10:54 AM
To: dev@cocoon.apache.org
Subject: RE: Flow redirecting (was [Flow and auth-fw redirects not
working under sub sitemap])



function login(form) {
    var model = form.getModel();
    form.showForm("login-display-pipeline");
    cocoon.sendPage("doLogin.xml");
}

If I have this in my root sitemap. it works fine.
But if I move it to a subsitemap and configure the authentication handler:

<handler name="userhandler">
    <redirect-to uri="cocoon://auth/login.form"/>
    <authentication uri="cocoon://auth/authUser.xsp"/>
</handler>

The redirects never take place at the client.

anyone have any ideas?

JD


RE: Flow redirecting (was [Flow and auth-fw redirects not working under sub sitemap])

Posted by JD Daniels <jd...@datatrio.com>.
function login(form) {
    var model = form.getModel();
    form.showForm("login-display-pipeline");
    cocoon.sendPage("doLogin.xml");
}

If I have this in my root sitemap. it works fine.
But if I move it to a subsitemap and configure the authentication handler:

<handler name="userhandler">
    <redirect-to uri="cocoon://auth/login.form"/>
    <authentication uri="cocoon://auth/authUser.xsp"/>
</handler>

The redirects never take place at the client.

anyone have any ideas?

JD

Flow and auth-fw redirects not working under sub sitemap

Posted by JD Daniels <jd...@datatrio.com>.
There was a thread a couple of weeks ago over this.. it seemed to have died
with no solution, but i have found another way to trigger it...

I did a fresh cvs head checkout and clean build just now. same behavior.

The entire thing worked perfectly.. Until I moved the login pipelines to a
sitemap under auth/

Now all the redirects stop working. All the actions take place, ie logging
in, logging out work, but I never get re-directed. it serializes out a blank
html page with a <pre> in it.

The sitemap log indicates that redirects are taking place.... but they
aren't...

INFO  [sitemap] (/root/auth/login.form) Thread-9/ForwardRedirector:
Redirecting to 'cocoon:/login-display-pipeline'
INFO  [sitemap]
(/root/auth/0650325c2a0316350b34137d0b1a2b3104517c81.continue)
Thread-8/ForwardRedirector: Redirecting to 'cocoon:/doLogin.xml'
INFO  [sitemap]
(/argo/auth/0650325c2a0316350b34137d0b1a2b3104517c81.continue)
Thread-8/RedirectToURINode: Redirecting to '/root'

My sitemaps:

Root:
                    <handler name="userhandler">
                        <redirect-to uri="cocoon://auth/login.form"/>
                        <authentication uri="cocoon://auth/authUser.xsp"/>
                    </handler>

        <!-- Auth Module -->
        <map:match pattern="auth">
            <map:redirect-to uri="auth/"/>
        </map:match>
        <map:match pattern="auth/**">
            <map:mount check-reload="yes" src="modules/auth/"
uri-prefix="auth"/>
        </map:match>

auth/
            <!-- Login -->
            <map:match pattern="login.form">
                <map:call function="woody">
                    <map:parameter name="function" value="login"/>
                    <map:parameter name="form-definition"
value="forms/login.xml"/>
                    <map:parameter name="attribute-name" value="login"/>
                </map:call>
            </map:match>

            <map:match pattern="login-display-pipeline">
                <map:generate src="forms/loginTemplate.xml"/>
                <map:transform type="woody"/>
                <map:transform type="i18n">
                    <map:parameter name="locale" value="en-US"/>
                </map:transform>
                <map:transform src="xsl/basic2document.xsl"/>
                <map:transform
src="context://resources/xsl/system/woody-styling.xsl"/>
                <map:call resource="displayappweb"/>
                <map:serialize/>
            </map:match>

            <map:match pattern="doLogin.xml">
                <map:act type="auth-loggedIn">
                  <map:parameter name="handler" value="userhandler"/>
                  <map:redirect-to uri="loggedin.xml"/>
                </map:act>
                <map:act type="auth-login">
                    <map:parameter name="handler" value="userhandler"/>
                    <map:parameter name="username"
value="{request:username}"/>
                    <map:parameter name="password"
value="{request:password}"/>
                    <map:redirect-to uri="{request:contextPath}"/>
                </map:act>
                <map:generate src="xml/LoginFailed.xml"/>
                <map:transform src="xsl/basic2document.xsl"/>
                <map:call resource="displayappweb"/>
                <map:serialize/>
            </map:match>

            <map:match pattern="authUser.xsp">
                <map:generate type="serverpages" src="xsp/authUser.xsp">
                    <map:parameter name="username"
value="{request:username}"/>
                    <map:parameter name="password"
value="{request:password}"/>
                </map:generate>
                <map:transform type="write-source"/>
                <map:serialize/>
            </map:match>

            <map:match pattern="logout.xml">
                <map:act type="auth-logout">
                    <map:parameter name="handler" value="userhandler"/>
                    <map:redirect-to uri="/"/>
                </map:act>
            </map:match>

auth/flow

function login(form) {
    var model = form.getModel();
    form.showForm("login-display-pipeline");
    cocoon.sendPage("doLogin.xml");
}


Re: Accessing Java classes from flow

Posted by Christopher Oliver <re...@verizon.net>.
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
>
>
>  
>



Re: Accessing Java classes from flow

Posted by Christopher Oliver <re...@verizon.net>.
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
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Accessing Java classes from flow

Posted by Jake Meier <li...@razedworld.com>.
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


Re: Accessing Java classes from flow

Posted by Christopher Oliver <re...@verizon.net>.
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


Re: Accessing Java classes from flow

Posted by Jake Meier <li...@razedworld.com>.
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


Re: Accessing Java classes from flow

Posted by Christopher Oliver <re...@verizon.net>.
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


Re: Accessing Java classes from flow

Posted by Jake Meier <li...@razedworld.com>.
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


Re: Accessing Java classes from flow

Posted by Christopher Oliver <re...@verizon.net>.
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