You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Roberto Moreda <mo...@alfa21.com> on 2000/04/10 18:48:45 UTC

XSP class package name problem

I got 2 XSP pages under my DocumentRoot :

 /one/page.xml
 /two/page.xml

If I GET the pages my XSP repository looks like that :

 ./_my/_document/_root/_one/_page.java
 ./_my/_document/_root/_one/_page.class

 ./_my/_document/_root/_two/_page.java
 ./_my/_document/_root/_two/_page.class

but the package in the two files are the same :
 
  package _my._document._root;

instead of :

  package _my._document._root._one;                                
  package _my._document._root._two;                                

then I get :

  java.lang.ClassFormatError: Duplicate name

when I GET the second "page.xml".
Any Clues?

  Rober

Thanks in advance. 

-- 
Roberto Moreda Alvarez
Alfa21 Outsourcing S.L.

Re: XSP class package name problem

Posted by Stefano Mazzocchi <st...@apache.org>.
Roberto Moreda wrote:
> 
> On Mon, Apr 10, 2000 at 09:03:51PM +0200, Stefano Mazzocchi wrote:
> 
> > OH, yeah, I saw that once and I forgot to report: Ricardo there is a bug
> > in the package name generation!
> 
> Proud to be useful ;)

In case Ricardo forgets to fix it, file in a bug report!

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Re: XSP class package name problem

Posted by Roberto Moreda <mo...@alfa21.com>.
On Mon, Apr 10, 2000 at 09:03:51PM +0200, Stefano Mazzocchi wrote:

> OH, yeah, I saw that once and I forgot to report: Ricardo there is a bug
> in the package name generation!

Proud to be useful ;)

  Rober

-- 
Roberto Moreda Alvarez
Alfa21 Outsourcing S.L.

Re: XSP class package name problem

Posted by Stefano Mazzocchi <st...@apache.org>.
Ulrich Mayring wrote:
> 
> Paul Russell wrote:
> >
> > On Tue, Apr 11, 2000 at 11:28:17PM +0200, Stefano Mazzocchi wrote:
> > > > Pretty cool as a starting point ;-)
> > > >
> > > > But I also would love a possibility to specify the complete package
> > > > name, i.e. including subdirectories. This basically means that there
> > > > should be a way to set the full package name in the XSP.
> > >
> > > -1
> > >
> > > XSP are _NOT_ a simplified way for your to write your generators. You
> > > should not have the ability to determine what the package would be, thus
> > > limiting "abuses" of the XSP technology.
> >
> > Um. +(-1). Or something. (I'm with stefano)
> >
> > Doing that sort of thing is exactly what causes most of the problems
> > java and cocoon set out to solve in the first place.
> 
> Ahem. I wrote:
> 
> There should be a way to set the full package name in the XSP.
> 
> But I meant:
> 
> There should be a way to set the full package name of the XSP.

I understood you. (placing it "in" the XSP, is JSP brain-damaged!)
 
> In my mind the sitemap would be a perfect place to do that. As far as
> cocoon1 and its properties file goes, it would be enough to be able to
> set a package prefix. Everything else is overkill for cocoon1.

I still think you should _not_ be able to indicate what package your XSP
will end up having. No matter where you place that information.

Why? so you won't know it and you won't abuse the call of your XSP from
the outside, which you shouldn't do anyway. (I agree on setting a
package prefix, though)

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Re: XSP class package name problem

Posted by Stefano Mazzocchi <st...@apache.org>.
Paul Russell wrote:
> 
> On Wed, Apr 12, 2000 at 02:13:49PM +0200, Ulrich Mayring wrote:
> > Yeah, we can always change the package names of our other code to
> > appease cocoon ;-)
> 
> I'm not suggesting you do. Write the code and package it according
> to normal java convention, then *use* it from within the XSP.

Yes, this is definately the way to go.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Re: XSP class package name problem

Posted by Paul Russell <Pa...@uea.ac.uk>.
On Wed, Apr 12, 2000 at 02:13:49PM +0200, Ulrich Mayring wrote:
> Yeah, we can always change the package names of our other code to
> appease cocoon ;-)

I'm not suggesting you do. Write the code and package it according
to normal java convention, then *use* it from within the XSP.


Paul

Re: XSP class package name problem

Posted by Ulrich Mayring <ul...@denic.de>.
Paul Russell wrote:
> 
> On Wed, Apr 12, 2000 at 01:18:28PM +0200, Ulrich Mayring wrote:
> > I'm not talking about the generated code, just the plain source code I
> > put in the XSP. There are classes, interfaces and everything you know
> > from Java - but I want to use the business objects and classes that
> > others designed as well. And I want to give them mine.
> 
> Hrm, unless you're talking about plain simple classes that don't use
> syntax orthogonalily (and if you are, then they should probably be
> defined outside the xsp, and imported in with an <xsp:include> tag pair)
> then the code doesn't even *exist* until the XSP engine has strutted
> its funky stuff. Either way, changing the package name by which cocoon
> refers too is probably not the right way to do it.
> 
> In the nicest possible way, I suspect we're going to have to agree
> to differ on this one ;)

Yeah, we can always change the package names of our other code to
appease cocoon ;-)

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP class package name problem

Posted by Paul Russell <Pa...@uea.ac.uk>.
On Wed, Apr 12, 2000 at 01:18:28PM +0200, Ulrich Mayring wrote:
> I'm not talking about the generated code, just the plain source code I
> put in the XSP. There are classes, interfaces and everything you know
> from Java - but I want to use the business objects and classes that
> others designed as well. And I want to give them mine.

Hrm, unless you're talking about plain simple classes that don't use
syntax orthogonalily (and if you are, then they should probably be
defined outside the xsp, and imported in with an <xsp:include> tag pair)
then the code doesn't even *exist* until the XSP engine has strutted
its funky stuff. Either way, changing the package name by which cocoon
refers too is probably not the right way to do it.

In the nicest possible way, I suspect we're going to have to agree
to differ on this one ;)


Paul

Re: XSP class package name problem

Posted by Paul Russell <Pa...@uea.ac.uk>.
On Thu, Apr 13, 2000 at 02:54:17AM +0200, Stefano Mazzocchi wrote:
> would "package base" + "pluggable name generator" make everybody happy?
> 
> Something like
> 
>  base-package="org.mycompany"
>  package-generator="org.mycompany.NameGenerator"
> 
> so that you can have packages of the form
> 
>  org.mycompany.xsp.path.to.xsp.compiled-page
> 
> Who does it sound?

Sounds like a plan. +1.



Paul

Re: XSP class package name problem

Posted by Donald Ball <ba...@webslingerZ.com>.
On Thu, 13 Apr 2000, Stefano Mazzocchi wrote:

> would "package base" + "pluggable name generator" make everybody happy?
> 
> Something like
> 
>  base-package="org.mycompany"
>  package-generator="org.mycompany.NameGenerator"
> 
> so that you can have packages of the form
> 
>  org.mycompany.xsp.path.to.xsp.compiled-page
> 
> Who does it sound?

Unnecessary. +0. put your real code in libraries, just stick the method
calls and maybe some minimal flow control in your XSP pages.

- donald


Re: XSP class package name problem

Posted by Stefano Mazzocchi <st...@apache.org>.
Paul Russell wrote:
> 
> On Wed, Apr 12, 2000 at 12:01:20PM +0200, Ulrich Mayring wrote:
> > Well, first of all the management doesn't like package names of the form
> > _home._user._mydir._thiscompanysux popping up in the revision control
> > system ;-)
> 
> Heh. Can't think why...
> 
> > Second, when I send code to someone (like this list) I don't want to
> > change all package names from _home._user._projects._customers._KGB to
> > something less conspicuous :-)
> 
> That's a good point, although I suspect that might be better
> addressed by using a different package name generation scheme
> within the XSP filter. Dunno what Da Management think (Stefano? Pier?
> Donald?).

If you guys get so picky with style, we can make those name generator
components so that everyone is happy with it. Gee, I've spoiled you guys
with modularity... :)
 
> > Third, we have written mucho Java code with package names of, say,
> > org.mycompany.*  I find myself writing also mucho Java code in XSP pages
> > and I would like to integrate them below org.mycompany - this has
> > nothing to do with webpages. Webpages are just one way of producing
> > output with cocoon. The code I write in XSP pages does pretty generic
> > things, it is not specific to web pages. It pulls some data from here
> > and writes other data (XML) to there - other folks in my company could
> > also make use of that code. Much as I would like to make use of their
> > code - we're trying to unify all our Java code in a clean package
> > structure.
> 
> Hmm... sounds like what you're actually trying to do is to convert
> the XSP into normal java code so you can distribute it easily and
> use it outside the framework. Whilst I'm not totally convinced this
> is A Good Idea(tm), 

No, this is exactly what I'm trying to avoid.

> I'm wondering whether it would be better to
> provide some sort of command line interface to the XSP engine so
> that you're actually generating the java code outside of the frame-
> work itself rather than trying to make cocoon do something it wasn't
> *really* inteded to. Again, what do the others think?

would "package base" + "pluggable name generator" make everybody happy?

Something like

 base-package="org.mycompany"
 package-generator="org.mycompany.NameGenerator"

so that you can have packages of the form

 org.mycompany.xsp.path.to.xsp.compiled-page

Who does it sound?

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Re: XSP class package name problem

Posted by Ulrich Mayring <ul...@denic.de>.
Paul Russell wrote:
> 
> Hmm... sounds like what you're actually trying to do is to convert
> the XSP into normal java code so you can distribute it easily and
> use it outside the framework. Whilst I'm not totally convinced this
> is A Good Idea(tm), I'm wondering whether it would be better to
> provide some sort of command line interface to the XSP engine so
> that you're actually generating the java code outside of the frame-
> work itself rather than trying to make cocoon do something it wasn't
> *really* inteded to. Again, what do the others think?

I'm not talking about the generated code, just the plain source code I
put in the XSP. There are classes, interfaces and everything you know
from Java - but I want to use the business objects and classes that
others designed as well. And I want to give them mine.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP class package name problem

Posted by Paul Russell <Pa...@uea.ac.uk>.
On Wed, Apr 12, 2000 at 12:01:20PM +0200, Ulrich Mayring wrote:
> Well, first of all the management doesn't like package names of the form
> _home._user._mydir._thiscompanysux popping up in the revision control
> system ;-)

Heh. Can't think why...

> Second, when I send code to someone (like this list) I don't want to
> change all package names from _home._user._projects._customers._KGB to
> something less conspicuous :-)

That's a good point, although I suspect that might be better
addressed by using a different package name generation scheme
within the XSP filter. Dunno what Da Management think (Stefano? Pier?
Donald?).

> Third, we have written mucho Java code with package names of, say,
> org.mycompany.*  I find myself writing also mucho Java code in XSP pages
> and I would like to integrate them below org.mycompany - this has
> nothing to do with webpages. Webpages are just one way of producing
> output with cocoon. The code I write in XSP pages does pretty generic
> things, it is not specific to web pages. It pulls some data from here
> and writes other data (XML) to there - other folks in my company could
> also make use of that code. Much as I would like to make use of their
> code - we're trying to unify all our Java code in a clean package
> structure.

Hmm... sounds like what you're actually trying to do is to convert
the XSP into normal java code so you can distribute it easily and
use it outside the framework. Whilst I'm not totally convinced this
is A Good Idea(tm), I'm wondering whether it would be better to
provide some sort of command line interface to the XSP engine so
that you're actually generating the java code outside of the frame-
work itself rather than trying to make cocoon do something it wasn't
*really* inteded to. Again, what do the others think?


Paul

Re: XSP class package name problem

Posted by Ulrich Mayring <ul...@denic.de>.
Paul Russell wrote:
> 
> Remind me again why you needed to change the package name in the
> first place - the only reason I can think of off the top of my
> head is to avoid obscure namespace collisions, but I really
> can't see that being a problem under the current implementation.

Well, first of all the management doesn't like package names of the form
_home._user._mydir._thiscompanysux popping up in the revision control
system ;-)

Second, when I send code to someone (like this list) I don't want to
change all package names from _home._user._projects._customers._KGB to
something less conspicuous :-)

Third, we have written mucho Java code with package names of, say,
org.mycompany.*  I find myself writing also mucho Java code in XSP pages
and I would like to integrate them below org.mycompany - this has
nothing to do with webpages. Webpages are just one way of producing
output with cocoon. The code I write in XSP pages does pretty generic
things, it is not specific to web pages. It pulls some data from here
and writes other data (XML) to there - other folks in my company could
also make use of that code. Much as I would like to make use of their
code - we're trying to unify all our Java code in a clean package
structure.

> One advantage of *not* leaving that kind of thing to the user is
> that it leaves the cocoon implementation free to change without
> affecting any of the pages.

What could possibly change that would break my pages? If the developers
think of a new way to generate package names, then everything that
relies on the old package names, breaks. In other words, we would be
back where we are now ;-)

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP class package name problem

Posted by Paul Russell <Pa...@uea.ac.uk>.
> Ahem. I wrote:
> 
> There should be a way to set the full package name in the XSP.
> 
> But I meant:
> 
> There should be a way to set the full package name of the XSP.

Ahh - iswym now. That's certainly marginally less destructive :)

Remind me again why you needed to change the package name in the
first place - the only reason I can think of off the top of my
head is to avoid obscure namespace collisions, but I really
can't see that being a problem under the current implementation.

One advantage of *not* leaving that kind of thing to the user is
that it leaves the cocoon implementation free to change without
affecting any of the pages.



Paul

Re: XSP class package name problem

Posted by Ulrich Mayring <ul...@denic.de>.
Paul Russell wrote:
> 
> On Tue, Apr 11, 2000 at 11:28:17PM +0200, Stefano Mazzocchi wrote:
> > > Pretty cool as a starting point ;-)
> > >
> > > But I also would love a possibility to specify the complete package
> > > name, i.e. including subdirectories. This basically means that there
> > > should be a way to set the full package name in the XSP.
> >
> > -1
> >
> > XSP are _NOT_ a simplified way for your to write your generators. You
> > should not have the ability to determine what the package would be, thus
> > limiting "abuses" of the XSP technology.
> 
> Um. +(-1). Or something. (I'm with stefano)
> 
> Doing that sort of thing is exactly what causes most of the problems
> java and cocoon set out to solve in the first place.

Ahem. I wrote:

There should be a way to set the full package name in the XSP.

But I meant:

There should be a way to set the full package name of the XSP.

In my mind the sitemap would be a perfect place to do that. As far as
cocoon1 and its properties file goes, it would be enough to be able to
set a package prefix. Everything else is overkill for cocoon1.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP class package name problem

Posted by Paul Russell <Pa...@uea.ac.uk>.
On Tue, Apr 11, 2000 at 11:28:17PM +0200, Stefano Mazzocchi wrote:
> > Pretty cool as a starting point ;-)
> > 
> > But I also would love a possibility to specify the complete package
> > name, i.e. including subdirectories. This basically means that there
> > should be a way to set the full package name in the XSP.
> 
> -1
> 
> XSP are _NOT_ a simplified way for your to write your generators. You
> should not have the ability to determine what the package would be, thus
> limiting "abuses" of the XSP technology.

Um. +(-1). Or something. (I'm with stefano)

Doing that sort of thing is exactly what causes most of the problems
java and cocoon set out to solve in the first place.

XSP is designed for doing something that is basically statically backed,
but pulling in information and logic from other places as it goes.
If you're working on something that is totally dynamic, then you're
better not having a 'file' at all, and spitting XML straight at cocoon
from your code.


Paul

Re: XSP class package name problem

Posted by Stefano Mazzocchi <st...@apache.org>.
Ulrich Mayring wrote:
> 
> Stefano Mazzocchi wrote:
> >
> > Ulrich Mayring wrote:
> > >
> > > Stefano Mazzocchi wrote:
> > > >
> > > > OH, yeah, I saw that once and I forgot to report: Ricardo there is a
> > bug
> > > > in the package name generation!
> > >
> > > And while you're at it: put a property in cocoon.properties, that allows
> > > me to control how the package name is built ;-)
> >
> > Great point.
> >
> > If not present, do it like today, if present, use that given package as
> > starting root.
> >
> > How does it sound?
> 
> Pretty cool as a starting point ;-)
> 
> But I also would love a possibility to specify the complete package
> name, i.e. including subdirectories. This basically means that there
> should be a way to set the full package name in the XSP.

-1

XSP are _NOT_ a simplified way for your to write your generators. You
should not have the ability to determine what the package would be, thus
limiting "abuses" of the XSP technology.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Re: XSP class package name problem

Posted by Ulrich Mayring <ul...@denic.de>.
Stefano Mazzocchi wrote:
> 
> Ulrich Mayring wrote:
> >
> > Stefano Mazzocchi wrote:
> > >
> > > OH, yeah, I saw that once and I forgot to report: Ricardo there is a
> bug
> > > in the package name generation!
> >
> > And while you're at it: put a property in cocoon.properties, that allows
> > me to control how the package name is built ;-)
> 
> Great point.
> 
> If not present, do it like today, if present, use that given package as
> starting root.
> 
> How does it sound?

Pretty cool as a starting point ;-)

But I also would love a possibility to specify the complete package
name, i.e. including subdirectories. This basically means that there
should be a way to set the full package name in the XSP.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP class package name problem

Posted by Stefano Mazzocchi <st...@apache.org>.
Ulrich Mayring wrote:
> 
> Stefano Mazzocchi wrote:
> >
> > OH, yeah, I saw that once and I forgot to report: Ricardo there is a bug
> > in the package name generation!
> 
> And while you're at it: put a property in cocoon.properties, that allows
> me to control how the package name is built ;-)

Great point.

If not present, do it like today, if present, use that given package as
starting root.

How does it sound?

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Re: XSP class package name problem

Posted by Ulrich Mayring <ul...@denic.de>.
Stefano Mazzocchi wrote:
> 
> OH, yeah, I saw that once and I forgot to report: Ricardo there is a bug
> in the package name generation!

And while you're at it: put a property in cocoon.properties, that allows
me to control how the package name is built ;-)

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP class package name problem

Posted by Stefano Mazzocchi <st...@apache.org>.
Roberto Moreda wrote:
> 
> I got 2 XSP pages under my DocumentRoot :
> 
>  /one/page.xml
>  /two/page.xml
> 
> If I GET the pages my XSP repository looks like that :
> 
>  ./_my/_document/_root/_one/_page.java
>  ./_my/_document/_root/_one/_page.class
> 
>  ./_my/_document/_root/_two/_page.java
>  ./_my/_document/_root/_two/_page.class
> 
> but the package in the two files are the same :
> 
>   package _my._document._root;
> 
> instead of :
> 
>   package _my._document._root._one;
>   package _my._document._root._two;
> 
> then I get :
> 
>   java.lang.ClassFormatError: Duplicate name
> 
> when I GET the second "page.xml".
> Any Clues?
> 
>   Rober

OH, yeah, I saw that once and I forgot to report: Ricardo there is a bug
in the package name generation!


-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Re: XSP class package name problem

Posted by Roberto Moreda <mo...@alfa21.com>.
I think this is related to JServ and the 2.0 Servlet API...
Any clue?

  Rober

TIA

-- 
Roberto Moreda Alvarez
Alfa21 Outsourcing S.L.

Re: XSP class package name problem

Posted by Stefano Mazzocchi <st...@apache.org>.
Ricardo Rocha wrote:
> 
> Oops!
> 
> I mistakenly sent this to the list, sorry

It was already patched :)

You're slooooow :)

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------

Re: XSP class package name problem

Posted by Ricardo Rocha <ri...@apache.org>.
Oops!

I mistakenly sent this to the list, sorry

On Thu, 27 Apr 2000, you wrote:
> Hi Roberto,
> 
> I've been unable to replicate this problem. I originally
> thought it may be due to directories "one" and "two"
> (or their "page.xml" entries) being [symbolic] links,
> but the package name generator works correctly
> even in these cases....
> 
> Could you, please, send me more detailed info
> about this problem and your setup?
> 
> Thanks in advance (and, please, forgive my delay
> in replying: I've been sick)
> 
> Regards,
> 
> Ricado
> 
> PD: Voc� fala portugu�s o, tal vez, espa�ol?
> 
> On Mon, 10 Apr 2000, you wrote:
> > I got 2 XSP pages under my DocumentRoot :
> > 
> >  /one/page.xml
> >  /two/page.xml
> > 
> > If I GET the pages my XSP repository looks like that :
> > 
> >  ./_my/_document/_root/_one/_page.java
> >  ./_my/_document/_root/_one/_page.class
> > 
> >  ./_my/_document/_root/_two/_page.java
> >  ./_my/_document/_root/_two/_page.class
> > 
> > but the package in the two files are the same :
> >  
> >   package _my._document._root;
> > 
> > instead of :
> > 
> >   package _my._document._root._one;                                
> >   package _my._document._root._two;                                
> > 
> > then I get :
> > 
> >   java.lang.ClassFormatError: Duplicate name
> > 
> > when I GET the second "page.xml".
> > Any Clues?
> > 
> >   Rober
> > 
> > Thanks in advance. 
> > 
> > -- 
> > Roberto Moreda Alvarez
> > Alfa21 Outsourcing S.L.

Re: XSP class package name problem

Posted by Ricardo Rocha <ri...@apache.org>.
Hi Roberto,

I've been unable to replicate this problem. I originally
thought it may be due to directories "one" and "two"
(or their "page.xml" entries) being [symbolic] links,
but the package name generator works correctly
even in these cases....

Could you, please, send me more detailed info
about this problem and your setup?

Thanks in advance (and, please, forgive my delay
in replying: I've been sick)

Regards,

Ricado

PD: Voc� fala portugu�s o, tal vez, espa�ol?

On Mon, 10 Apr 2000, you wrote:
> I got 2 XSP pages under my DocumentRoot :
> 
>  /one/page.xml
>  /two/page.xml
> 
> If I GET the pages my XSP repository looks like that :
> 
>  ./_my/_document/_root/_one/_page.java
>  ./_my/_document/_root/_one/_page.class
> 
>  ./_my/_document/_root/_two/_page.java
>  ./_my/_document/_root/_two/_page.class
> 
> but the package in the two files are the same :
>  
>   package _my._document._root;
> 
> instead of :
> 
>   package _my._document._root._one;                                
>   package _my._document._root._two;                                
> 
> then I get :
> 
>   java.lang.ClassFormatError: Duplicate name
> 
> when I GET the second "page.xml".
> Any Clues?
> 
>   Rober
> 
> Thanks in advance. 
> 
> -- 
> Roberto Moreda Alvarez
> Alfa21 Outsourcing S.L.

Re: XSP class package name problem

Posted by Roberto Moreda <mo...@alfa21.com>.
Ahem... :)

The little problem arises when the path of the XSP contains a dot (by
example: /var/www/paquito.com/de/ines/)

In XSPJavaProcessor.java the method packageName() uses
normalizedBaseName(String) with a string that only contains a path (the future
package name), NOT a filename, and "cuts" the string at the first dot. 

Here you are a little patch for cocoon-1.7.2 which solves the problem... 
... I think ;)

    Rober
 
-- 
Roberto Moreda Alvarez
Alfa21 Outsourcing S.L.