Previously when I tested my webapps, I manually deployed the wars to my local Tomcat instance. But, as per the above blog, I tried to add a portlet project via right-clicking the server and choosing "Add and Remove...". I was presented with the message "There are no resources that can be added or removed from the server."

What are valid resources that can be added? I have a portlet project that has been built via m2eclipse with a war artifact. Do I have to do something to the project so that the server can find the war? Am I supposed to be able to add the project?

sdoca wrote:
> Hi,
>
> I am using Eclipse 3.5 with Java EE and with m2eclipse. I also have
> Liferay 5.2.3 with Tomcat installed. I set up a server in Eclipse using
> the Tomcat instance in Liferay (as per
> http://www.jroller.com/holy/entry/developing_portlets_for_li feray_in).
> I can start/stop the server via Eclipse and access the Liferay portal
> via a web browser.
>
> Previously when I tested my webapps, I manually deployed the wars to my
> local Tomcat instance. But, as per the above blog, I tried to add a
> portlet project via right-clicking the server and choosing "Add and
> Remove...". I was presented with the message "There are no resources
> that can be added or removed from the server."
>
> What are valid resources that can be added? I have a portlet project
> that has been built via m2eclipse with a war artifact. Do I have to do
> something to the project so that the server can find the war? Am I
> supposed to be able to add the project?
>
> Thanks in advance!

To be added to a Tomcat server the project must contain the "Dynamic Web
Module" facet (see the Project Facets page in the project's Properties
dialog) and the version of the facet (which corresponds to the version
of the Servlet spec) must be compatible with the server. For example, a
project with a "Dynamic Web Module" facet with a version of "2.5" could
not be added to a Tomcat 5.5.x server because Tomcat 5.5.x doesn't
support version 2.5 of the Servlet spec. Tomcat 5.5.x only supports up
to 2.4. You could only add that project to a Tomcat 6.0.x server, which
does support Servlet 2.5 webapps. It's not clear whether your project
is missing the facet or has an incompatible version.

I set my project Targeted Runtime to my Liferay-Tomcatv5.5 server and when I choose Dynamic Web Module version 2.4 in Project Facets, I get an error message that Dynamic Web Module 2.4 requires Java 1.3 or newer.

My workspace/project is set to Java 1.6 and the Tomcat has JRE 1.5.0_17 in it. Any thoughts on why I'm getting this error?

sdoca wrote:
> Thanks for replying...
>
> I hadn't set up any Project Facets, in fact didn't know they existed.
> I set my project Targeted Runtime to my Liferay-Tomcatv5.5 server and
> when I choose Dynamic Web Module version 2.4 in Project Facets, I get an
> error message that Dynamic Web Module 2.4 requires Java 1.3 or newer.
>
> My workspace/project is set to Java 1.6 and the Tomcat has JRE 1.5.0_17
> in it. Any thoughts on why I'm getting this error?
>
> Thanks again!

The Dynamic Web Module facet requires that the Java facet be present as
well and that the Java facet version meet the minimum requirements of
the Dynamic Web Module version. However, the fact that your project
didn't already have the Dynamic Web Module facet may indicate that
adding it isn't the right think to do unless it is a brand new project.
The normal way is to create a Dynamic Web Project and the facet gets
added for you as part of the project creation. What is already in your
project? Are there other facets already present. That may help
determine if converting the project to a Dynamic Web Project at this
point makes the most sense.

sdoca wrote:
> It is a new project created using a Maven (m2eclipse) archetype. There
> are no facets checked off for it.

I know virtually nothing about with m2eclipse, but I would have expected
m2eclipse to either provide a way to create a web application type
project which included the appropriate facets or allow you to create a
Dynamic Web Project and then make it a maven type project. You could
try adding the Java and Dynamic Web Module facets to your project. I
would expect the project to be able to behave the same as a Dynamic Web
Project that wasn't "mavenized". I don't know if your project with the
added facets will yield a correctly built web application when built
using m2eclipse. If m2eclipse "understands" Dynamic Web Projects, then
it should work. If it doesn't, I'm not sure what you will get.

Sorry for delay in responding, but sometimes the obvious is hard to see. You said that the Java facet must also be checked and I didn't notice that item in the list of facets. If I choose both "Java" and "Dynamic Web Module" I am able to to apply the facets.