You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Paul Stanton <pa...@mapshed.com.au> on 2012/01/03 00:22:55 UTC

Re: development with eclipse+tomcat

I think I may have one outstanding issue with this configuration 
regarding classloaders...

         ComponentResources cr = container.getComponentResources();
         Component comp = cr.getEmbeddedComponent(zoneClientId);
         log.debug(Zone.class.getName() + " == " + 
comp.getClass().getName());
         log.debug(Zone.class.getClassLoader() + " == " + 
comp.getClass().getClassLoader());
         Zone zone = (Zone) comp; // <-- ClassCastException

Output:

DEBUG org.apache.tapestry5.corelib.components.Zone == 
org.apache.tapestry5.corelib.components.Zone
DEBUG WebappClassLoader
   context: /myapp
   delegate: false
   repositories:
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@63b660
  == org.apache.tapestry5.internal.plastic.PlasticClassLoader@6d1fa2
...
Caused by: java.lang.ClassCastException: 
org.apache.tapestry5.corelib.components.Zone cannot be cast to 
org.apache.tapestry5.corelib.components.Zone

So the object returned from ComponentResources.getEmbeddedComponent is 
from the tapestry classloader, while the Zone class is from the default 
classloader.

Is there a way to resolve this?

Thanks, p.

On 24/12/2011 8:37 PM, Paul Stanton wrote:
> I solved the problem ..
>
> it seems my changes to the 'tomcat' settings for the project were not 
> persisting or changing the ".tomcatplugin" file which was still 
> referencing the old maven dependencies...
>
> after simplifying the pom, deleting ".tomcatplugin" and re-applying 
> the settings in the "tomcat" settings page, I have it all working!!
>
> very nice, this will save me + team much time in the near future.
>
> thanks for the advice and all the best in the new year.
>
> cheers, Paul.
>
> On 24/12/2011 8:23 AM, Paul Stanton wrote:
>> Thanks Kalle,
>>
>> That document is great, much better than what I could find last time 
>> around.
>>
>> The only step which I had to go searching elsewhere to solve was 
>> finding where the "DevLoader" was!
>>
>> "7. Install devloader for Tomcat (for Tomcat 7.x use devloader from 
>> version 3.3). Unzip and copy the org folder and its contents to 
>> TOMCAT_HOME/lib"
>>
>> I figured out (google) that the devloader package is actually within 
>> the Sysdeo plugin (as a zip) and that you need to:
>> 1. extract Devloader.zip from the Sysdeo tomcat plugin archive
>> 2. rename Devloader.zip to Devloader.jar
>> 3. move Devloader.jar to tomcat/lib
>>
>> adding this to the document might save the next guy 15 minutes ;)
>>
>> Other than that, I think I am almost there, except I am getting then 
>> exception when tomcat starts:
>>
>> ClassCastException "org.apache.tapestry5.TapestryFilter cannot be 
>> cast to javax.servlet.Filter"
>>
>> .. as per the Troubleshooting section.
>>
>> I've commented out the 'servlet-api' dependency from my pom - as well 
>> as the 'jetty' stuff which is in there by default, however I the 
>> problem persists.
>>
>> I can see although I've run "maven install" and "maven clean" 
>> multiple times (and restarted eclipse etc) the "maven dependencies" 
>> still includes "servlet-api-2.5.jar", and "jetty-servlet-7.0.0...jar" 
>> - as well as other jetty jars and tomcat jars such as 
>> "servlet-api-6.0.30.jar" and "coyote-6.0.30.jar" (which I'm guessing 
>> were added when I tried out the maven tomcat plugin).
>>
>> I've also made sure all of these jars are unchecked within the 
>> devloader window, but the ClassCast problem persists...
>>
>> I have no idea why maven insists on including these jars when there 
>> is no remaining dependency.
>>
>> Any advice anyone?
>>
>> Thanks, Paul.
>>
>>
>>
>> On 23/12/2011 7:24 PM, Kalle Korhonen wrote:
>>> On Thu, Dec 22, 2011 at 11:51 PM, Paul Stanton<pa...@mapshed.com.au>  
>>> wrote:
>>>> For productivity, live class reloading, the ability to step through 
>>>> code and
>>>> being able to start and stop the container are all required.
>>>> We ended up compiling into "webapp/WEB-INF/classes" and copying all
>>>> dependencies into "webapp/WEB-INF/lib". This allowed us to achieve 
>>>> all of
>>>> the above, except for live class and template reloading.
>>> Without live class and template reloading, "all of the above" seems to
>>> leave you just debugging. You are missing most of it.
>>>
>>>> Are there any improvements in this space since Tapestry 5.1? Has 
>>>> anyone come
>>>> up with an easy to follow formula for configuring 
>>>> tapestry+tomcat+eclipse
>>>> for development?
>>> This page is up-to-date:
>>> http://tynamo.org/Developing+with+Tomcat+and+Eclipse. Many people have
>>> successfully followed the instructions on it to set their environment.
>>>
>>> Kalle
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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