You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ben Gidley <be...@gidley.co.uk> on 2008/05/25 09:34:05 UTC

t5 - Classloader issues with System classpath

Hi,
I tend to run my applications by creating a run main class in my IDE
(intellij) and let that start a Jetty instance. This has the nice benefit of
getting all the classes on the classpath without any hassles and allowing
easy debugging. This works fine for Tapestry 5 until I start referring to
libraries (e.g. SLF4J) that are loaded at the System level. The then start
to get class def not found.

e.g. My system class loader has
-> slf4j
-> tapestry5
-> etc

My start part works fine until I put a reference to SLF4J in it. At that
point it complains (when run via a main()  ) that is can't find slf4j.

Running the same code via mvn jetty:run the apps works fine.

It looks like the generated class doesn't have access to the system class
loader and can only see a subset of the classes. (SLF4J is definitely there
and working fine for Tapestry core classes).

Any ideas how I can work around this?

Re: t5 - Classloader issues with System classpath

Posted by Ben Gidley <be...@gidley.co.uk>.
no-probs I will move it shortly.

On Thu, May 29, 2008 at 4:24 AM, Richard Clark <rd...@gmail.com> wrote:

> Hi Ben,
>
> Would you consider moving that to its own page and linking from the
> "Tapestry 5 How Tos" page? Since this works with all IDEs, it probably
> deserves its own page.
>
> ...Richard (who has been organizing the How To page for clarity)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: t5 - Classloader issues with System classpath

Posted by Richard Clark <rd...@gmail.com>.
Hi Ben,

Would you consider moving that to its own page and linking from the
"Tapestry 5 How Tos" page? Since this works with all IDEs, it probably
deserves its own page.

...Richard (who has been organizing the How To page for clarity)

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


Re: t5 - Classloader issues with System classpath

Posted by Ben Gidley <be...@gidley.co.uk>.
Adam,
This did the trick - however looking into it a bit more this
could potentially have 'bad' side effects as it exposes too many classes to
the web app.

Setting the ServerClasses property for the currently deployment to exclude
slf4j (by default it includes it) fixes this. The reason is described at
http://docs.codehaus.org/display/JETTY/Classloading.

I have added a note to the Wiki regarding how to get this working
http://wiki.apache.org/tapestry/Tapestry5_Run_Jetty_From_IDEA using a run
class. (See option 3)

Thanks

Ben Gidley

On Sun, May 25, 2008 at 9:59 AM, adamh <ad...@azudio.co.uk> wrote:

>
> Hi Ben,
>
> I'm no classloader expert but I had a similar problem running with
> RunJettyRun, that might be related to your problem, but I think its a clash
> between the SLF4J in Jetty and the one in your app see
> http://wiki.apache.org/tapestry/Tapestry5HowToSetupEclipseRunJettyRun
>
> Regards,
> Adam.
> --
> View this message in context:
> http://www.nabble.com/t5---Classloader-issues-with-System-classpath-tp17455266p17455858.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: t5 - Classloader issues with System classpath

Posted by adamh <ad...@azudio.co.uk>.
Hi Ben,

I'm no classloader expert but I had a similar problem running with
RunJettyRun, that might be related to your problem, but I think its a clash
between the SLF4J in Jetty and the one in your app see
http://wiki.apache.org/tapestry/Tapestry5HowToSetupEclipseRunJettyRun

Regards,
Adam.
-- 
View this message in context: http://www.nabble.com/t5---Classloader-issues-with-System-classpath-tp17455266p17455858.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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