cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "cib" <c....@laposte.net>
Subject Re: No method matching in inner class
Date Wed, 19 Sep 2001 19:41:11 GMT
Thanks again for answering,
but I really think I'll have to drop my idea, as the new message is:

org.apache.cocoon.ProcessingException: Language
Exception:org.apache.cocoon.components.language.LanguageException: Error
compiling make1_xsp: Line 143, column 29: Identifier expected. Line 75,
column 13: class org.apache.cocoon.www.pages.make1_xsp must be declared
abstract. It does not define void generate() from class
org.apache.cocoon.generation.AbstractGenerator

I think it'll never end.
My aim is to add comments to long text following the TEI dtd.
The text is made, and a database stores the comments. The pages are then
build by xsl and substring before templates to inserts comments at the right
place. I thought I had better re-build each xsl when a comment was added to
db, or pages would take quite a long time to be made.

Here is the version of my make1.xsp, which engendered that error message.
I've tried (from a book on java) to add "abstract" in front of "class
make_xsl" or before public void main and even both, but with the same
results.

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsp:page
          language="java"
          xmlns:xsp="http://apache.org/xsp"
          xmlns:esql="http://apache.org/cocoon/SQL/v2">

<xsp:structure>
  <xsp:include>java.io.*</xsp:include>
</xsp:structure>

<xsp:logic>
class make_xsl {
   public void main(String[]) throws IOException {
 FileReader entree = new
FileReader(("http//:localhost/cocoon/test/make.xsl"));
  FileWriter sortie = new FileWriter("output.txt");
 int c;
 while ( (c = entree.read()) != -1 )
sortie.write(c);
sortie.close();
entree.close();
     }
}
</xsp:logic>

  <page>

<xsp:logic>
    make_xsl anObject = new make_xsl();
    anObject.main();
</xsp:logic>


If you see this, it works.

  </page>
</xsp:page>

I reckon you are busy so don't bother too much on me.

Cib

France, Bordeaux, xml and gay pride.

----- Original Message -----
From: "Christian Haul" <haul@dvs1.informatik.tu-darmstadt.de>
To: <cocoon-users@xml.apache.org>; "cib" <vendo1@caramail.com>
Sent: Wednesday, September 19, 2001 11:13 AM
Subject: Re: No method matching in inner class


> On 19.Sep.2001 -- 10:09 AM, cib wrote:
> > Thanks for answering,
> > unfortunately "signature does not match" sounds like a riddle to me.
>
> Sorry cib, I thought it was obvious after I pulled the lines
> together. You declare a method "main(String[] args)" and call "main()"
> without arguments which is a totally different method, hence "no
> matching method found". Remove the argument from your method
> declaration and try again. You seem not to use it anyway.
>
> BTW I always though that "main" is used only as an entry point for
> when no other method could be specified. Often it just invokes the
> constructor which does the real work. Therefore you don't really need
> "main(String[])". Just call class methods or put the logic into a
> constructor.
>
> > I'm trying to output an xsl and save it to the disk. As nobody knows how
to
> > do that I'm making a patchwork code of java bits I find anywhere: java
> > classes are far beyond my capabilities: I'm only a postman.
> > Thanks anyway.
>
> I don't know if this works, but have you tried to use the cocoon:
> protocol as source for a transformer? You might be able to obtain the
> xsl through that.
>
> <map:match pattern="genxsl">
>    <map:generate type="serverpages" src="generateXSL.xsp"/>
> </map:match>
>
> <map:match pattern="foo">
>    <map:generate ....../>
>    <map:transform src="cocoon:/genxsl"/>
> </map:match>
>
> I haven't worked with this before but I understand that this should be
> a valid application for it.
>
> This way you XSL is not saved but I presume that the original
> intention was to use it in a transformation with cocoon.
>
>
> > > On 17.Sep.2001 -- 10:16 PM, cib wrote:
> > > > Thanks to Luis Gois for correcting the first part.
> > > > it now says:
> > > > "No method matching main() found in inner class
> > > > org.apache.cocoon.www.pages.make1_xsp. make_xsl."
> > > > (I really don't know why there is a space between make1_xsp. and
> > make_xsl.
> > > > Is it normal?)
> > > >
> > >
> > > > class make_xsl {
> > > >   public void main(String[] args) throws IOException {
> > >
> > > >     anObject.main();
> > >
> > > The signature does not match.
>
> Chris.
>
> --
> C h r i s t i a n       H a u l
> haul@informatik.tu-darmstadt.de
>     fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.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/faqs.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