problem publishing web project into tomcat installation if output folder is WebContent/WEB-INF/class [message #489551] |
Sun, 04 October 2009 15:13  |
Eclipse User |
|
|
|
Hi all,
I have a problem publishing project directly to the tomcat installation.
Dev environment is Eclipse 3.5, WTP 3.1.1, and I use IVYDE (latest version
from trunk) to resolve dependencies.
I know it is somehow related to the IVYDE but I suspect it's also related
to the Tomcat publisher.
Tomcat server is configured so that deploy uses tomcat installation and deploy
path is ${TOMCAT_HOME}/webapps
This is a scenario that works:
Setup:
- create dynamic web project using vanilla WTP
- associate IVY configuration with the project (IVYDE contributes classpath
containers to the project)
- in "Java EE Module dependencies" select ivy container for export into
WEB-INF/lib
- resolve IVY libs
- clean project
- publish to tomcat
Result:
- jars put directly under ${PROJECT_NAME}/WEB-INF/lib are published into
${TOMCAT_HOME}/webapps/${PROJECT_NAME}/WEB-INF/libs
- jars resolved using IVY are located in ${TOMCAT_HOME}/webapps/${PROJECT_NAME}/WEB-INF/libs
This scenario doesn't work:
- now go to the "Project properties" -> "Java build path" and change Default
output folder from {PROJECT_NAME}/build/classes to {PROJECT_NAME}/WebContent/WEB-INF/classes
- resolve IVY libs
- clean project
- publish to tomcat
Result:
- jars put directly under ${PROJECT_NAME}/WEB-INF/lib are published into
${TOMCAT_HOME}/webapps/${PROJECT_NAME}/WEB-INF/libs
- jars resolved using IVY are NOT published into ${TOMCAT_HOME}/webapps/${PROJECT_NAME}/WEB-INF/libs
I was trying to revert to original setting but sometimes it works, sometimes
it doesn't work and I can't figure what's different. Files in the .settings
folder look just the same.
Export to the WAR file works just fine.
How does the publisher know that some classpath container has to be exported
to the WEB-INF/lib?
Is there a documentation for the WTP extension developers (like: how to add
custom classpath container such that WTP picks it up properly)?
P.S. I have tried to follow publishing process of WTP but it's too complicated
so I ask help from someone who understand it.
--
Ivica Loncar
|
|
|
|
|
|
Re: problem publishing web project into tomcat installation if outputfolderis WebContent/WEB-INF/cla [message #490379 is a reply to message #490125] |
Thu, 08 October 2009 09:52   |
Eclipse User |
|
|
|
Hello Larry,
> Ivica Loncar wrote:
>> If I reorder classpath containers in Java Build Path's such that
>> classpath container that should be exported to the WEB-INF (the one
>> marked under J2EE module dependencies) comes first I get all required
>> jars exported.
>>
>> If I reverse the ordering I do not get jars contained in bothe
>> classpath containers.
>>
>> I'm still trying to figure out if this is related to the IVYDE
>> classpath container or the way J2EE dependencies get exported to the
>> WEB-INF/lib.
>>
> Sounds like a bug, but where? Are you able to determine if the
> content of the classpath containers makes a difference, or just the
> order? If you can post the relevant portions of the ".classpath"
> file, I could try some experiments with some simple classpath
> container code I have.
>
This is .classpath entry where compile comes before runtime (#1):
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path=" org.eclipse.jst.server.core.container/org.eclipse.jst.server .tomcat.runtimeTarget/Apache
Tomcat v6.0">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path=" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.inte rnal.debug.ui.launcher.StandardVMType/jdk ">
<attributes>
<attribute name="owner.project.facets" value="jst.java"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path=" org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?ivyXml Path=ivy%2Fivy.xml&confs=compile "/>
<classpathentry exported="true" kind="con" path=" org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?ivyXml Path=ivy%2Fivy.xml&confs=runtime ">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="build/classes"/>
</classpath>
Contents of WEB-INF/lib in tomcat directory after publishing is:
aspectjrt-1.6.5.jar
aspectjweaver-1.6.5.jar
commons-pool-1.3.jar
easymock-2.5.1.jar
spring-aop-2.5.6.jar
spring-context-support-2.5.6.jar
spring-jms-2.5.6.jar
spring-web-2.5.6.jar
spring-webmvc-2.5.6.jar
(these are the jars that are resolved by the the runtime configuration but
not by the compile configuration).
and this is classpath entry where runtime comes before compile (#2):
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path=" org.eclipse.jst.server.core.container/org.eclipse.jst.server .tomcat.runtimeTarget/Apache
Tomcat v6.0">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path=" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.inte rnal.debug.ui.launcher.StandardVMType/jdk ">
<attributes>
<attribute name="owner.project.facets" value="jst.java"/>
</attributes>
</classpathentry>
<classpathentry exported="true" kind="con" path=" org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?ivyXml Path=ivy%2Fivy.xml&confs=runtime ">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path=" org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?ivyXml Path=ivy%2Fivy.xml&confs=compile "/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
Contents of WEB-INF/lib in tomcat directory after publishing is:
aopalliance-1.0.jar
aspectjrt-1.6.5.jar
aspectjweaver-1.6.5.jar
commons-fileupload-1.2.1.jar
commons-io-1.4.jar
commons-logging-1.1.1.jar
commons-pool-1.3.jar
dom4j-1.6.1.jar
easymock-2.5.1.jar
spring-aop-2.5.6.jar
spring-beans-2.5.6.jar
spring-context-2.5.6.jar
spring-context-support-2.5.6.jar
spring-core-2.5.6.jar
spring-jms-2.5.6.jar
spring-tx-2.5.6.jar
spring-web-2.5.6.jar
spring-webmvc-2.5.6.jar
(these are all of the jars resolved by the runtime configuration).
Here's the ivy.xml file I use in the "sample" project:
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info organisation="net.croz" module="IntegrationWeb" status="integration">
</info>
<configurations>
<conf name="default" />
<conf name="compile" />
<conf name="runtime" />
<conf name="test" />
<conf name="sources" />
</configurations>
<publications>
<artifact name="IntegrationWeb" type="war" ext="war"></artifact>
</publications>
<dependencies>
<dependency org="com.ibm.websphere.appserver" name="runtime" rev="6.1"
conf="compile->default" />
<!--
<dependency org="com.ibm.ws" name="j2ee" rev="6.1" conf="compile->default"
/>
-->
<dependency org="javax.jms" name="jms" rev="1.1" conf="compile->default"
/>
<dependency org="org.springframework" name="spring-aop" rev="2.5.6"
conf="runtime->default" />
<dependency org="org.springframework" name="spring-jms" rev="2.5.6"
conf="runtime->default" />
<dependency org="org.springframework" name="spring-web" rev="2.5.6"
conf="runtime->default" />
<dependency org="org.springframework" name="spring-webmvc" rev="2.5.6"
conf="runtime->default" />
<dependency org="org.aspectj" name="aspectjrt" rev="1.6.5" conf="runtime->default"
/>
<dependency org="org.aspectj" name="aspectjweaver" rev="1.6.5" conf="runtime->default"
/>
<dependency org="org.springframework" name="spring-context-support"
rev="2.5.6" conf="runtime->default" />
<dependency org="org.springframework" name="spring-test" rev="2.5.6"
conf="test->default" />
<dependency org="org.springframework" name="spring-jdbc" rev="2.5.6"
conf="test,compile->default" />
<dependency org="commons-fileupload" name="commons-fileupload" rev="1.2.1"
conf="test,compile,runtime->default" />
<dependency org="commons-io" name="commons-io" rev="1.4" conf="test,compile,runtime->default"
/>
<dependency org="dom4j" name="dom4j" rev="1.6.1" conf="test,compile,runtime->default"
/>
<dependency org="javax.servlet" name="jstl" rev="1.2" conf="compile->default"
/>
<dependency org="javax.servlet" name="jsp-api" rev="2.0" conf="compile->default"
/>
<exclude org="xml-apis" module="xml-apis" />
<override org="junit" module="junit" rev="4.5" />
<override org="org.slf4j" module="slf4j-api" rev="1.5.6" />
</dependencies>
</ivy-module>
Compile configuration will resolve to the following jars:
C:\Documents and Settings\iloncar\.ivy2\cache\aopalliance\aopalliance\jars\ao palliance-1.0.jar
C:\Documents and Settings\iloncar\.ivy2\cache\commons-logging\commons-logging \jars\commons-logging-1.1.1.jar
C:\Documents and Settings\iloncar\.ivy2\cache\org.springframework\spring-bean s\jars\spring-beans-2.5.6.jar
C:\Documents and Settings\iloncar\.ivy2\cache\org.springframework\spring-core \jars\spring-core-2.5.6.jar
C:\Documents and Settings\iloncar\.ivy2\cache\org.springframework\spring-cont ext\jars\spring-context-2.5.6.jar
C:\Documents and Settings\iloncar\.ivy2\cache\org.springframework\spring-tx\j ars\spring-tx-2.5.6.jar
C:\Documents and Settings\iloncar\.ivy2\cache\commons-fileupload\commons-file upload\jars\commons-fileupload-1.2.1.jar
C:\Documents and Settings\iloncar\.ivy2\cache\commons-io\commons-io\jars\comm ons-io-1.4.jar
C:\Documents and Settings\iloncar\.ivy2\cache\dom4j\dom4j\jars\dom4j-1.6.1.ja r
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\bootstrap\jars\boots trap-6.1.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\com.ibm.mq\jars\com. ibm.mq-6.1.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\com.ibm.mqjms\jars\c om.ibm.mqjms-6.1.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\com.ibm.ws.ejbportab le\jars\com.ibm.ws.ejbportable-6.1.0.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\com.ibm.ws.emf\jars\ com.ibm.ws.emf-2.1.0.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\com.ibm.ws.portletco ntainer\jars\com.ibm.ws.portletcontainer-2.0.0.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\com.ibm.ws.runtime.d ist\jars\com.ibm.ws.runtime.dist-6.1.0.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\com.ibm.ws.runtime\j ars\com.ibm.ws.runtime-6.1.0.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\com.ibm.ws.sib.serve r\jars\com.ibm.ws.sib.server-2.0.0.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\com.ibm.ws.sip.conta iner\jars\com.ibm.ws.sip.container-6.1.0.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\com.ibm.ws.wccm\jars \com.ibm.ws.wccm-6.1.0.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\com.ibm.ws.webcontai ner\jars\com.ibm.ws.webcontainer-2.0.0.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\dhbcore\jars\dhbcore -6.1.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\j2ee\jars\j2ee-6.1.j ar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\mail-impl\jars\mail- impl-6.1.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\marshall\jars\marsha ll-6.1.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\org.eclipse.emf.comm on\jars\org.eclipse.emf.common-2.2.1.v200609210005.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\org.eclipse.emf.comm onj.sdo\jars\org.eclipse.emf.commonj.sdo-2.1.0.v200609210005 .jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\org.eclipse.emf.ecor e.change\jars\org.eclipse.emf.ecore.change-2.2.0.v2006092100 05.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\org.eclipse.emf.ecor e.sdo\jars\org.eclipse.emf.ecore.sdo-2.2.0.v200609210005.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\org.eclipse.emf.ecor e.xmi\jars\org.eclipse.emf.ecore.xmi-2.2.1.v200609210005.jar
C:\Documents and Settings\iloncar\.ivy2\cache\com.ibm.ws\org.eclipse.emf.ecor e\jars\org.eclipse.emf.ecore-2.2.1.v200609210005.jar
C:\Documents and Settings\iloncar\.ivy2\cache\javax.jms\jms\jars\jms-1.1.jar
C:\Documents and Settings\iloncar\.ivy2\cache\org.springframework\spring-jdbc \jars\spring-jdbc-2.5.6.jar
C:\Documents and Settings\iloncar\.ivy2\cache\javax.servlet\jstl\jars\jstl-1. 2.jar
C:\Documents and Settings\iloncar\.ivy2\cache\javax.servlet\jsp-api\jars\jsp- api-2.0.jar
C:\Documents and Settings\iloncar\.ivy2\cache\javax.servlet\servlet-api\jars\ servlet-api-2.4.jar
Runtime configuration will resolve to the following jars:
C:\Documents and Settings\iloncar\.ivy2\cache\org.springframework\spring-aop\ jars\spring-aop-2.5.6.jar
C:\Documents and Settings\iloncar\.ivy2\cache\aopalliance\aopalliance\jars\ao palliance-1.0.jar
C:\Documents and Settings\iloncar\.ivy2\cache\commons-logging\commons-logging \jars\commons-logging-1.1.1.jar
C:\Documents and Settings\iloncar\.ivy2\cache\org.springframework\spring-bean s\jars\spring-beans-2.5.6.jar
C:\Documents and Settings\iloncar\.ivy2\cache\org.springframework\spring-core \jars\spring-core-2.5.6.jar
C:\Documents and Settings\iloncar\.ivy2\cache\org.springframework\spring-jms\ jars\spring-jms-2.5.6.jar
C:\Documents and Settings\iloncar\.ivy2\cache\commons-pool\commons-pool\jars\ commons-pool-1.3.jar
C:\Documents and Settings\iloncar\.ivy2\cache\org.springframework\spring-cont ext\jars\spring-context-2.5.6.jar
C:\Documents and Settings\iloncar\.ivy2\cache\org.springframework\spring-cont ext-support\jars\spring-context-support-2.5.6.jar
C:\Documents and Settings\iloncar\.ivy2\cache\org.springframework\spring-tx\j ars\spring-tx-2.5.6.jar
C:\Documents and Settings\iloncar\.ivy2\cache\org.springframework\spring-web\ jars\spring-web-2.5.6.jar
C:\Documents and Settings\iloncar\.ivy2\cache\org.springframework\spring-webm vc\jars\spring-webmvc-2.5.6.jar
C:\Documents and Settings\iloncar\.ivy2\cache\org.aspectj\aspectjrt\jars\aspe ctjrt-1.6.5.jar
C:\Documents and Settings\iloncar\.ivy2\cache\org.aspectj\aspectjweaver\jars\ aspectjweaver-1.6.5.jar
C:\Documents and Settings\iloncar\.ivy2\cache\commons-fileupload\commons-file upload\jars\commons-fileupload-1.2.1.jar
C:\Documents and Settings\iloncar\.ivy2\cache\commons-io\commons-io\jars\comm ons-io-1.4.jar
C:\Documents and Settings\iloncar\.ivy2\cache\dom4j\dom4j\jars\dom4j-1.6.1.ja r
--
Ivica Loncar
|
|
|
|
|
|
Re: problem publishing web project into tomcat installation if outputfolderisWebContent/WEB-INF/clas [message #490475 is a reply to message #490439] |
Thu, 08 October 2009 14:13  |
Eclipse User |
|
|
|
Hello Larry,
> If you have a jar appearing in two different classpath containers, one
> set for inclusion in WEB-INF/lib and the other set not to be included
> in WEB-INF/lib, I'm not sure what to expect? I'm don't know whether
> WTP includes handling to try to resolve this ambiguity that isn't
> working quite right, or doesn't include such handling. You could
> check there is already a bug for this and report a new one if not
> found. I would guess it would be found under WebTools -> WTP Java EE
> Tools -> jst.j2ee. Thanks for the investigative work.
Thank you for the help Larry.
I would expect WTP to export what user told it to export, or to give a warning
if someone finds it necessary (but not an error!).
Also, it's not obvious that ordering classpath containers in Java Build Path
has anything to do with Java EE Module Dependencies.
I have searched WTP bugs and I can't find something similar so I'm filling
a bug against WTP.
--
Ivica Loncar
|
|
|
Powered by
FUDForum. Page generated in 0.04721 seconds