Kalle,

I've figured out that it was the tapestry-test etc adding jetty etc to my classpath.

After looking into it, I have a simple way to make sure your 'devLoader' classpath is correct:

Method 1 - compare to target/[project]/WEB-INF/lib after a maven install
1. run maven install
2. browse to '[project]/target/[context]/WEB-INF/lib'
3. compare listed jars to '[project]/.tomcatplugin'
- there should be no jars referenced which are not in the lib dir
4. if there are extra libs in '.tomcatplugin' open project "properties>tomcat>devloader classpath" and disable them

Method 2 - exclusion, configuration then revert
1. open your pom.xml and comment out every dependency of a non-default scope (ie, servlet-api, tapestry-test, testng, tapestry-javadoc etc)
2. open project "properties>tomcat>devloader classpath"
3. click 'check all' then uncheck 'target/test-classes', all JRE libraries and maven classpath container, hit 'ok'.
4. undo your changes to the pom (step 1).

After following either of these methods, only the required libraries will be loaded via tomcat devloader.

I still 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 23/12/2011 7:24 PM, Kalle Korhonen wrote:
On Thu, Dec 22, 2011 at 11:51 PM, Paul Stanton<p...@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-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



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

Reply via email to