struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emi Lu <em...@encs.concordia.ca>
Subject Re: "java.lang.NoClassDefFoundError: org/apache/struts2/util/ObjectFactoryDestroyable"
Date Tue, 18 May 2010 20:07:25 GMT

> You are doing a "hot deploy" of your full webapplication inside a
> Tomcat tree, without restarting it ? If that's the case, I'm not much
> surprised, hot deploys are rather fragile with respect to class
> loading issues in my experience. I restart Tomcat in each deploy.

All right. Solution is the following:
==========================================
. jdk1.6, tomcat6, Ant 1.8.1
. ANT deploy due to history reason
. Adding undeploy & deploy into build.xml file

<taskdef name="undeploy" 
classname="org.apache.catalina.ant.UndeployTask" />
    <target name="undeploy" description="Remove web application">
     <undeploy url="${tomcat_url}" username="${tomcat_username}" 
password="${tomcat_password}" path="${tomcat_path}" />
    </target>

<taskdef name="deploy"    classname="org.apache.catalina.ant.DeployTask" />
    <target name="deploy" description="Deploy web application">
     <deploy url="${tomcat_url}" username="${tomcat_username}" 
password="${tomcat_password}" path="${tomcat_path}" 
config="ta_hiring.xml" />
    </target>

Moreover, login in build.xml
. undeploy
. compile
. copy (from, to)
. permission
. deploy

Viola! Finally it works!

Thank you for all help!

--
Lu Ying







> On Mon, May 17, 2010 at 5:11 PM, Emi Lu<emilu@encs.concordia.ca>  wrote:
>> In my ant. build.xml file, I have classpath lib included shown as the
>> following:
>>
>>
>>    <path id="master-classpath">
>>                 <fileset dir="${libraries}">
>>                         <include name="*.jar"/>
>>                 </fileset>
>>                 <fileset dir="${j2ee-common}">
>>               <include name="**/*.jar"/>
>>             </fileset>
>>    </path>
>>    ####---. ${libraries} include struts-core.jar (webapp/WEB-INF/lib/)
>>
>>
>>         <target name="compile" depends="init">
>>       <echo>Compile the source files</echo>
>>            <javac srcdir="${source}" destdir="${webapp}/WEB-INF/classes">
>>               <classpath refid="master-classpath"/>
>>            </javac>
>>         </target>
>>
>> Still not find the solution why I have to re-start tomcat after I do ant
>> -property build.xml
>>
>> Thanks a lot!
>> --
>> Lu Ying
>>
>>
>>
>>
>>
>>> if your going to run your struts application (out of container) then you
>>> will need struts-core-<version>.jar on CLASSPATH e.g.
>>>
>>> <dependency>
>>> <groupId>org.easymock</groupId>
>>> <artifactId>easymock</artifactId>
>>> <version>2.0</version>
>>> <configuration>
>>> <source>1.5</source>
>>> <target>1.5</target>
>>>
>>> <compilerargument>classpath=$STRUTS2_HOME/core/target/struts2-core-2.1.8.jar;%CLASSPATH%</compilerargument>
>>> </configuration>
>>> <scope>test</scope>
>>> </dependency>
>>>
>>> Martin Gainty
>>> ______________________________________________
>>> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>>>
>>> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
>>> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede
>>> unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig.
>>> Diese Nachricht dient lediglich dem Austausch von Informationen und
>>> entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten
>>> Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt
>>> uebernehmen.
>>>
>>> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
>>> destinataire prévu, nous te demandons avec bonté que pour satisfaire
>>> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
>>> de ceci est interdite. Ce message sert à l'information seulement et n'aura
>>> pas n'importe quel effet légalement obligatoire. Étant donné que les email
>>> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
>>> aucune responsabilité pour le contenu fourni.
>>>
>>>
>>>
>>>
>>>
>>>
>>>   >  Date: Mon, 17 May 2010 14:50:47 -0400
>>>   >  From: emilu@encs.concordia.ca
>>>   >  To: mrcase@yahoo.com
>>>   >  CC: user@struts.apache.org; mgainty@hotmail.com
>>>   >  Subject: Re: "java.lang.NoClassDefFoundError:
>>> org/apache/struts2/util/ObjectFactoryDestroyable"
>>>   >
>>>   >  Hi Rebecca, Martin,
>>>   >
>>>   >  >  Could you be having something going crazy with your build scripts
>>> or something where the struts core jar isn't getting put in the right
>>> spot?
>>>   >
>>>   >
>>>   >  >>  check to see if struts2-core-<version>.jar is located
in
>>>   >  YourWebApp/WEB-INF/lib
>>>   >
>>>   >  Yes. it is there.
>>>   >
>>>   >  Tomcat 6.0, jdk1.6, ant-1.6.2.
>>>   >
>>>   >  If I restart tomcat, the error is gone.
>>>   >
>>>   >  The error is shown only when I re-install source codes and did not
>>>   >  reload tomcat.
>>>   >
>>>   >  Some possible places that I should pay special attention? I am using
>>> ant
>>>   >  1.6.2. Could this cause some potential problems? How come restart
>>>   >  tomcat, errors are gone?
>>>   >
>>>   >  Thanks a lot!
>>>   >  --
>>>   >  Lu Ying
>>>   >
>>>   >
>>>   >
>>>   >  >
>>>   >  >
>>>   >  >  ----- Original Message ----
>>>   >  >  From: Emi Lu<emilu@encs.concordia.ca>
>>>   >  >  To: user@struts.apache.org
>>>   >  >  Sent: Mon, May 17, 2010 10:48:38 AM
>>>   >  >  Subject: "java.lang.NoClassDefFoundError:
>>> org/apache/struts2/util/ObjectFactoryDestroyable"
>>>   >  >
>>>   >  >  Good morning List,
>>>   >  >
>>>   >  >  Using struts2.1.8.1, when I reinstall my application, I always
got
>>> the following errors "java.lang.NoClassDefFoundError:
>>> org/apache/struts2/util/ObjectFactoryDestroyable"
>>>   >  >
>>>   >  >  But in struts.jar does contain this class.
>>>   >  >
>>>   >  >  Could someone help and tell me what cause the problem?
>>>   >  >
>>>   >  >  Thanks a lot
>>>   >  >  --
>>>   >  >  Lu Ying
>>>   >  >
>>>   >  >
>>>   >  >
>>>   >  >
>>>   >  >  SEVERE: Exception invoking periodic operation:
>>>   >  >  java.lang.NoClassDefFoundError:
>>> org/apache/struts2/util/ObjectFactoryDestroyable
>>>   >  >  at
>>> org.apache.struts2.dispatcher.Dispatcher.cleanup(Dispatcher.java:265)
>>>   >  >  at
>>>
>>> org.apache.struts2.dispatcher.FilterDispatcher.destroy(FilterDispatcher.java:233)
>>>   >  >  at
>>>
>>> org.apache.catalina.core.ApplicationFilterConfig.release(ApplicationFilterConfig.java:357)
>>>   >  >  at
>>>
>>> org.apache.catalina.core.StandardContext.filterStop(StandardContext.java:3873)
>>>   >  >  at
>>> org.apache.catalina.core.StandardContext.stop(StandardContext.java:4605)
>>>   >  >  at
>>> org.apache.catalina.core.StandardContext.reload(StandardContext.java:3222)
>>>   >  >  at
>>>
>>> org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:403)
>>>   >  >  at
>>>
>>> org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1309)
>>>   >  >  at
>>>
>>> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
>>>   >  >  at
>>>
>>> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
>>>   >  >  at
>>>
>>> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
>>>   >  >  at
>>>
>>> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
>>>   >  >  at java.lang.Thread.run(Thread.java:619)
>>>   >  >
>>>   >  >  ---------------------------------------------------------------------
>>>   >  >  To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>   >  >  For additional commands, e-mail: user-help@struts.apache.org
>>>   >  >
>>>   >  >
>>>   >  >
>>>   >
>>>
>>> ------------------------------------------------------------------------
>>> The New Busy think 9 to 5 is a cute idea. Combine multiple calendars
>>> with Hotmail. Get busy.
>>>
>>> <http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message