Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Problem in publishing with WST 3.0
Problem in publishing with WST 3.0 [message #217808] Fri, 18 July 2008 07:59 Go to next message
Eclipse UserFriend
Originally posted by: jarkko.miettinen.iki.fi

Hi!

I am having following problem with Eclipse Ganymede release (oh, and with
earlier versions too):
If I publish (that is, package the whole project to .war) my dynamic web
project, everything works fine but after I check the checkbox "Serve
modules without publishing" in server properties, I get errors on some
jsps.
The errors are always of same kind: some class was not found, e.g. in
webapps/equipment/jsp/AttributeStaticEdit.jsp DatatypeHelper cannot be
resolved even though the class resides within
/webapps/equipment/WEB-INF/classes and is imported correctly.
Everything works fine with publishing and in IDEA even without publishing
so what could be wrong?
Re: Problem in publishing with WST 3.0 [message #217846 is a reply to message #217808] Fri, 18 July 2008 13:23 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
The use of "Serve modules without publishing" implies the use of Tomcat.
Yet Tomcat, when publishing, never creates a WAR file. So it's not
clear what you mean by "If I publish (that is, package the whole project
to .war)". Also, by default, Tomcat publishes to the "wtpwebapps"
folder, deliberately avoiding publishing to "webapps" due to undesired
side effects that can occur if autoDeploy is enabled. Since you say the
files are in "/webapps/equipment/WEB-INF/classes", the "webapps" folder
is in use for some reason. Details about how your Tomcat server is
configured and details about your use case are needed to determine if
these are in alignment.

Cheers,
Larry

Jarkko Miettinen wrote:
> Hi!
>
> I am having following problem with Eclipse Ganymede release (oh, and
> with earlier versions too):
> If I publish (that is, package the whole project to .war) my dynamic web
> project, everything works fine but after I check the checkbox "Serve
> modules without publishing" in server properties, I get errors on some
> jsps.
> The errors are always of same kind: some class was not found, e.g. in
> webapps/equipment/jsp/AttributeStaticEdit.jsp DatatypeHelper cannot be
> resolved even though the class resides within
> /webapps/equipment/WEB-INF/classes and is imported correctly.
> Everything works fine with publishing and in IDEA even without
> publishing so what could be wrong?
>
Re: Problem in publishing with WST 3.0 [message #217854 is a reply to message #217846] Fri, 18 July 2008 20:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jarkko.miettinen.iki.fi

Larry Isaacs wrote:

> The use of "Serve modules without publishing" implies the use of Tomcat.
> Yet Tomcat, when publishing, never creates a WAR file. So it's not
> clear what you mean by "If I publish (that is, package the whole project
> to .war)". Also, by default, Tomcat publishes to the "wtpwebapps"
> folder, deliberately avoiding publishing to "webapps" due to undesired
> side effects that can occur if autoDeploy is enabled. Since you say the
> files are in "/webapps/equipment/WEB-INF/classes", the "webapps" folder
> is in use for some reason. Details about how your Tomcat server is
> configured and details about your use case are needed to determine if
> these are in alignment.

Okay, sorry about the confusion, I just presumed this WAR-thing for some
reason :). I am running tomcat 6.0.16 but I do not have the configs nor
the code at hand until next monday.
Re: Problem in publishing with WST 3.0 [message #218039 is a reply to message #217846] Wed, 23 July 2008 13:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jarkko.miettinen.iki.fi

Larry Isaacs wrote:

> The use of "Serve modules without publishing" implies the use of Tomcat.
> Yet Tomcat, when publishing, never creates a WAR file. So it's not
> clear what you mean by "If I publish (that is, package the whole project
> to .war)". Also, by default, Tomcat publishes to the "wtpwebapps"
> folder, deliberately avoiding publishing to "webapps" due to undesired
> side effects that can occur if autoDeploy is enabled. Since you say the
> files are in "/webapps/equipment/WEB-INF/classes", the "webapps" folder
> is in use for some reason. Details about how your Tomcat server is
> configured and details about your use case are needed to determine if
> these are in alignment.

> Cheers,
> Larry

So when running Tomcat with "Serve modules without publishing" unchecked,
files in projectroot/webapps/equipment are used. When checked,
Tomcat/plugin copies all the stuff to
workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp 0/wtpwebapps/project.
The latter way I do not get problems with jsps.
The project is created by checking things from svn using appropriate
wizard and then creating Dynamic Web Project from the stuff. All this is
done normally except that I change content directory from default
WebContent to webapps/equipment.

Except for this "Serve modules without publishing" setting, Tomcat 6.0.16
is running by default configuration.
Re: Problem in publishing with WST 3.0 [message #218053 is a reply to message #218039] Wed, 23 July 2008 14:07 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Jarkko Miettinen wrote:
> Larry Isaacs wrote:
>
>> The use of "Serve modules without publishing" implies the use of
>> Tomcat. Yet Tomcat, when publishing, never creates a WAR file. So
>> it's not clear what you mean by "If I publish (that is, package the
>> whole project to .war)". Also, by default, Tomcat publishes to the
>> "wtpwebapps" folder, deliberately avoiding publishing to "webapps" due
>> to undesired side effects that can occur if autoDeploy is enabled.
>> Since you say the files are in "/webapps/equipment/WEB-INF/classes",
>> the "webapps" folder is in use for some reason. Details about how
>> your Tomcat server is configured and details about your use case are
>> needed to determine if these are in alignment.
>
>> Cheers,
>> Larry
>
> So when running Tomcat with "Serve modules without publishing"
> unchecked, files in projectroot/webapps/equipment are used. When
> checked, Tomcat/plugin copies all the stuff to
> workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp 0/wtpwebapps/project.

That's backwards actually. The "Serve modules without publishing"
option, when checked, will cause your project's content to be served
directly from your workspace. When unchecked, they are copied to
"workspace/.metadata/.../tmp0/wtpwebapps/project" by default. Just to
be clear, the JSPs work when checked or unchecked?

Cheers,
Larry


> The latter way I do not get problems with jsps.
> The project is created by checking things from svn using appropriate
> wizard and then creating Dynamic Web Project from the stuff. All this is
> done normally except that I change content directory from default
> WebContent to webapps/equipment.
>
> Except for this "Serve modules without publishing" setting, Tomcat
> 6.0.16 is running by default configuration.
>
>
Re: Problem in publishing with WST 3.0 [message #218060 is a reply to message #218053] Wed, 23 July 2008 14:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jarkko.miettinen.iki.fi

Larry Isaacs wrote:

> Jarkko Miettinen wrote:
>> Larry Isaacs wrote:
>>
>>> The use of "Serve modules without publishing" implies the use of
>>> Tomcat. Yet Tomcat, when publishing, never creates a WAR file. So
>>> it's not clear what you mean by "If I publish (that is, package the
>>> whole project to .war)". Also, by default, Tomcat publishes to the
>>> "wtpwebapps" folder, deliberately avoiding publishing to "webapps" due
>>> to undesired side effects that can occur if autoDeploy is enabled.
>>> Since you say the files are in "/webapps/equipment/WEB-INF/classes",
>>> the "webapps" folder is in use for some reason. Details about how
>>> your Tomcat server is configured and details about your use case are
>>> needed to determine if these are in alignment.
>>
>>> Cheers,
>>> Larry
>>
>> So when running Tomcat with "Serve modules without publishing"
>> unchecked, files in projectroot/webapps/equipment are used. When
>> checked, Tomcat/plugin copies all the stuff to
>>
workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp 0/wtpwebapps/project.

> That's backwards actually. The "Serve modules without publishing"
> option, when checked, will cause your project's content to be served
> directly from your workspace. When unchecked, they are copied to
> "workspace/.metadata/.../tmp0/wtpwebapps/project" by default. Just to
> be clear, the JSPs work when checked or unchecked?

> Cheers,
> Larry

Gah, double-negative got me. When "Serve modules without publishing" is
UNCHECKED, that is, modules are published and copied to this
wtpwebapps-directory, everything works.
Re: Problem in publishing with WST 3.0 [message #218074 is a reply to message #218060] Wed, 23 July 2008 15:15 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Jarkko Miettinen wrote:
> Larry Isaacs wrote:
>
>> Jarkko Miettinen wrote:
>>> Larry Isaacs wrote:
>>>
>>>> The use of "Serve modules without publishing" implies the use of
>>>> Tomcat. Yet Tomcat, when publishing, never creates a WAR file. So
>>>> it's not clear what you mean by "If I publish (that is, package the
>>>> whole project to .war)". Also, by default, Tomcat publishes to the
>>>> "wtpwebapps" folder, deliberately avoiding publishing to "webapps"
>>>> due to undesired side effects that can occur if autoDeploy is
>>>> enabled. Since you say the files are in
>>>> "/webapps/equipment/WEB-INF/classes", the "webapps" folder is in use
>>>> for some reason. Details about how your Tomcat server is configured
>>>> and details about your use case are needed to determine if these are
>>>> in alignment.
>>>
>>>> Cheers,
>>>> Larry
>>>
>>> So when running Tomcat with "Serve modules without publishing"
>>> unchecked, files in projectroot/webapps/equipment are used. When
>>> checked, Tomcat/plugin copies all the stuff to
> workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp 0/wtpwebapps/project.
>
>
>> That's backwards actually. The "Serve modules without publishing"
>> option, when checked, will cause your project's content to be served
>> directly from your workspace. When unchecked, they are copied to
>> "workspace/.metadata/.../tmp0/wtpwebapps/project" by default. Just to
>> be clear, the JSPs work when checked or unchecked?
>
>> Cheers,
>> Larry
>
> Gah, double-negative got me. When "Serve modules without publishing" is
> UNCHECKED, that is, modules are published and copied to this
> wtpwebapps-directory, everything works.
>

Thanks. That was the answer I was hoping for. :)

The "Serve modules without publishing" option works by using a custom
context handler that overrides the context resource handling to make
"webapps/equipment" appear to be the location of the web content for the
webapp. It also creates a classloader for the context that includes the
output folder for all the Java source folders involved with the project,
dependent utility projects, and any jar dependencies. Thus, for this to
work with your classes, the Java source folder will need to be listed in
the ".settings/org.eclipse.wst.common.component" file, i.e. you would
see an entry like:

<wb-resource deploy-path="/WEB-INF/classes" source-path="/<your Java
source path>"/>

Internally, the output folder of the specified source-path is looked up
and used as the location of the class files.

I'm guessing that you may be directing the output of a Java source
folder directly to the "WEB-INF/classes" folder of your content folder
(i.e. "webapps/equipment/WEB-INF/classes"). If so, then I think that
might explain why "Serve modules without publishing" isn't working for
you. That source folder probably doesn't have a corresponding
<wb-resource> entry. Those classes would appear as "resources" for the
context but aren't being included in the classloader for the context, so
they aren't found. Does this guess appear relevant to your current
project structure?

Cheers,
Larry
Re: Problem in publishing with WST 3.0 [message #218210 is a reply to message #218074] Fri, 25 July 2008 11:15 Go to previous message
Eclipse UserFriend
Originally posted by: jarkko.miettinen.iki.fi

Larry Isaacs wrote:

> Thanks. That was the answer I was hoping for. :)

> The "Serve modules without publishing" option works by using a custom
> context handler that overrides the context resource handling to make
> "webapps/equipment" appear to be the location of the web content for the
> webapp. It also creates a classloader for the context that includes the
> output folder for all the Java source folders involved with the project,
> dependent utility projects, and any jar dependencies. Thus, for this to
> work with your classes, the Java source folder will need to be listed in
> the ".settings/org.eclipse.wst.common.component" file, i.e. you would
> see an entry like:

> <wb-resource deploy-path="/WEB-INF/classes" source-path="/<your Java
> source path>"/>

> Internally, the output folder of the specified source-path is looked up
> and used as the location of the class files.

> I'm guessing that you may be directing the output of a Java source
> folder directly to the "WEB-INF/classes" folder of your content folder
> (i.e. "webapps/equipment/WEB-INF/classes"). If so, then I think that
> might explain why "Serve modules without publishing" isn't working for
> you. That source folder probably doesn't have a corresponding
> <wb-resource> entry. Those classes would appear as "resources" for the
> context but aren't being included in the classloader for the context, so
> they aren't found. Does this guess appear relevant to your current
> project structure?

> Cheers,
> Larry


My org.eclipse.wst.common.component read:

<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="Handlers">
<wb-resource deploy-path="/" source-path="/webapps/equipment"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
<wb-resource deploy-path="/WEB-INF/classes"
source-path="/src/main"/>
<wb-resource deploy-path="/WEB-INF/classes"
source-path="/src/tests"/>
<property name="java-output-path"/>
<property name="context-root" value="Handlers"/>
</wb-module>
</project-modules>

A bit of explanation here: src-directory contains subdirectories external,
uitests, tests and main of which I am now using as source folders only
main and tests. Seems like this first source-path caused the problems
which is beliveable as the classes got then probably copied to a wrong
level in directory hierarchy.
So thank you for your help.
Previous Topic:404 /soap/servlet/rpcrouter when run web services explorer in Eclipse
Next Topic:404 error bug in Internal Web Browser
Goto Forum:
  


Current Time: Sat Apr 20 03:01:16 GMT 2024

Powered by FUDForum. Page generated in 0.02876 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top