You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Gunter D'Hondt <gu...@sofico.be> on 2006/02/03 09:41:45 UTC

Tomcat5.5 and trailing slash on URL

All,

My Cocoon webapp works fine under Tomcat 4.x but now I'd like to deploy in 
under Tomcat5.5; it all works fine except that apparently Tomcat always 
adds an extra slash to the URL at the back; so if I type 

http://localhost:8080/cocoon/welcomepage

it will enter the Cocoon sitemap with

http://localhost:8080/cocoon/welcomepage/

and ofcoz my pipeline matcher is "welcomepage"; has anybody else had this 
problem? I know I can fix it by changing the matcher to "welcomepage/" but 
then I'd have to change all my pipelines while I'd just want to use the 
URL that the user types in (maybe a configuration setting in Tomcat or 
something like that?)

Any help is welcome,

Gunter D'Hondt

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


Antwort: Re: Tomcat5.5 and trailing slash on URL

Posted by ma...@rzb.at.

Hi Gunter,

we had the same problem with websphere. It was a bug in the 6.0.2.3 version
from IBM.

Have a look at the servlet mappings configured in your deployment
descriptor (web.xml in WEB-INF)
There is a section with generell mappings, maybe that helps.

mit freundlichen Grüßen / kind regards
Manfred Weigel
________________________________
Raiffeisen Zentralbank Österreich AG
ORG/IT - Software Development
A-1030 Vienna, Am Stadtpark 9


|--------------------------------->
|            gunter.dhondt@sofico.|
|            be@inet              |
|                                 |
|                                 |
|            03.02.2006 10:27     |
|                                 |
|                                 |
|             Bitte antworten an  |
|            users@cocoon.apache.o|
|                   rg@inet       |
|                                 |
|--------------------------------->
  >-------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                                     |
  |                                                                                                                                     |
  |                                                                                                                                   An|
  |         users@cocoon.apache.org                                                                                                     |
  |                                                                                                                                Kopie|
  |                                                                                                                                     |
  |                                                                                                                                Thema|
  |         Re: Tomcat5.5 and trailing slash on URL                                                                                     |
  |                                                                                                                                     |
  |                                                                                                                                     |
  |                                                                                                                                     |
  |                                                                                                                                     |
  |                                                                                                                                     |
  >-------------------------------------------------------------------------------------------------------------------------------------|




I've just checked the tomcat examples and they all work fine and no
trailing slash is added to the URL so it must have to do something with
the cocoon webapp....

anybody any idea pls?
Gunter






Thomas Soddemann <Th...@rzg.mpg.de>
03/02/2006 10:24
Please respond to
users@cocoon.apache.org


To
users@cocoon.apache.org
cc

Subject
Re: Tomcat5.5 and trailing slash on URL






Gunter,

usually our sitemaps contain patterns like
pattern="whatever" or pattern="*whatever"

as well as

pattern="path/*"

and the like.

We do not have explicitly
pattern="path/"

We are using cocoon 2.1.7 with tomcat 5.5.9 and 2.1.8 with 5.5.15.

Thomas

Gunter D'Hondt wrote:

>Thomas,
>
>Tested it with FF & IE; both the same problem and when testing it with
>Tomcat4 the browsers are not giving any errors so that's why I'm assuming

>it must be Tomcat.
>
>Do you have any pipeline matchers that don't end with a slash? if
>everything ends with / or * it will indeed work; but for me changing all
>this is will means that I need to recheck all my URLs of my webapp (a lot

>of work)
>
>Tomcat5.5.15, Cocoon2.1.4 (I know an old version)
>
>Gunter
>
>
>
>
>
>
--
--------------------------------------------------
 Dr. Thomas Soddemann     |  Boltzmannstrasse 2
 Projects Engineer        |  85748 Garching
 Rechenzentrum der MPG    |  Germany
 am MPI fuer Plasmaphysik |
---------------------------------------------------
 phone: +49 89 3299 2694  |  fax: +49 89 3299 1301
---------------------------------------------------


---------------------------------------------------------------------
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





This message and any attachment ("the Message") are confidential. If you
have received the Message in error, please notify the sender immediately
and delete the Message from your system , any use of the Message is
forbidden.
Correspondence via e-mail is primarily for information purposes. RZB
neither makes nor accepts legally binding statements unless otherwise
agreed to the contrary.

Re: Tomcat5.5 and trailing slash on URL

Posted by Gunter D'Hondt <gu...@sofico.be>.
I've just checked the tomcat examples and they all work fine and no 
trailing slash is added to the URL so it must have to do something with 
the cocoon webapp....

anybody any idea pls?
Gunter






Thomas Soddemann <Th...@rzg.mpg.de> 
03/02/2006 10:24
Please respond to
users@cocoon.apache.org


To
users@cocoon.apache.org
cc

Subject
Re: Tomcat5.5 and trailing slash on URL






Gunter,

usually our sitemaps contain patterns like
pattern="whatever" or pattern="*whatever"

as well as

pattern="path/*"

and the like.

We do not have explicitly
pattern="path/"

We are using cocoon 2.1.7 with tomcat 5.5.9 and 2.1.8 with 5.5.15.

Thomas

Gunter D'Hondt wrote:

>Thomas,
>
>Tested it with FF & IE; both the same problem and when testing it with 
>Tomcat4 the browsers are not giving any errors so that's why I'm assuming 

>it must be Tomcat. 
>
>Do you have any pipeline matchers that don't end with a slash? if 
>everything ends with / or * it will indeed work; but for me changing all 
>this is will means that I need to recheck all my URLs of my webapp (a lot 

>of work)
>
>Tomcat5.5.15, Cocoon2.1.4 (I know an old version)
>
>Gunter
>
>
>
> 
> 
>
-- 
--------------------------------------------------
 Dr. Thomas Soddemann     |  Boltzmannstrasse 2
 Projects Engineer        |  85748 Garching
 Rechenzentrum der MPG    |  Germany 
 am MPI fuer Plasmaphysik |
---------------------------------------------------
 phone: +49 89 3299 2694  |  fax: +49 89 3299 1301
---------------------------------------------------


---------------------------------------------------------------------
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: Tomcat5.5 and trailing slash on URL

Posted by Thomas Soddemann <Th...@rzg.mpg.de>.
Gunter,

usually our sitemaps contain patterns like
pattern="whatever" or pattern="*whatever"

as well as

pattern="path/*"

and the like.

We do not have explicitly
pattern="path/"

We are using cocoon 2.1.7 with tomcat 5.5.9 and 2.1.8 with 5.5.15.

Thomas

Gunter D'Hondt wrote:

>Thomas,
>
>Tested it with FF & IE; both the same problem and when testing it with 
>Tomcat4 the browsers are not giving any errors so that's why I'm assuming 
>it must be Tomcat. 
>
>Do you have any pipeline matchers that don't end with a slash? if 
>everything ends with / or * it will indeed work; but for me changing all 
>this is will means that I need to recheck all my URLs of my webapp (a lot 
>of work)
>
>Tomcat5.5.15, Cocoon2.1.4 (I know an old version)
>
>Gunter
>
>
>
> 
>  
>
-- 
--------------------------------------------------
 Dr. Thomas Soddemann     |  Boltzmannstrasse 2
 Projects Engineer        |  85748 Garching
 Rechenzentrum der MPG    |  Germany 
 am MPI fuer Plasmaphysik |
---------------------------------------------------
 phone: +49 89 3299 2694  |  fax: +49 89 3299 1301
---------------------------------------------------


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


Re: Tomcat5.5 and trailing slash on URL

Posted by Gunter D'Hondt <gu...@sofico.be>.
Thomas,

Tested it with FF & IE; both the same problem and when testing it with 
Tomcat4 the browsers are not giving any errors so that's why I'm assuming 
it must be Tomcat. 

Do you have any pipeline matchers that don't end with a slash? if 
everything ends with / or * it will indeed work; but for me changing all 
this is will means that I need to recheck all my URLs of my webapp (a lot 
of work)

Tomcat5.5.15, Cocoon2.1.4 (I know an old version)

Gunter



 



Thomas Soddemann <Th...@rzg.mpg.de> 
03/02/2006 09:59
Please respond to
users@cocoon.apache.org


To
users@cocoon.apache.org
cc

Subject
Re: Tomcat5.5 and trailing slash on URL






Hi Gunter,

we have cocoon based application deployed in tomcat 5.5.9 and 5.5.15 and
we do not observe that behavior. Are you sure it is tomcat and not your
web browser?

Cheers,
Thomas

Gunter D'Hondt wrote:

>All,
>
>My Cocoon webapp works fine under Tomcat 4.x but now I'd like to deploy 
in 
>under Tomcat5.5; it all works fine except that apparently Tomcat always 
>adds an extra slash to the URL at the back; so if I type 
>
>http://localhost:8080/cocoon/welcomepage
>
>it will enter the Cocoon sitemap with
>
>http://localhost:8080/cocoon/welcomepage/
>
>and ofcoz my pipeline matcher is "welcomepage"; has anybody else had this 

>problem? I know I can fix it by changing the matcher to "welcomepage/" 
but 
>then I'd have to change all my pipelines while I'd just want to use the 
>URL that the user types in (maybe a configuration setting in Tomcat or 
>something like that?)
>
>Any help is welcome,
>
>Gunter D'Hondt
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
> 
>


-- 
--------------------------------------------------
 Dr. Thomas Soddemann     |  Boltzmannstrasse 2
 Projects Engineer        |  85748 Garching
 Rechenzentrum der MPG    |  Germany 
 am MPI fuer Plasmaphysik |
---------------------------------------------------
 phone: +49 89 3299 2694  |  fax: +49 89 3299 1301
---------------------------------------------------


---------------------------------------------------------------------
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: Tomcat5.5 and trailing slash on URL

Posted by Thomas Soddemann <Th...@rzg.mpg.de>.
Hi Gunter,

we have cocoon based application deployed in tomcat 5.5.9 and 5.5.15 and
we do not observe that behavior. Are you sure it is tomcat and not your
web browser?

Cheers,
Thomas

Gunter D'Hondt wrote:

>All,
>
>My Cocoon webapp works fine under Tomcat 4.x but now I'd like to deploy in 
>under Tomcat5.5; it all works fine except that apparently Tomcat always 
>adds an extra slash to the URL at the back; so if I type 
>
>http://localhost:8080/cocoon/welcomepage
>
>it will enter the Cocoon sitemap with
>
>http://localhost:8080/cocoon/welcomepage/
>
>and ofcoz my pipeline matcher is "welcomepage"; has anybody else had this 
>problem? I know I can fix it by changing the matcher to "welcomepage/" but 
>then I'd have to change all my pipelines while I'd just want to use the 
>URL that the user types in (maybe a configuration setting in Tomcat or 
>something like that?)
>
>Any help is welcome,
>
>Gunter D'Hondt
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>  
>


-- 
--------------------------------------------------
 Dr. Thomas Soddemann     |  Boltzmannstrasse 2
 Projects Engineer        |  85748 Garching
 Rechenzentrum der MPG    |  Germany 
 am MPI fuer Plasmaphysik |
---------------------------------------------------
 phone: +49 89 3299 2694  |  fax: +49 89 3299 1301
---------------------------------------------------


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


Re: Tomcat5.5 and trailing slash on URL

Posted by Gunter D'Hondt <gu...@sofico.be>.
fyi:

after some debugging I found out that Tomcat5 always adds a trailing slash 
to the URL if the URL matches to the directory structure; so if in your 
cocoon webapp you have an URL matcher for "abc" and also in the webapp a 
"abc"-directory then Tomcat will automatically add the "/" to it; if the 
"abc"-dir doesn't exist it doesn't add the "/"

so this means that Tomcat5 will first check with the filesystem before it 
does it's servlet-mapping to the CocoonServlet.

Regards,
Gunter D'Hondt



 



Bertrand Delacretaz <bd...@apache.org> 
06/02/2006 14:06
Please respond to
users@cocoon.apache.org


To
users@cocoon.apache.org
cc

Subject
Re: Tomcat5.5 and trailing slash on URL






Le 6 févr. 06, à 13:50, Gunter D'Hondt a écrit :

> ...we are both
> facing the same problem (so it's not related to my old cocoon version) 
> and
> it isn't related to the code (since Markus is using the cocoon samples)
> but we can both almost for sure say that it has something to do with 
> the
> core of Cocoon?..

I don't have time to help directly ATM, but here's a suggestion:

To locate the precise cause of the problem, the best would be IMHO to 
start tomcat with remote debugging active, connect with a Java debugger 
and set a breakpoint in the CocoonServlet.service(...) method.

You can then examine the HttpServletRequest object provided by tomcat 
and see how the path looks there.  If you're not comfortable with Java 
debuggers, you could also hack the CocoonServlet to add all kinds of 
System.err.println at the beginning of that method.

If (as I suspect) the path is already wrong there, having a precise 
diagnostic like that would allow you to ask the Tomcat guys if they 
know what could be causing the problem.

-Bertrand



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


Re: map:call function

Posted by Gunter D'Hondt <gu...@sofico.be>.
Marc,

Indeed, after a few hours of headache I've found that two of our deploy 
processes were mixed up together!

Thanks,
Gunter D'Hondt





Marc Portier <mp...@outerthought.org> 
09/03/2006 08:23
Please respond to
users@cocoon.apache.org


To
users@cocoon.apache.org
cc

Subject
Re: map:call function






from the book (javadoc)
> java.lang.LinkageError
> 
> Subclasses of LinkageError indicate that a class has some dependency on 
another class; however, the latter class has incompatibly changed after 
the compilation of the former class.

So clearly it has to be some variant of a not-clean-build, so you need
to check your build/deploy/test strategy.

I'ld suggest removing references to any of the cocoon 1-4 jars and do a
clean rebuild of your complete project, chances are you do have some
lingering calls/references in there to the old stuff...

You might want to check your deployment process as well, maybe newer
versions of your jars aren't uploaded to the test-environment, or
they're not overwriting/removing the old ones and name/version-numbers
are putting them behind the old ones in the classpath (so you still have
the old ones loaded)

One way to detect this last issue is by calling
classloader.getResource("be/sofico/MyApple.class") and see from which
jar your class gets loaded...

Maybe also compare checksums on those jar-files ensuring it's in sync
with the version you've just been cleanly-rebuilding..

regards,
-marc=


Gunter D'Hondt wrote:
> Anybody an idea of my problem below?? I've already tried several things 
> but I'm out of ideas now and this is blocking our upgrade from 2.1.4 to 
> 2.1.8
> 
> Thanks in advance!
> Gunter D'Hondt
> 
> 
> 
> 
> 
> 
> Gunter D'Hondt <gu...@sofico.be> 
> 23/02/2006 14:37
> Please respond to
> users@cocoon.apache.org
> 
> 
> To
> users@cocoon.apache.org
> cc
> 
> Subject
> Re: map:call function
> 
> 
> 
> 
> 
> 
> apparently the call function does work but when instantiating my apple 
it 
> gets a java.lang.LinkageError:
> 
> I've adjusted the 
> org.apache.cocoon.components.flow.apples.ApplesProcessor:
>     private AppleController instantiateController(String className)
>         throws Exception {
> 
>         // TODO think about dynamic reloading of these beasts in future
>         // classloading stuf et al.
> 
>         if (getLogger().isDebugEnabled())
>             getLogger().debug("ApplesProcessor->instantiateController() 
- 
> className='"+className+"'");
> 
>                 try {
>                 Class clazz = Class.forName(className);
>                 Object o = clazz.newInstance();
>                 return (AppleController) o;
>                 }
>                 catch (LinkageError e)
>                 {
>                 if (getLogger().isDebugEnabled())
>  getLogger().debug("ApplesProcessor->instantiateController() - 
> LinkageError msg="+e.getMessage());
>                 }
>                 return null;
>     }
> 
> 
> this generates the following logging;
> (2006-02-23) 14:19.15:296 ApplesProcessor: 
ApplesProcessor->callFunction() 
> 
> - className='be.sofico.MyApple'
> (2006-02-23) 14:19.15:296 ApplesProcessor: 
> ApplesProcessor->instantiateController() - className='be.sofico.MyApple'
> (2006-02-23) 14:19.15:312 ApplesProcessor: 
> ApplesProcessor->instantiateController() - LinkageError 
> msg=org/apache/cocoon/woody/formmodel/Widget
> 
> so it must be something inside the class MyApple that incorrectly links 
to 
> 
> the old Woody Widget class but looking at the import of my class this 
> should not be possible:
> 
> import org.apache.cocoon.ProcessingException;
> import org.apache.cocoon.i18n.I18nUtils;
> import org.apache.cocoon.components.flow.apples.AppleController;
> import org.apache.cocoon.components.flow.apples.AppleRequest;
> import org.apache.cocoon.components.flow.apples.AppleResponse;
> import org.apache.cocoon.environment.Session;
> import org.apache.cocoon.forms.FormContext;
> import org.apache.cocoon.forms.FormManager;
> import org.apache.cocoon.forms.binding.Binding;
> import org.apache.cocoon.forms.binding.BindingManager;
> import org.apache.cocoon.forms.event.FormHandler;
> import org.apache.cocoon.forms.formmodel.Form;
> I've recompiled all the classes correctly; I'm assuming that I don't 
need 
> the deprecated woody-block to run the cforms-block ???
> 
> Pls, any help is welcome,
> 
> Regards,
> Gunter D'Hondt
> 
> 
> 
> 
> 
> 
> 
> 
> Gunter D'Hondt <gu...@sofico.be> 
> 22/02/2006 15:47
> Please respond to
> users@cocoon.apache.org
> 
> 
> To
> users@cocoon.apache.org
> cc
> 
> Subject
> map:call function
> 
> 
> 
> 
> 
> 
> I'm currently upgrading from 2.1.4 to 2.1.8 and converted all Woody 
stuff 
> to CForms stuff but when calling the following sitemap snippet I'm 
getting 
> 
> 
> the error below.
> 
> sitemap snippet:
>       <map:flow language="apples"/>
>  ...
>       <map:match pattern="welcomepage">
>         <map:call function="be.sofico.myApple">
>         ...
>         </map:call>
>       </map:match>
> 
> the stacktrace snippet:
> java.lang.NoClassDefFoundError: org/apache/cocoon/woody/formmodel/Widget
>                  at java.lang.Class.forName0(Native Method)
>                  at java.lang.Class.forName(Class.java:141)
>                  at 
> 
org.apache.cocoon.components.flow.apples.ApplesProcessor.instantiateController(ApplesProcessor.java:108)
>                  at 
> 
org.apache.cocoon.components.flow.apples.ApplesProcessor.callFunction(ApplesProcessor.java:52)
>                  at 
> 
org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:138)
> 
> so following the ApplesProcessor.java:108 it should make a new instance 
> (thru reflecting) from the "be.sofico.myApple" string "classname" but 
> apparently it is trying to make a Widget object using the old woody 
> package. I don't even understand why it should make a CForms widget at 
> that moment.
> 
> any help is welcome,
> 
> Regards,
> Gunter D'Hondt
> 
>

-- 
Marc Portier                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at                http://blogs.cocoondev.org/mpo/
mpo@outerthought.org                              mpo@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: map:call function

Posted by Marc Portier <mp...@outerthought.org>.
from the book (javadoc)
> java.lang.LinkageError
> 
> Subclasses of LinkageError indicate that a class has some dependency on another class; however, the latter class has incompatibly changed after the compilation of the former class.

So clearly it has to be some variant of a not-clean-build, so you need
to check your build/deploy/test strategy.

I'ld suggest removing references to any of the cocoon 1-4 jars and do a
clean rebuild of your complete project, chances are you do have some
lingering calls/references in there to the old stuff...

You might want to check your deployment process as well, maybe newer
versions of your jars aren't uploaded to the test-environment, or
they're not overwriting/removing the old ones and name/version-numbers
are putting them behind the old ones in the classpath (so you still have
the old ones loaded)

One way to detect this last issue is by calling
classloader.getResource("be/sofico/MyApple.class") and see from which
jar your class gets loaded...

Maybe also compare checksums on those jar-files ensuring it's in sync
with the version you've just been cleanly-rebuilding..

regards,
-marc=


Gunter D'Hondt wrote:
> Anybody an idea of my problem below?? I've already tried several things 
> but I'm out of ideas now and this is blocking our upgrade from 2.1.4 to 
> 2.1.8
> 
> Thanks in advance!
> Gunter D'Hondt
> 
> 
>  
> 
> 
> 
> Gunter D'Hondt <gu...@sofico.be> 
> 23/02/2006 14:37
> Please respond to
> users@cocoon.apache.org
> 
> 
> To
> users@cocoon.apache.org
> cc
> 
> Subject
> Re: map:call function
> 
> 
> 
> 
> 
> 
> apparently the call function does work but when instantiating my apple it 
> gets a java.lang.LinkageError:
> 
> I've adjusted the 
> org.apache.cocoon.components.flow.apples.ApplesProcessor:
>     private AppleController instantiateController(String className)
>         throws Exception {
> 
>         // TODO think about dynamic reloading of these beasts in future
>         // classloading stuf et al.
> 
>         if (getLogger().isDebugEnabled())
>             getLogger().debug("ApplesProcessor->instantiateController() - 
> className='"+className+"'");
> 
>                 try {
>                 Class clazz = Class.forName(className);
>                 Object o = clazz.newInstance();
>                 return (AppleController) o;
>                 }
>                 catch (LinkageError e)
>                 {
>                 if (getLogger().isDebugEnabled())
>  getLogger().debug("ApplesProcessor->instantiateController() - 
> LinkageError msg="+e.getMessage());
>                 }
>                 return null;
>     }
> 
> 
> this generates the following logging;
> (2006-02-23) 14:19.15:296 ApplesProcessor: ApplesProcessor->callFunction() 
> 
> - className='be.sofico.MyApple'
> (2006-02-23) 14:19.15:296 ApplesProcessor: 
> ApplesProcessor->instantiateController() - className='be.sofico.MyApple'
> (2006-02-23) 14:19.15:312 ApplesProcessor: 
> ApplesProcessor->instantiateController() - LinkageError 
> msg=org/apache/cocoon/woody/formmodel/Widget
> 
> so it must be something inside the class MyApple that incorrectly links to 
> 
> the old Woody Widget class but looking at the import of my class this 
> should not be possible:
> 
> import org.apache.cocoon.ProcessingException;
> import org.apache.cocoon.i18n.I18nUtils;
> import org.apache.cocoon.components.flow.apples.AppleController;
> import org.apache.cocoon.components.flow.apples.AppleRequest;
> import org.apache.cocoon.components.flow.apples.AppleResponse;
> import org.apache.cocoon.environment.Session;
> import org.apache.cocoon.forms.FormContext;
> import org.apache.cocoon.forms.FormManager;
> import org.apache.cocoon.forms.binding.Binding;
> import org.apache.cocoon.forms.binding.BindingManager;
> import org.apache.cocoon.forms.event.FormHandler;
> import org.apache.cocoon.forms.formmodel.Form;
> I've recompiled all the classes correctly; I'm assuming that I don't need 
> the deprecated woody-block to run the cforms-block ???
> 
> Pls, any help is welcome,
> 
> Regards,
> Gunter D'Hondt
>  
> 
> 
> 
> 
> 
> 
> 
> Gunter D'Hondt <gu...@sofico.be> 
> 22/02/2006 15:47
> Please respond to
> users@cocoon.apache.org
> 
> 
> To
> users@cocoon.apache.org
> cc
> 
> Subject
> map:call function
> 
> 
> 
> 
> 
> 
> I'm currently upgrading from 2.1.4 to 2.1.8 and converted all Woody stuff 
> to CForms stuff but when calling the following sitemap snippet I'm getting 
> 
> 
> the error below.
> 
> sitemap snippet:
>       <map:flow language="apples"/>
>  ...
>       <map:match pattern="welcomepage">
>         <map:call function="be.sofico.myApple">
>         ...
>         </map:call>
>       </map:match>
> 
> the stacktrace snippet:
> java.lang.NoClassDefFoundError: org/apache/cocoon/woody/formmodel/Widget
>                  at java.lang.Class.forName0(Native Method)
>                  at java.lang.Class.forName(Class.java:141)
>                  at 
> org.apache.cocoon.components.flow.apples.ApplesProcessor.instantiateController(ApplesProcessor.java:108)
>                  at 
> org.apache.cocoon.components.flow.apples.ApplesProcessor.callFunction(ApplesProcessor.java:52)
>                  at 
> org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:138)
> 
> so following the ApplesProcessor.java:108 it should make a new instance 
> (thru reflecting) from the "be.sofico.myApple" string "classname" but 
> apparently it is trying to make a Widget object using the old woody 
> package. I don't even understand why it should make a CForms widget at 
> that moment.
> 
> any help is welcome,
> 
> Regards,
> Gunter D'Hondt
> 
>

-- 
Marc Portier                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at                http://blogs.cocoondev.org/mpo/
mpo@outerthought.org                              mpo@apache.org

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


Re: map:call function

Posted by Gunter D'Hondt <gu...@sofico.be>.
Anybody an idea of my problem below?? I've already tried several things 
but I'm out of ideas now and this is blocking our upgrade from 2.1.4 to 
2.1.8

Thanks in advance!
Gunter D'Hondt


 



Gunter D'Hondt <gu...@sofico.be> 
23/02/2006 14:37
Please respond to
users@cocoon.apache.org


To
users@cocoon.apache.org
cc

Subject
Re: map:call function






apparently the call function does work but when instantiating my apple it 
gets a java.lang.LinkageError:

I've adjusted the 
org.apache.cocoon.components.flow.apples.ApplesProcessor:
    private AppleController instantiateController(String className)
        throws Exception {

        // TODO think about dynamic reloading of these beasts in future
        // classloading stuf et al.

        if (getLogger().isDebugEnabled())
            getLogger().debug("ApplesProcessor->instantiateController() - 
className='"+className+"'");

                try {
                Class clazz = Class.forName(className);
                Object o = clazz.newInstance();
                return (AppleController) o;
                }
                catch (LinkageError e)
                {
                if (getLogger().isDebugEnabled())
 getLogger().debug("ApplesProcessor->instantiateController() - 
LinkageError msg="+e.getMessage());
                }
                return null;
    }


this generates the following logging;
(2006-02-23) 14:19.15:296 ApplesProcessor: ApplesProcessor->callFunction() 

- className='be.sofico.MyApple'
(2006-02-23) 14:19.15:296 ApplesProcessor: 
ApplesProcessor->instantiateController() - className='be.sofico.MyApple'
(2006-02-23) 14:19.15:312 ApplesProcessor: 
ApplesProcessor->instantiateController() - LinkageError 
msg=org/apache/cocoon/woody/formmodel/Widget

so it must be something inside the class MyApple that incorrectly links to 

the old Woody Widget class but looking at the import of my class this 
should not be possible:

import org.apache.cocoon.ProcessingException;
import org.apache.cocoon.i18n.I18nUtils;
import org.apache.cocoon.components.flow.apples.AppleController;
import org.apache.cocoon.components.flow.apples.AppleRequest;
import org.apache.cocoon.components.flow.apples.AppleResponse;
import org.apache.cocoon.environment.Session;
import org.apache.cocoon.forms.FormContext;
import org.apache.cocoon.forms.FormManager;
import org.apache.cocoon.forms.binding.Binding;
import org.apache.cocoon.forms.binding.BindingManager;
import org.apache.cocoon.forms.event.FormHandler;
import org.apache.cocoon.forms.formmodel.Form;
I've recompiled all the classes correctly; I'm assuming that I don't need 
the deprecated woody-block to run the cforms-block ???

Pls, any help is welcome,

Regards,
Gunter D'Hondt
 







Gunter D'Hondt <gu...@sofico.be> 
22/02/2006 15:47
Please respond to
users@cocoon.apache.org


To
users@cocoon.apache.org
cc

Subject
map:call function






I'm currently upgrading from 2.1.4 to 2.1.8 and converted all Woody stuff 
to CForms stuff but when calling the following sitemap snippet I'm getting 


the error below.

sitemap snippet:
      <map:flow language="apples"/>
 ...
      <map:match pattern="welcomepage">
        <map:call function="be.sofico.myApple">
        ...
        </map:call>
      </map:match>

the stacktrace snippet:
java.lang.NoClassDefFoundError: org/apache/cocoon/woody/formmodel/Widget
                 at java.lang.Class.forName0(Native Method)
                 at java.lang.Class.forName(Class.java:141)
                 at 
org.apache.cocoon.components.flow.apples.ApplesProcessor.instantiateController(ApplesProcessor.java:108)
                 at 
org.apache.cocoon.components.flow.apples.ApplesProcessor.callFunction(ApplesProcessor.java:52)
                 at 
org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:138)

so following the ApplesProcessor.java:108 it should make a new instance 
(thru reflecting) from the "be.sofico.myApple" string "classname" but 
apparently it is trying to make a Widget object using the old woody 
package. I don't even understand why it should make a CForms widget at 
that moment.

any help is welcome,

Regards,
Gunter D'Hondt



---------------------------------------------------------------------
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: map:call function

Posted by Gunter D'Hondt <gu...@sofico.be>.
apparently the call function does work but when instantiating my apple it 
gets a java.lang.LinkageError:

I've adjusted the 
org.apache.cocoon.components.flow.apples.ApplesProcessor:
    private AppleController instantiateController(String className)
        throws Exception {

        // TODO think about dynamic reloading of these beasts in future
        // classloading stuf et al.

        if (getLogger().isDebugEnabled())
            getLogger().debug("ApplesProcessor->instantiateController() - 
className='"+className+"'");

                try {
                Class clazz = Class.forName(className);
                Object o = clazz.newInstance();
                return (AppleController) o;
                }
                catch (LinkageError e)
                {
                if (getLogger().isDebugEnabled())
 getLogger().debug("ApplesProcessor->instantiateController() - 
LinkageError msg="+e.getMessage());
                }
                return null;
    }


this generates the following logging;
(2006-02-23) 14:19.15:296 ApplesProcessor: ApplesProcessor->callFunction() 
- className='be.sofico.MyApple'
(2006-02-23) 14:19.15:296 ApplesProcessor: 
ApplesProcessor->instantiateController() - className='be.sofico.MyApple'
(2006-02-23) 14:19.15:312 ApplesProcessor: 
ApplesProcessor->instantiateController() - LinkageError 
msg=org/apache/cocoon/woody/formmodel/Widget

so it must be something inside the class MyApple that incorrectly links to 
the old Woody Widget class but looking at the import of my class this 
should not be possible:

import org.apache.cocoon.ProcessingException;
import org.apache.cocoon.i18n.I18nUtils;
import org.apache.cocoon.components.flow.apples.AppleController;
import org.apache.cocoon.components.flow.apples.AppleRequest;
import org.apache.cocoon.components.flow.apples.AppleResponse;
import org.apache.cocoon.environment.Session;
import org.apache.cocoon.forms.FormContext;
import org.apache.cocoon.forms.FormManager;
import org.apache.cocoon.forms.binding.Binding;
import org.apache.cocoon.forms.binding.BindingManager;
import org.apache.cocoon.forms.event.FormHandler;
import org.apache.cocoon.forms.formmodel.Form;
I've recompiled all the classes correctly; I'm assuming that I don't need 
the deprecated woody-block to run the cforms-block ???

Pls, any help is welcome,

Regards,
Gunter D'Hondt
 







Gunter D'Hondt <gu...@sofico.be> 
22/02/2006 15:47
Please respond to
users@cocoon.apache.org


To
users@cocoon.apache.org
cc

Subject
map:call function






I'm currently upgrading from 2.1.4 to 2.1.8 and converted all Woody stuff 
to CForms stuff but when calling the following sitemap snippet I'm getting 

the error below.

sitemap snippet:
      <map:flow language="apples"/>
 ...
      <map:match pattern="welcomepage">
        <map:call function="be.sofico.myApple">
        ...
        </map:call>
      </map:match>

the stacktrace snippet:
java.lang.NoClassDefFoundError: org/apache/cocoon/woody/formmodel/Widget
                 at java.lang.Class.forName0(Native Method)
                 at java.lang.Class.forName(Class.java:141)
                 at 
org.apache.cocoon.components.flow.apples.ApplesProcessor.instantiateController(ApplesProcessor.java:108)
                 at 
org.apache.cocoon.components.flow.apples.ApplesProcessor.callFunction(ApplesProcessor.java:52)
                 at 
org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:138)

so following the ApplesProcessor.java:108 it should make a new instance 
(thru reflecting) from the "be.sofico.myApple" string "classname" but 
apparently it is trying to make a Widget object using the old woody 
package. I don't even understand why it should make a CForms widget at 
that moment.

any help is welcome,

Regards,
Gunter D'Hondt



---------------------------------------------------------------------
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


map:call function

Posted by Gunter D'Hondt <gu...@sofico.be>.
I'm currently upgrading from 2.1.4 to 2.1.8 and converted all Woody stuff 
to CForms stuff but when calling the following sitemap snippet I'm getting 
the error below.

sitemap snippet:
      <map:flow language="apples"/>
 ...
      <map:match pattern="welcomepage">
        <map:call function="be.sofico.myApple">
        ...
        </map:call>
      </map:match>

the stacktrace snippet:
java.lang.NoClassDefFoundError: org/apache/cocoon/woody/formmodel/Widget
                 at java.lang.Class.forName0(Native Method)
                 at java.lang.Class.forName(Class.java:141)
                 at 
org.apache.cocoon.components.flow.apples.ApplesProcessor.instantiateController(ApplesProcessor.java:108)
                 at 
org.apache.cocoon.components.flow.apples.ApplesProcessor.callFunction(ApplesProcessor.java:52)
                 at 
org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:138)

so following the ApplesProcessor.java:108 it should make a new instance 
(thru reflecting) from the "be.sofico.myApple" string "classname" but 
apparently it is trying to make a Widget object using the old woody 
package. I don't even understand why it should make a CForms widget at 
that moment.

any help is welcome,

Regards,
Gunter D'Hondt



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


Re: CForms.process(formContext)

Posted by Simone Gianni <s....@thebug.it>.
Hi Gunter,
the process can return false for mainly two reasons :
- The form does not validate correctly
- Somebody called the endProcessing(false) method.

This second situation is triggered in many cases :
- The submit widget is a field (with a listener, or 
submit-on-change=true ..)
- The submit widget is an action (an action is actually just a button, 
so it's supposed a listener is connected to it)
- Some other widget called the endProcessing(false) for some reason 
(search the occurencies of endProcessing inside forms source).

If you cannot find what's happening only with this, you could try the 
following :
- Remote debug your cocoon application (run cocoon.bat servlet-debug and 
the connect in debugging from an ide like eclipse).
- Put a brakpoint inside endProcessing, and see if it's called with 
false and thus watch at the stack trace.
- If nobody calls it, then the process method calls validate, so 
probably it's a validation issue.
- Put a breakpoint inside the validate method and try to understand who 
is not validating and why it does not place a validation error, this 
could be a bug.

Hope this helps,
Simone

Gunter D'Hondt wrote:

>Hi,
>
>How can I check which validation error or widget that is triggering a 
>"false" after the process()-method. This becourse I've got a form which 
>returns an invalid process() but I cannot figure out which widget that is 
>causing this (all required fields are filled in, all datatypes are 
>correct, no red "!" are showing on the template file, ...)
>
>Regards,
>Gunter D'Hondt
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>  
>
-- 
Simone Gianni

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


CForms.process(formContext)

Posted by Gunter D'Hondt <gu...@sofico.be>.
Hi,

How can I check which validation error or widget that is triggering a 
"false" after the process()-method. This becourse I've got a form which 
returns an invalid process() but I cannot figure out which widget that is 
causing this (all required fields are filled in, all datatypes are 
correct, no red "!" are showing on the template file, ...)

Regards,
Gunter D'Hondt



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


Re: Tomcat5.5 and trailing slash on URL

Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 6 févr. 06, à 13:50, Gunter D'Hondt a écrit :

> ...we are both
> facing the same problem (so it's not related to my old cocoon version) 
> and
> it isn't related to the code (since Markus is using the cocoon samples)
> but we can both almost for sure say that it has something to do with 
> the
> core of Cocoon?..

I don't have time to help directly ATM, but here's a suggestion:

To locate the precise cause of the problem, the best would be IMHO to 
start tomcat with remote debugging active, connect with a Java debugger 
and set a breakpoint in the CocoonServlet.service(...) method.

You can then examine the HttpServletRequest object provided by tomcat 
and see how the path looks there.  If you're not comfortable with Java 
debuggers, you could also hack the CocoonServlet to add all kinds of 
System.err.println at the beginning of that method.

If (as I suspect) the path is already wrong there, having a precise 
diagnostic like that would allow you to ask the Tomcat guys if they 
know what could be causing the problem.

-Bertrand

Re: Tomcat5.5 and trailing slash on URL

Posted by Gunter D'Hondt <gu...@sofico.be>.
Markus,

Happy to hear that I'm not alone :-)
Isn't there a Cocoon dev expert who can help us out here coz we are both 
facing the same problem (so it's not related to my old cocoon version) and 
it isn't related to the code (since Markus is using the cocoon samples) 
but we can both almost for sure say that it has something to do with the 
core of Cocoon?

Any help is welcome,

Regards,
Gunter D'Hondt







Markus Vaterlaus <mv...@gmail.com> 
05/02/2006 19:46
Please respond to
users@cocoon.apache.org


To
users@cocoon.apache.org
cc

Subject
Re: Tomcat5.5 and trailing slash on URL






Hi Gunter,

I stumbled over the same problem this week. Till now, I don't have a
clue what's the reason for this behavior. I am using tomcat 5.0.28 and
cocoon 2.1.8 on Suse Linux. cocoon is quite stripped down (no samples
et al) but the root sitemap is almost left unchanged. I guess the
problem has to do with cocoon and the sitemap on the root level.
Although I did not have time to check this out in a profound manner.

Cheers,

--mv


On 2/3/06, Gunter D'Hondt <gu...@sofico.be> wrote:
> All,
>
> My Cocoon webapp works fine under Tomcat 4.x but now I'd like to deploy 
in
> under Tomcat5.5; it all works fine except that apparently Tomcat always
> adds an extra slash to the URL at the back; so if I type
>
> http://localhost:8080/cocoon/welcomepage
>
> it will enter the Cocoon sitemap with
>
> http://localhost:8080/cocoon/welcomepage/
>
> and ofcoz my pipeline matcher is "welcomepage"; has anybody else had 
this
> problem? I know I can fix it by changing the matcher to "welcomepage/" 
but
> then I'd have to change all my pipelines while I'd just want to use the
> URL that the user types in (maybe a configuration setting in Tomcat or
> something like that?)
>
> Any help is welcome,
>
> Gunter D'Hondt
>
> ---------------------------------------------------------------------
> 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: Tomcat5.5 and trailing slash on URL

Posted by Markus Vaterlaus <mv...@gmail.com>.
Hi Gunter,

I stumbled over the same problem this week. Till now, I don't have a
clue what's the reason for this behavior. I am using tomcat 5.0.28 and
cocoon 2.1.8 on Suse Linux. cocoon is quite stripped down (no samples
et al) but the root sitemap is almost left unchanged. I guess the
problem has to do with cocoon and the sitemap on the root level.
Although I did not have time to check this out in a profound manner.

Cheers,

--mv


On 2/3/06, Gunter D'Hondt <gu...@sofico.be> wrote:
> All,
>
> My Cocoon webapp works fine under Tomcat 4.x but now I'd like to deploy in
> under Tomcat5.5; it all works fine except that apparently Tomcat always
> adds an extra slash to the URL at the back; so if I type
>
> http://localhost:8080/cocoon/welcomepage
>
> it will enter the Cocoon sitemap with
>
> http://localhost:8080/cocoon/welcomepage/
>
> and ofcoz my pipeline matcher is "welcomepage"; has anybody else had this
> problem? I know I can fix it by changing the matcher to "welcomepage/" but
> then I'd have to change all my pipelines while I'd just want to use the
> URL that the user types in (maybe a configuration setting in Tomcat or
> something like that?)
>
> Any help is welcome,
>
> Gunter D'Hondt
>
> ---------------------------------------------------------------------
> 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