cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Howard <ghow...@crosswalk.com>
Subject RE: XSP Java Class Include
Date Fri, 16 Aug 2002 20:14:39 GMT
hmm.  you've checked the logs in WEB-INF/logs?

Geoff

> -----Original Message-----
> From: Brian Schwark [mailto:bschwark@aci-hq.com]
> Sent: Friday, August 16, 2002 3:47 PM
> To: cocoon-users@xml.apache.org
> Subject: RE: XSP Java Class Include
> 
> 
> Geoff -
> 
> Thanks for the reply. I'll try to answer your questions to 
> the best of my
> ability so you've got a little clearer picture of my setup, I 
> apologize for
> the vagueness of my description but as I said, being new to 
> Cocoon I'm still
> learning all of this as I go along. :)
> 
> > "What jdk did torque use to create the classes and what is 
> cocoon using?"
> 
> They're both using the same JDK, 1.4.0_01.
> 
> > "Which release/cvs-version of cocoon are you running?"
> 
> I'm running the latest binary release of Cocoon available, 
> v2.0.3 using the
> Tomcat 4.0.4 servlet engine on Win2k.
> 
> > "Just to make sure, you are now correctly putting all this 
> in your xsp
> > page and not the xsl?"
> 
> Yes, my logic is all contained in the XSP, and not in the XSL.
> 
> > "What does your pipeline look like?"
> 
> My pipeline right now is very simple just for testing puposes 
> one generator
> and one transformer. I've pasted the exact pipeline below.
> 
> <map:match pattern="home">
> 	<map:generate src="content/home.xml" type="serverpages"/>
> 	<map:transform src="stylesheets/home2html.xsl"/>
> 	<map:serialize/>
> </map:match>
> 
> > "Is the response blank, or just the display in the browser 
> (ie., do a
> > view source)"
> 
> When I'm able to get cocoon to correctly locate the class by 
> using it's
> fully qualified name while calling it (I still can't get it 
> to find my class
> using <xsp:structure> and <xsp:include> so I can just refer to the
> classname..), The only things I get in the browser display 
> are the title and
> the line of text that come before the logic in the XSP. After 
> the logic,
> there is nothing, and viewing the source of the HTML is 
> equally as empty.
> Only thing I find interesting is that the HTML document is 
> closed normally
> with </body> and </html> tags.. but it seems like all the 
> other text I had
> after the logic just doesn't get parsed. To find out what was 
> happening, I
> stuck two System.out.println(); statements with a message to 
> spit out to the
> console before and after I call my class method.. and oddly 
> enough I get the
> opening message, but not my closing message.. this is why I'm 
> inferring that
> Cocoon can find the class, but isn't finding the Torque classes that I
> import in my own class. Of course, that's only a guess.. I've 
> really no way
> to tell exactly what the problem is. By my reasoning, Cocoon 
> should be able
> to find the Torque classes without a problem, and I get no 
> error telling me
> that it can't.
> 
> > - Is your xsp namespace defined in your xsp and xsl?
> 
> Yes, my XSP namespace is defined in both the XSP and the XSL and are
> identical.
> 
> Again, thanks for your time,
> Brian Schwark
> bschwark@aci-hq.com
> 
> > -----Original Message-----
> > From: Geoff Howard [mailto:ghoward@crosswalk.com]
> > Sent: Friday, August 16, 2002 2:54 PM
> > To: 'cocoon-users@xml.apache.org'
> > Subject: RE: XSP Java Class Include
> >
> >
> > I don't have experience using Torque, but can't see any reason
> > why torque's auto generated classes should have a problem.  Here's
> > a few questions that may help debugging:
> >
> > - What jdk did torque use to create the classes and what is cocoon
> > using (that should be defined in cocoon.xconf)?
> > - Which release/cvs-version of cocoon are you running?
> > - Just to make sure, you are now correctly putting all this 
> in your xsp
> > page and not the xsl?
> > - What does your pipeline look like?
> > - Is the response blank, or just the display in the browser 
> (ie., do a
> > view source)
> > - Is your xsp namespace defined in your xsp and xsl?
> >
> > That may turn something up.
> > Geoff Howard
> >
> >
> > > -----Original Message-----
> > > From: Brian Schwark [mailto:bschwark@aci-hq.com]
> > > Sent: Friday, August 16, 2002 12:56 PM
> > > To: cocoon-users@xml.apache.org
> > > Subject: RE: XSP Java Class Include
> > >
> > >
> > > Thank you everyone very much for the replies..
> > >
> > > My <xsp:structure> element was indeed within the content,
> > > right before I
> > > call the logic.. however, moving it out just under the
> > > <xsp:page> tag did no
> > > good, Cocoon still failed to find the class. I find that if
> > > when calling my
> > > method in the logic, I refer to the class by it's full name
> > > in the logic
> > > (ie, org.this.that.class) Cocoon finds the class just fine..
> > > it seems like
> > > trying to import the class using the <xsp:structure> (either
> > > through the XSP
> > > or the XSL) won't find it, though. Any insight as to why that
> > > might be?
> > > Another issue I'm having is that when I can get the class to
> > > be recognized
> > > and the method to be called, I end up with basically a blank
> > > page (where
> > > there should be content) because my class implements
> > > org.apache.torque.om.Persistent (the classes were built by
> > > Torque), and even
> > > though I have the torque.jar in the WEB-INF/lib directory, I
> > > can tell that
> > > Cocoon isn't finding Torque's Persistent class.. even though
> > > it should be
> > > visible.
> > >
> > > I'm finding this all thoroughly confusing, and unfortunately the
> > > documentation doesn't seem to be much help, as I've been
> > > doing everything
> > > it's been showing, to no avail. Basically, I can call any
> > > standard Java or
> > > cocoon class without incident, but as soon as I try to call
> > > my own built by
> > > Torque, there are tons of problems. Maybe that's where I'm
> > > going wrong..
> > > does anybody have experience using Torque-generated classes
> > > in conjunction
> > > with Cocoon?
> > >
> > > Many thanks,
> > > Brian Schwark
> > > bschwark@aci-hq.com
> > >
> > > > -----Original Message-----
> > > > From: Werner Guttmann [mailto:Werner.Guttmann@morganstanley.com]
> > > > Sent: Friday, August 16, 2002 12:42 PM
> > > > To: cocoon-users@xml.apache.org
> > > > Subject: Re: XSP Java Class Include
> > > >
> > > >
> > > > And more importantly, do not to forget to put a
> > > >
> > > > <xsp:exp>instance_of_your_class</xsp:expr>
> > > >
> > > > at the place where you want the generated XML to be 
> inserted into
> > > > your document.
> > > >
> > > > Werner
> > > >
> > > > "Lai, Harry" wrote:
> > > >
> > > > > Hi Brian,
> > > > >
> > > > > I'm not totally sure if this is the cause of your
> > > problem, but make sure
> > > > > your xsp:structure element is inside your xsp:page 
> element, but
> > > > outside your
> > > > > content element.  So for example:
> > > > >
> > > > > <xsp:page _namespace stuff_>
> > > > >         <xsp:structure>
> > > > >                 <xsp:include>org.my.custom.Class</xsp:include>
> > > > >         </xsp:structure>
> > > > >
> > > > >         <actualContent>
> > > > >                 ...
> > > > >         </actualContent>
> > > > > </xsp:page>
> > > > >
> > > > > Anyway, hope that helps!
> > > > >
> > > > > Harry
> > > > >
> > > > > -----Original Message-----
> > > > > From: Brian Schwark [mailto:bschwark@aci-hq.com]
> > > > > Sent: Friday, August 16, 2002 10:27 AM
> > > > > To: cocoon-users@xml.apache.org
> > > > > Subject: XSP Java Class Include
> > > > >
> > > > > Hello,
> > > > >
> > > > > I'm new to Cocoon, trying to work my way through the
> > > > documentation. So far,
> > > > > I've been able to get most things to work satisfactorily
> > > enough, however
> > > > > I've run into a roadblock while trying to implement XSPs.
> > > So far, I've
> > > > > written a quick and dirty example, of which all I want to
> > > do is import a
> > > > > custom class and call a function from that class. From what I
> > > > understand in
> > > > > the documentation, to import a custom class all I need to
> > > do after the
> > > > > appropriate .jar file containing the class into the
> > > cocoon/web-inf/lib
> > > > > directory is to include the following tag in my XSP, (or XSL?
> > > > Can someone
> > > > > clarify this please? The documentation is sketchy and I have
> > > > seen examples
> > > > > using either method. Are both kosher?):
> > > > >
> > > > > <xsp:structure>
> > > > >         <xsp:include>org.my.custom.Class</xsp:include>
> > > > > </xsp:structure>
> > > > >
> > > > > However, when the file is serialized, Cocoon merely spits
> > > out the text
> > > > > between the <xsp:include> tags, as if it hasn't even 
> recognized
> > > > that as a
> > > > > parameter. If I try to call a function from that class in a
> > > > <xsp:logic> tag,
> > > > > cocoon dies with an error explaining that it can't 
> find the class.
> > > > >
> > > > > I'm understandably confused at this point, as all the examples
> > > > I've looked
> > > > > at seem to show that including the class is as 
> trivial as using
> > > > the above
> > > > > mentioned structure tag. For redundancy (or lack of a
> > > better idea), the
> > > > > class has also been added as an additional classs in the
> > > > web.xml file inside
> > > > > the web-inf directory. The logic in my XSP is working, as I'm
> > > > able to call
> > > > > java.util classes without a problem.
> > > > >
> > > > > Thanks in advance for any insight,
> > > > >
> > > > > Brian Schwark
> > > > > bschwark@aci-hq.com
> > > > >
> > > > >
> > > 
> ---------------------------------------------------------------------
> > > > > Please check that your question  has not already been
> > > answered in the
> > > > > FAQ before posting.
> > <http://xml.apache.org/cocoon/faq/index.html>
> > > >
> > > > To unsubscribe, e-mail:     
> <cocoon-users-unsubscribe@xml.apache.org>
> > > > For additional commands, e-mail:   
> <cocoon-users-help@xml.apache.org>
> > > >
> > > > 
> ---------------------------------------------------------------------
> > > > Please check that your question  has not already been 
> answered in the
> > > > FAQ before posting.     
> <http://xml.apache.org/cocoon/faq/index.html>
> > > >
> > > > To unsubscribe, e-mail:     
> <cocoon-users-unsubscribe@xml.apache.org>
> > > > For additional commands, e-mail:   
> <cocoon-users-help@xml.apache.org>
> > >
> > >
> > > 
> ---------------------------------------------------------------------
> > > Please check that your question  has not already been 
> answered in the
> > > FAQ before posting.     
> <http://xml.apache.org/cocoon/faq/index.html>
> > >
> > > To unsubscribe, e-mail:     
> <cocoon-users-unsubscribe@xml.apache.org>
> > > For additional commands, e-mail:   
> <cocoon-users-help@xml.apache.org>
> > >
> > >
> >
> >
> >
> > 
> ---------------------------------------------------------------------
> > Please check that your question  has not already been 
> answered in the
> > FAQ before posting.     
> <http://xml.apache.org/cocoon/faq/index.html>
> >
> > To unsubscribe, e-mail:     
> <cocoon-users-unsubscribe@xml.apache.org>
> > For additional commands, e-mail:   
> <cocoon-users-help@xml.apache.org>
> >
> > 
> ---------------------------------------------------------------------
> > Please check that your question  has not already been 
> answered in the
> > FAQ before posting.     
> <http://xml.apache.org/cocoon/faq/index.html>
> >
> > To unsubscribe, e-mail:     
> <cocoon-users-unsubscribe@xml.apache.org>
> > For additional commands, e-mail:   
> <cocoon-users-help@xml.apache.org>
> >
> >
> 
> 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
> 

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Mime
View raw message