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/22 15:47:26 UTC

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


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