You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Shantanu Deo <sh...@elixir-it.com> on 2003/05/01 01:09:24 UTC

BindingException in Component

Hi,
  I have the foll. component specification, which is used in an enclosing
page which passes it a parameter.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE component-specification
PUBLIC "-//Apache Software Foundation//Tapestry Specification 1.4//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_1_4.dtd">
<!-- generated by Spindle, http://spindle.sourceforge.net -->

<component-specification
class="com.apollo.pages.components.RegistrationComponent">
    <parameter name="professional" type="com.apollo.model.user.Professional"
required = "yes" />

    <component id="firstName" type="TextField">
        <binding name="value" expression="professional.firstName"/>
    </component>

    <component id="lastName" type="TextField">
        <binding name="value" expression="professional.lastName"/>
    </component>

    <more-stuff>
</component-specification>


and when I run the application, I get the following exception

----------------------------------------
org.apache.tapestry.BindingException
Unable to resolve expression 'professional.lastName' for
com.apollo.pages.components.RegistrationComponent$Enhance_47@352598[Professi
onalRegister/phyRegisterPage].
location:classpath:/com/apollo/pages/components/RegistrationComponent.jwc,
line 20
binding:ExpressionBinding[ProfessionalRegister/phyRegisterPage
professional.lastName]

ognl.OgnlException
source is null for getProperty(null, "lastName")

Stack Trace:
ognl.OgnlRuntime.getProperty(OgnlRuntime.java)
--------------------------------------------

Since it works perfectly fine for the "firstName", (and I have a lastName
property) can anyone point me to
my error here ?



RE: Be careful with digester...class loading could stuff up...

Posted by Eric Everman <ev...@precedadesign.com>.
I started using the Sysdeo plugin's devloader option for development and it 
made all my classpath problems go away.  The devloader allows you to 
specify which jar files to include on a per-context basis.

I've generally found Tomcat's classloader structure to be reliable *if* 
files are places as jars in the lib directory - even if duplicate classes 
are in the common directory.

Eric Everman

At 5/1/2003, you wrote:
>The classloader structure for Tomcat is supposed to avoid this problem, if
>you package the digester JAR in WEB-INF/lib.
>
>Also, Tapestry uses Digester's option for setting the classloader to use;
>makes it use the Thread's contextClassLoader which Tomcat does set up
>properly to be a classloader with a view of the WAR's classes (in
>WEB-INF/lib and WEB-INF/classes).
>
>I haven't experimented with the plugin, though.  That just complicates
>things further.
>
>--
>Howard M. Lewis Ship
>Creator, Tapestry: Java Web Components
>http://jakarta.apache.org/tapestry
>
>
>
> > -----Original Message-----
> > From: Sathish Senathi [mailto:sathishs@optusnet.com.au]
> > Sent: Thursday, May 01, 2003 6:11 AM
> > To: Tapestry users
> > Subject: Be careful with digester...class loading could stuff up...
> >
> >
> > As you might have seen from my previous 2 e-mails, i am stuck
> > with Tapestry 2.4 & Tomcat 4.1 using Eclipse IDE.
> >
> > Finally i have located the problem , and the problem is
> > arguably with Digester. The Digester code loads the classes
> > using the  statement
> >
> > digester.getClassLoader().LoadClass().
> >
> > Now in my case , the Digester is in the classpath and i
> > launch tomcat , which internally creates its own classloader
> > to load its sever (catalina..) classes. Since we have
> > digester in the classpath , when tomcat parses its
> > configuration using Digester it couldn't find the Catalina
> > classes since Digester is loaded with SystemClassLoader,
> > rather than classloader created by Tomcat for its server libraries.
> >
> > Looks like we have to be careful with how we use Digester
> > especially when multiple class loaders are created (and most
> > application servers do). I think i read in Tomcat 5.1 they
> > are changing the behaviour i guess to deal with these issues.
> >
> > I thought the good design for Digester would be to take the
> > classloader in the constructor..I dont know why they didn't
> > to it..hmm.. I guess i should ramble this in Digester Forum..
> >
> > Wonder why nobody faced this problem so far..  I guess i
> > didn't search enough.
> >
> > Now i have to add all the tomcat server jar files to
> > classpath i guess to work-around the problem..stinks!! -sathish
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Be careful with digester...class loading could stuff up...

Posted by Sathish Senathi <sa...@optusnet.com.au>.
It works fine with WAR structure with WEB-INF/lib having all the required
tapestry jar files. But i try to debug using eclipse with Tomcat Plugin
which sets up all the tapestry jar in the classpath before launching Tomcat.
I really like the option of debugging the code using Eclipse ide.

It looks like Tomcat Code doesn't set Digester to use ContextLoader or
doesn't set ClassLoader in Digester, which makes Digester to load the class
using its loader which in my case is the system class loader which dont have
access to Catalina jars...

Glad to hear that tapestry atleast setting the Digester to
ContextClassLoader.

I am looking to patch Tomcat so that it sets its classloader into Digester.
-sathish

----- Original Message -----
From: "Howard M. Lewis Ship" <hl...@attbi.com>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Thursday, May 01, 2003 10:08 PM
Subject: RE: Be careful with digester...class loading could stuff up...


> The classloader structure for Tomcat is supposed to avoid this problem, if
> you package the digester JAR in WEB-INF/lib.
>
> Also, Tapestry uses Digester's option for setting the classloader to use;
> makes it use the Thread's contextClassLoader which Tomcat does set up
> properly to be a classloader with a view of the WAR's classes (in
> WEB-INF/lib and WEB-INF/classes).
>
> I haven't experimented with the plugin, though.  That just complicates
> things further.
>
> --
> Howard M. Lewis Ship
> Creator, Tapestry: Java Web Components
> http://jakarta.apache.org/tapestry
>
>
>
> > -----Original Message-----
> > From: Sathish Senathi [mailto:sathishs@optusnet.com.au]
> > Sent: Thursday, May 01, 2003 6:11 AM
> > To: Tapestry users
> > Subject: Be careful with digester...class loading could stuff up...
> >
> >
> > As you might have seen from my previous 2 e-mails, i am stuck
> > with Tapestry 2.4 & Tomcat 4.1 using Eclipse IDE.
> >
> > Finally i have located the problem , and the problem is
> > arguably with Digester. The Digester code loads the classes
> > using the  statement
> >
> > digester.getClassLoader().LoadClass().
> >
> > Now in my case , the Digester is in the classpath and i
> > launch tomcat , which internally creates its own classloader
> > to load its sever (catalina..) classes. Since we have
> > digester in the classpath , when tomcat parses its
> > configuration using Digester it couldn't find the Catalina
> > classes since Digester is loaded with SystemClassLoader,
> > rather than classloader created by Tomcat for its server libraries.
> >
> > Looks like we have to be careful with how we use Digester
> > especially when multiple class loaders are created (and most
> > application servers do). I think i read in Tomcat 5.1 they
> > are changing the behaviour i guess to deal with these issues.
> >
> > I thought the good design for Digester would be to take the
> > classloader in the constructor..I dont know why they didn't
> > to it..hmm.. I guess i should ramble this in Digester Forum..
> >
> > Wonder why nobody faced this problem so far..  I guess i
> > didn't search enough.
> >
> > Now i have to add all the tomcat server jar files to
> > classpath i guess to work-around the problem..stinks!! -sathish
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


RE: Be careful with digester...class loading could stuff up...

Posted by "Howard M. Lewis Ship" <hl...@attbi.com>.
The classloader structure for Tomcat is supposed to avoid this problem, if
you package the digester JAR in WEB-INF/lib.

Also, Tapestry uses Digester's option for setting the classloader to use;
makes it use the Thread's contextClassLoader which Tomcat does set up
properly to be a classloader with a view of the WAR's classes (in
WEB-INF/lib and WEB-INF/classes).

I haven't experimented with the plugin, though.  That just complicates
things further.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



> -----Original Message-----
> From: Sathish Senathi [mailto:sathishs@optusnet.com.au] 
> Sent: Thursday, May 01, 2003 6:11 AM
> To: Tapestry users
> Subject: Be careful with digester...class loading could stuff up...
> 
> 
> As you might have seen from my previous 2 e-mails, i am stuck 
> with Tapestry 2.4 & Tomcat 4.1 using Eclipse IDE.
> 
> Finally i have located the problem , and the problem is 
> arguably with Digester. The Digester code loads the classes 
> using the  statement
> 
> digester.getClassLoader().LoadClass().
> 
> Now in my case , the Digester is in the classpath and i 
> launch tomcat , which internally creates its own classloader 
> to load its sever (catalina..) classes. Since we have 
> digester in the classpath , when tomcat parses its 
> configuration using Digester it couldn't find the Catalina 
> classes since Digester is loaded with SystemClassLoader, 
> rather than classloader created by Tomcat for its server libraries.
> 
> Looks like we have to be careful with how we use Digester 
> especially when multiple class loaders are created (and most 
> application servers do). I think i read in Tomcat 5.1 they 
> are changing the behaviour i guess to deal with these issues.
> 
> I thought the good design for Digester would be to take the 
> classloader in the constructor..I dont know why they didn't 
> to it..hmm.. I guess i should ramble this in Digester Forum..
> 
> Wonder why nobody faced this problem so far..  I guess i 
> didn't search enough.
> 
> Now i have to add all the tomcat server jar files to 
> classpath i guess to work-around the problem..stinks!! -sathish
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


Be careful with digester...class loading could stuff up...

Posted by Sathish Senathi <sa...@optusnet.com.au>.
As you might have seen from my previous 2 e-mails, i am stuck with Tapestry
2.4 & Tomcat 4.1 using Eclipse IDE.

Finally i have located the problem , and the problem is arguably with
Digester. The Digester code loads the classes using the  statement

digester.getClassLoader().LoadClass().

Now in my case , the Digester is in the classpath and i launch tomcat ,
which internally creates its own classloader to load its sever (catalina..)
classes. Since we have digester in the classpath , when tomcat parses its
configuration using Digester it couldn't find the Catalina classes since
Digester is loaded with SystemClassLoader, rather than classloader created
by Tomcat for its server libraries.

Looks like we have to be careful with how we use Digester especially when
multiple class loaders are created (and most application servers do). I
think i read in Tomcat 5.1 they are changing the behaviour i guess to deal
with these issues.

I thought the good design for Digester would be to take the classloader in
the constructor..I dont know why they didn't to it..hmm.. I guess i should
ramble this in Digester Forum..

Wonder why nobody faced this problem so far..  I guess i didn't search
enough.

Now i have to add all the tomcat server jar files to classpath i guess to
work-around the problem..stinks!!
-sathish




Re: Problem with Tomcat 4.1.x & Tapestry with Eclipse Plugin for Tomcat

Posted by Sathish Senathi <sa...@optusnet.com.au>.
The whole March thread is missing in the archive. Do you remember the
solution ?. Is there any patch of Tomcat you know of ?

-sathish

----- Original Message -----
From: "F.R. Da Costa Gomez" <dc...@fixed.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Thursday, May 01, 2003 8:36 PM
Subject: Re: Problem with Tomcat 4.1.x & Tapestry with Eclipse Plugin for
Tomcat


> Hi,
>
> I had the same problem you are describing.
> Have a look at thread: Tomcat & 2.4-a5 (started on 28-3-2003)
>
> GL,
>
> Fermin DCG
>
> Sathish Senathi wrote:
>
> >I am trying to use Tapestry 2.4 alpha 5 with Tomcat + Eclipse IDE and
there
> >seems to be conflict with Commons Digester package, if i remove the
Digester
> >package shipped with Tapestry then Tomcat starts properly but the
Tapestry
> >application fails with Class not found exception. If i add the digester
then
> >Tomcat fails with some weird error like could not find the class
> >catalina.server ..
> >
> >Anybody faced this issue ?. I am using Eclispe with Tomcat Plugin and
> >starting Tomcat from Eclipse IDE
> >
> >This setup worked fine with Tomcat 2.3 RC 1 without any problem.
> >
> >Thanks
> >sathish
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> >
> >
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


Re: Problem with Tomcat 4.1.x & Tapestry with Eclipse Plugin for Tomcat

Posted by "F.R. Da Costa Gomez" <dc...@fixed.com>.
Hi,

I had the same problem you are describing.
Have a look at thread: Tomcat & 2.4-a5 (started on 28-3-2003)

GL,

Fermin DCG

Sathish Senathi wrote:

>I am trying to use Tapestry 2.4 alpha 5 with Tomcat + Eclipse IDE and there
>seems to be conflict with Commons Digester package, if i remove the Digester
>package shipped with Tapestry then Tomcat starts properly but the Tapestry
>application fails with Class not found exception. If i add the digester then
>Tomcat fails with some weird error like could not find the class
>catalina.server ..
>
>Anybody faced this issue ?. I am using Eclispe with Tomcat Plugin and
>starting Tomcat from Eclipse IDE
>
>This setup worked fine with Tomcat 2.3 RC 1 without any problem.
>
>Thanks
>sathish
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>
>  
>



Re: Problem with Tomcat 4.1.x & Tapestry with Eclipse Plugin for Tomcat

Posted by Sathish Senathi <sa...@optusnet.com.au>.
I mean it worked fine with Tapestry 2.3 with Tomcat 4.1, but failes with
Tapestry 2.4 with Tomcat 4.1. I think the issue seems to be that with Tomcat
Plugin for Eclipse and i add the classpath of the project to Tomcat which
makes Tomcat to use the Digester supplied by the Tapestry which is causing
the problem for Tomcat. If i remove the digester from the classpath , then
Tomcat starts fine but Tapestry fails with class not found exception.

I added the digester under WEB-INF/lib , but still the tapestry complains
class not found exception. Again i am using Tomcat Plugin for Eclipse and
starting tomcat from Eclipse IDE.

-sathish

----- Original Message -----
From: "Sathish Senathi" <sa...@optusnet.com.au>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Thursday, May 01, 2003 12:43 PM
Subject: Problem with Tomcat 4.1.x & Tapestry with Eclipse Plugin for Tomcat


> I am trying to use Tapestry 2.4 alpha 5 with Tomcat + Eclipse IDE and
there
> seems to be conflict with Commons Digester package, if i remove the
Digester
> package shipped with Tapestry then Tomcat starts properly but the Tapestry
> application fails with Class not found exception. If i add the digester
then
> Tomcat fails with some weird error like could not find the class
> catalina.server ..
>
> Anybody faced this issue ?. I am using Eclispe with Tomcat Plugin and
> starting Tomcat from Eclipse IDE
>
> This setup worked fine with Tomcat 2.3 RC 1 without any problem.
>
> Thanks
> sathish
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


Problem with Tomcat 4.1.x & Tapestry with Eclipse Plugin for Tomcat

Posted by Sathish Senathi <sa...@optusnet.com.au>.
I am trying to use Tapestry 2.4 alpha 5 with Tomcat + Eclipse IDE and there
seems to be conflict with Commons Digester package, if i remove the Digester
package shipped with Tapestry then Tomcat starts properly but the Tapestry
application fails with Class not found exception. If i add the digester then
Tomcat fails with some weird error like could not find the class
catalina.server ..

Anybody faced this issue ?. I am using Eclispe with Tomcat Plugin and
starting Tomcat from Eclipse IDE

This setup worked fine with Tomcat 2.3 RC 1 without any problem.

Thanks
sathish



RE: BindingException in Component

Posted by "Howard M. Lewis Ship" <hl...@attbi.com>.
Could something be setting your professional property to null inbetween the
two text fields?

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



> -----Original Message-----
> From: Shantanu Deo [mailto:shantanu@elixir-it.com] 
> Sent: Wednesday, April 30, 2003 7:09 PM
> To: Tapestry users
> Subject: BindingException in Component
> 
> 
> Hi,
>   I have the foll. component specification, which is used in 
> an enclosing page which passes it a parameter.
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE component-specification
> PUBLIC "-//Apache Software Foundation//Tapestry Specification 
> 1.4//EN" "http://jakarta.apache.org/tapestry/dtd/Tapestry_1_4.dtd">
> <!-- generated by Spindle, http://spindle.sourceforge.net -->
> 
> <component-specification 
> class="com.apollo.pages.components.RegistrationComponent">
>     <parameter name="professional" 
> type="com.apollo.model.user.Professional"
> required = "yes" />
> 
>     <component id="firstName" type="TextField">
>         <binding name="value" expression="professional.firstName"/>
>     </component>
> 
>     <component id="lastName" type="TextField">
>         <binding name="value" expression="professional.lastName"/>
>     </component>
> 
>     <more-stuff>
> </component-specification>
> 
> 
> and when I run the application, I get the following exception
> 
> ----------------------------------------
> org.apache.tapestry.BindingException
> Unable to resolve expression 'professional.lastName' for 
> com.apollo.pages.components.RegistrationComponent$Enhance_47@3
> 52598[Professi
> onalRegister/phyRegisterPage]. 
> location:classpath:/com/apollo/pages/components/RegistrationCo
> mponent.jwc,
> line 20 binding:ExpressionBinding[ProfessionalRegister/phyRegisterPage
> professional.lastName]
> 
> ognl.OgnlException
> source is null for getProperty(null, "lastName")
> 
> Stack Trace:
> ognl.OgnlRuntime.getProperty(OgnlRuntime.java)
> --------------------------------------------
> 
> Since it works perfectly fine for the "firstName", (and I 
> have a lastName
> property) can anyone point me to
> my error here ?
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>