Applet class loading problem again in embedded jetty

60 views
Skip to first unread message

Fei

unread,
Apr 15, 2008, 3:38:17 AM4/15/08
to informative-workspace-discuss
Now after I switched to use the embedded jetty, it is a lot faster in
terms of developing the wicket interface stuff. However, I encountered
the same old problem of loading up the applet in the page again.

Right now the jetty server starts as an application (the main method),
it enables me to access my webapp in http://localhost:8080/projectoverviewer.

The problem with this embedded mode of server running is, I have no
idea how the internal class files are structured. Therefore when the
applet try to locate the .class file that contains the actual applet
(JTreeMapApp.class), it is looking for it from
http://localhost:8080/<code>/<the-package>/JTreeMap.class. (according
to the Java console)

The <code> is whatever specified by the code attribute in the applet
tag, and <the-package> is the package contains the applet. Since I
don't know what the internal classes structure is, I can't really
specified where to look for the correct .class for the applet. While I
was using tomcat, I create my own classes structures in the war file
and deploy that, but in this embedded jetty mode, I don't even have
the war file.

So any suggestion on solving this problem?

Jianfei Liao

unread,
Apr 15, 2008, 4:35:53 AM4/15/08
to informative-workspace-discuss
I notice there is a war target in the build.xml (but it needs some small fix to run), and the WebAppContext class has a addWebApplications method, I wonder would this be one possible direction to go for solving the problem.

Fei

unread,
Apr 17, 2008, 10:07:10 PM4/17/08
to informative-workspace-discuss
I think I finally found the work-around for this. (at least it works
well so far)

I created a war target that would make a "war" folder that has
everything I need for jaring the actual war file that can be deployed
in tomcat or jetty, it also creates a "embedded-webapp" folder that is
used for embedded jetty deployment for eclipse. Turned out the
setWar() method of WebAppContext class is where it looks for the
files, but it's only my guess since there is no detailed documentation
on this method.

The only difference between this two folders is the wicket-
{version}.jar file in the WEB-INF/lib directory, I still don't know
why having that file would cause embedded jetty deployment to throw
slf4j class not found exception, and missing of that file in war file
deployment would cause WicketFilter class not found exception.

So now to deploy the webapp from eclipse, a "ant war" command is
needed for renewing the "embedded-webapp" folder. I'm thinking some
tweaking of eclipse output folder and project directories setup could
eliminate that, but I can live with that 1 extra ant task for now.

Also an important note, to reflect the change in the applet, a restart
of the browser is required. I'm guessing the applet has something to
do with the browser caching. But this isn't really a big deal.

On Apr 14, 10:35 pm, "Jianfei Liao" <jianfeil...@gmail.com> wrote:
> I notice there is a war target in the build.xml (but it needs some small fix
> to run), and the WebAppContext class has a addWebApplications method, I
> wonder would this be one possible direction to go for solving the problem.
>
Reply all
Reply to author
Forward
0 new messages