Re: Clicking helloworld link got java.lang.NoSuchMethodError: org.apache.commons.lang3.reflect.MethodUtils.getAnnotation

2017-09-06 Thread Christoph Nenning
> 
> I tried
> export
> CLASSPATH=$JAVA_HOME/lib:$HOME/Struts2/struts-2.5.12/lib:
> $CATALINA_HOME/lib:$CLASSPATH:.
> 
> but the helloworld link in index.jsp still did not see the
> /home/alkao/Struts2/struts-2.5.12/lib/commons-lang3-3.6.jar.
> 
> 
> my_tomcat.log did not have this line any more
> [Loaded org.apache.commons.lang3.reflect.MethodUtils from
> 
file:/home/alkao/tomee/apache-tomee-plus-7.0.3/lib/commons-lang3-3.5.jar]
> 
> 
> It had lines such as:
> [Loaded org.apache.commons.lang3.text.StrLookup from
> 
file:/home/alkao/tomee/apache-tomee-plus-7.0.3/lib/commons-lang3-3.5.jar]
> [Loaded org.apache.commons.lang3.CharSequenceUtils from
> 
file:/home/alkao/tomee/apache-tomee-plus-7.0.3/lib/commons-lang3-3.5.jar]
> ...
> 


Hi,

this still indicates that an old version of commons-lang3 is loaded from 
tomee dir.

Another, but hacky, solution would be to remove that file from tomee and 
place commons-lang3-3.6.jar in tommees lib folder.


Regards,
Christoph


> 
> On Mon, Sep 4, 2017 at 1:30 PM, Yasser Zamani 
> wrote:
> 
> > >> Although I had done the following:
> > >> export
> > >> CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$HOME/Struts2/struts-
> > 2.5.12/lib:$CATALINA_HOME/lib:.
> >
> > If you would like to solve it like above, I think you may try below
> > instead ($CLASSPATH at end):
> >
> > export
> > CLASSPATH=$JAVA_HOME/lib:$HOME/Struts2/struts-2.5.12/
> > lib:$CATALINA_HOME/lib:.:$CLASSPATH
> >
> > On 9/4/2017 5:24 PM, albert kao wrote:
> > > As per your instruction, modify catalina.sh:
> > > JAVA_OPTS="$JAVA_OPTS
> > > -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
> > > -XX:+TraceClassLoading -XX:+TraceClassUnloading"
> > >
> > > $ catalina.sh run > my_tomcat.log 2>&1
> > >
> > > my_tomcat.log:
> > > [Loaded org.apache.commons.lang3.reflect.MethodUtils from
> > > file:/home/alkao/tomee/apache-tomee-plus-7.0.3/lib/commons-
> > lang3-3.5.jar]
> > >
> > > Although I had done the following:
> > > export
> > > CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$HOME/Struts2/struts-
> > 2.5.12/lib:$CATALINA_HOME/lib:.
> > >
> > > $ ls /home/alkao/Struts2/struts-2.5.12/lib/commons-lang3*
> > > /home/alkao/Struts2/struts-2.5.12/lib/commons-lang3-3.6.jar
> > >
> > > Therefore the helloworld link in index.jsp did not see the
> > > /home/alkao/Struts2/struts-2.5.12/lib/commons-lang3-3.6.jar.
> > >
> > >
> > > On Sat, Sep 2, 2017 at 2:46 PM, Yasser Zamani 

> > > wrote:
> > >
> > >> I did as you said and did not get any exception!
> > >>
> > >> Could you please add following line to catalina.bat:
> > >>
> > >> set "JAVA_OPTS=-XX:+TraceClassLoading -XX:+TraceClassUnloading"
> > >>
> > >> then:
> > >>
> > >> catalina.bat run > my_tomcat.log 2>&1
> > >>
> > >> then finally search my_tomcat.log for MethodUtils?
> > >>
> > >> I would like to see from where your tomcat load MethodUtils class!
> > >>
> > >>
> > >> On 9/2/2017 7:06 PM, albert kao wrote:
> > >>> My hello-world.war has the commons lang3 3.6:
> > >>> hello-world/WEB-INF/lib
> > >>> hello-world/WEB-INF/lib/commons-fileupload-1.3.3.jar
> > >>> hello-world/WEB-INF/lib/ognl-3.1.12.jar
> > >>> hello-world/WEB-INF/lib/struts2-core-2.5.12.jar
> > >>> hello-world/WEB-INF/lib/freemarker-2.3.23.jar
> > >>> hello-world/WEB-INF/lib/log4j-core-2.8.2.jar
> > >>> hello-world/WEB-INF/lib/log4j-api-2.8.2.jar
> > >>> hello-world/WEB-INF/lib/commons-io-2.4.jar
> > >>> hello-world/WEB-INF/lib/javassist-3.20.0-GA.jar
> > >>> hello-world/WEB-INF/lib/commons-lang3-3.6.jar
> > >>>
> > >>> However, the helloworld link in index.jsp did not see it.
> > >>>
> > >>>
> > >>> On Sat, Aug 26, 2017 at 7:43 PM, Yasser Zamani 
 > >
> > >>> wrote:
> > >>>
> >  I checked it's codes and seems ok. It has a dependency to struts
> > 2.5.12
> >  which has (not optional) dependency to commons lang3 3.6. So you
> > should
> >  have commons lang3 3.6 in your war lib. Do you? Or maybe you have
> > lower
> >  version of commons lang3 jar in your tomcat lib? Please check 
both.
> > 
> >  albert kao  نوشت:
> > 
> > > I downloaded struts-examples-master.zip from
> > > https://github.com/apache/struts-examples.
> > > Unzip it and run mvn.
> > >
> > > # mvn -version
> > > Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5;
> > > 2015-11-10T11:41:47-05:00)
> > > Maven home: /home/alkao/maven/apache-maven-3.3.9
> > > Java version: 1.8.0_131, vendor: Oracle Corporation
> > > Java home: /home/alkao/jdk/jdk1.8.0_131/jre
> > > Default locale: en_CA, platform encoding: UTF-8
> > > OS name: "linux", version: "4.4.0-21-generic", arch: "i386", 
family:
> >  "unix"
> > >
> > >
> > > $ mvn -e clean package
> > > [INFO] Error stacktraces are turned on.
> > > [INFO] Scanning for projects...
> > > [WARNING]
> > > [WARNING] Some problems were encountered while building the 
effective
> >  model
> > > for org.apache.struts:annotations:war:1.0.0
> > > [WARNING] The expression ${artifactId} i

Re: Clicking helloworld link got java.lang.NoSuchMethodError: org.apache.commons.lang3.reflect.MethodUtils.getAnnotation

2017-09-05 Thread Yasser Zamani
But it's impossible! Your my_tomcat.log must have at least one load 
occurrence for MethodUtils class. Maybe the app has been failed to start 
at all, elsewhere I think you get NoClassDefFoundError (not 
NoSuchMethodError).

On 9/5/2017 3:51 PM, albert kao wrote:
> I tried
> export
> CLASSPATH=$JAVA_HOME/lib:$HOME/Struts2/struts-2.5.12/lib:$CATALINA_HOME/lib:$CLASSPATH:.
>
> but the helloworld link in index.jsp still did not see the
> /home/alkao/Struts2/struts-2.5.12/lib/commons-lang3-3.6.jar.
>
>
> my_tomcat.log did not have this line any more
> [Loaded org.apache.commons.lang3.reflect.MethodUtils from
> file:/home/alkao/tomee/apache-tomee-plus-7.0.3/lib/commons-lang3-3.5.jar]
>
>
> It had lines such as:
> [Loaded org.apache.commons.lang3.text.StrLookup from
> file:/home/alkao/tomee/apache-tomee-plus-7.0.3/lib/commons-lang3-3.5.jar]
> [Loaded org.apache.commons.lang3.CharSequenceUtils from
> file:/home/alkao/tomee/apache-tomee-plus-7.0.3/lib/commons-lang3-3.5.jar]
> ...
>
>
> On Mon, Sep 4, 2017 at 1:30 PM, Yasser Zamani 
> wrote:
>
 Although I had done the following:
 export
 CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$HOME/Struts2/struts-
>> 2.5.12/lib:$CATALINA_HOME/lib:.
>>
>> If you would like to solve it like above, I think you may try below
>> instead ($CLASSPATH at end):
>>
>> export
>> CLASSPATH=$JAVA_HOME/lib:$HOME/Struts2/struts-2.5.12/
>> lib:$CATALINA_HOME/lib:.:$CLASSPATH
>>
>> On 9/4/2017 5:24 PM, albert kao wrote:
>>> As per your instruction, modify catalina.sh:
>>> JAVA_OPTS="$JAVA_OPTS
>>> -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
>>> -XX:+TraceClassLoading -XX:+TraceClassUnloading"
>>>
>>> $ catalina.sh run > my_tomcat.log 2>&1
>>>
>>> my_tomcat.log:
>>> [Loaded org.apache.commons.lang3.reflect.MethodUtils from
>>> file:/home/alkao/tomee/apache-tomee-plus-7.0.3/lib/commons-
>> lang3-3.5.jar]
>>>
>>> Although I had done the following:
>>> export
>>> CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$HOME/Struts2/struts-
>> 2.5.12/lib:$CATALINA_HOME/lib:.
>>>
>>> $ ls /home/alkao/Struts2/struts-2.5.12/lib/commons-lang3*
>>> /home/alkao/Struts2/struts-2.5.12/lib/commons-lang3-3.6.jar
>>>
>>> Therefore the helloworld link in index.jsp did not see the
>>> /home/alkao/Struts2/struts-2.5.12/lib/commons-lang3-3.6.jar.
>>>
>>>
>>> On Sat, Sep 2, 2017 at 2:46 PM, Yasser Zamani 
>>> wrote:
>>>
 I did as you said and did not get any exception!

 Could you please add following line to catalina.bat:

 set "JAVA_OPTS=-XX:+TraceClassLoading -XX:+TraceClassUnloading"

 then:

 catalina.bat run > my_tomcat.log 2>&1

 then finally search my_tomcat.log for MethodUtils?

 I would like to see from where your tomcat load MethodUtils class!


 On 9/2/2017 7:06 PM, albert kao wrote:
> My hello-world.war has the commons lang3 3.6:
> hello-world/WEB-INF/lib
> hello-world/WEB-INF/lib/commons-fileupload-1.3.3.jar
> hello-world/WEB-INF/lib/ognl-3.1.12.jar
> hello-world/WEB-INF/lib/struts2-core-2.5.12.jar
> hello-world/WEB-INF/lib/freemarker-2.3.23.jar
> hello-world/WEB-INF/lib/log4j-core-2.8.2.jar
> hello-world/WEB-INF/lib/log4j-api-2.8.2.jar
> hello-world/WEB-INF/lib/commons-io-2.4.jar
> hello-world/WEB-INF/lib/javassist-3.20.0-GA.jar
> hello-world/WEB-INF/lib/commons-lang3-3.6.jar
>
> However, the helloworld link in index.jsp did not see it.
>
>
> On Sat, Aug 26, 2017 at 7:43 PM, Yasser Zamani >>
> wrote:
>
>> I checked it's codes and seems ok. It has a dependency to struts
>> 2.5.12
>> which has (not optional) dependency to commons lang3 3.6. So you
>> should
>> have commons lang3 3.6 in your war lib. Do you? Or maybe you have
>> lower
>> version of commons lang3 jar in your tomcat lib? Please check both.
>>
>> albert kao  نوشت:
>>
>>> I downloaded struts-examples-master.zip from
>>> https://github.com/apache/struts-examples.
>>> Unzip it and run mvn.
>>>
>>> # mvn -version
>>> Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5;
>>> 2015-11-10T11:41:47-05:00)
>>> Maven home: /home/alkao/maven/apache-maven-3.3.9
>>> Java version: 1.8.0_131, vendor: Oracle Corporation
>>> Java home: /home/alkao/jdk/jdk1.8.0_131/jre
>>> Default locale: en_CA, platform encoding: UTF-8
>>> OS name: "linux", version: "4.4.0-21-generic", arch: "i386", family:
>> "unix"
>>>
>>>
>>> $ mvn -e clean package
>>> [INFO] Error stacktraces are turned on.
>>> [INFO] Scanning for projects...
>>> [WARNING]
>>> [WARNING] Some problems were encountered while building the effective
>> model
>>> for org.apache.struts:annotations:war:1.0.0
>>> [WARNING] The expression ${artifactId} is deprecated. Please use
>>> ${project.artifactId} instead.
>>> [WARNING]
>>> ...
>>> [WARNING]
>>> [WARNING] It is highly recommended to fix these problems because they
>>> th

Re: Clicking helloworld link got java.lang.NoSuchMethodError: org.apache.commons.lang3.reflect.MethodUtils.getAnnotation

2017-09-05 Thread albert kao
I tried
export
CLASSPATH=$JAVA_HOME/lib:$HOME/Struts2/struts-2.5.12/lib:$CATALINA_HOME/lib:$CLASSPATH:.

but the helloworld link in index.jsp still did not see the
/home/alkao/Struts2/struts-2.5.12/lib/commons-lang3-3.6.jar.


my_tomcat.log did not have this line any more
[Loaded org.apache.commons.lang3.reflect.MethodUtils from
file:/home/alkao/tomee/apache-tomee-plus-7.0.3/lib/commons-lang3-3.5.jar]


It had lines such as:
[Loaded org.apache.commons.lang3.text.StrLookup from
file:/home/alkao/tomee/apache-tomee-plus-7.0.3/lib/commons-lang3-3.5.jar]
[Loaded org.apache.commons.lang3.CharSequenceUtils from
file:/home/alkao/tomee/apache-tomee-plus-7.0.3/lib/commons-lang3-3.5.jar]
...


On Mon, Sep 4, 2017 at 1:30 PM, Yasser Zamani 
wrote:

> >> Although I had done the following:
> >> export
> >> CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$HOME/Struts2/struts-
> 2.5.12/lib:$CATALINA_HOME/lib:.
>
> If you would like to solve it like above, I think you may try below
> instead ($CLASSPATH at end):
>
> export
> CLASSPATH=$JAVA_HOME/lib:$HOME/Struts2/struts-2.5.12/
> lib:$CATALINA_HOME/lib:.:$CLASSPATH
>
> On 9/4/2017 5:24 PM, albert kao wrote:
> > As per your instruction, modify catalina.sh:
> > JAVA_OPTS="$JAVA_OPTS
> > -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
> > -XX:+TraceClassLoading -XX:+TraceClassUnloading"
> >
> > $ catalina.sh run > my_tomcat.log 2>&1
> >
> > my_tomcat.log:
> > [Loaded org.apache.commons.lang3.reflect.MethodUtils from
> > file:/home/alkao/tomee/apache-tomee-plus-7.0.3/lib/commons-
> lang3-3.5.jar]
> >
> > Although I had done the following:
> > export
> > CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$HOME/Struts2/struts-
> 2.5.12/lib:$CATALINA_HOME/lib:.
> >
> > $ ls /home/alkao/Struts2/struts-2.5.12/lib/commons-lang3*
> > /home/alkao/Struts2/struts-2.5.12/lib/commons-lang3-3.6.jar
> >
> > Therefore the helloworld link in index.jsp did not see the
> > /home/alkao/Struts2/struts-2.5.12/lib/commons-lang3-3.6.jar.
> >
> >
> > On Sat, Sep 2, 2017 at 2:46 PM, Yasser Zamani 
> > wrote:
> >
> >> I did as you said and did not get any exception!
> >>
> >> Could you please add following line to catalina.bat:
> >>
> >> set "JAVA_OPTS=-XX:+TraceClassLoading -XX:+TraceClassUnloading"
> >>
> >> then:
> >>
> >> catalina.bat run > my_tomcat.log 2>&1
> >>
> >> then finally search my_tomcat.log for MethodUtils?
> >>
> >> I would like to see from where your tomcat load MethodUtils class!
> >>
> >>
> >> On 9/2/2017 7:06 PM, albert kao wrote:
> >>> My hello-world.war has the commons lang3 3.6:
> >>> hello-world/WEB-INF/lib
> >>> hello-world/WEB-INF/lib/commons-fileupload-1.3.3.jar
> >>> hello-world/WEB-INF/lib/ognl-3.1.12.jar
> >>> hello-world/WEB-INF/lib/struts2-core-2.5.12.jar
> >>> hello-world/WEB-INF/lib/freemarker-2.3.23.jar
> >>> hello-world/WEB-INF/lib/log4j-core-2.8.2.jar
> >>> hello-world/WEB-INF/lib/log4j-api-2.8.2.jar
> >>> hello-world/WEB-INF/lib/commons-io-2.4.jar
> >>> hello-world/WEB-INF/lib/javassist-3.20.0-GA.jar
> >>> hello-world/WEB-INF/lib/commons-lang3-3.6.jar
> >>>
> >>> However, the helloworld link in index.jsp did not see it.
> >>>
> >>>
> >>> On Sat, Aug 26, 2017 at 7:43 PM, Yasser Zamani  >
> >>> wrote:
> >>>
>  I checked it's codes and seems ok. It has a dependency to struts
> 2.5.12
>  which has (not optional) dependency to commons lang3 3.6. So you
> should
>  have commons lang3 3.6 in your war lib. Do you? Or maybe you have
> lower
>  version of commons lang3 jar in your tomcat lib? Please check both.
> 
>  albert kao  نوشت:
> 
> > I downloaded struts-examples-master.zip from
> > https://github.com/apache/struts-examples.
> > Unzip it and run mvn.
> >
> > # mvn -version
> > Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5;
> > 2015-11-10T11:41:47-05:00)
> > Maven home: /home/alkao/maven/apache-maven-3.3.9
> > Java version: 1.8.0_131, vendor: Oracle Corporation
> > Java home: /home/alkao/jdk/jdk1.8.0_131/jre
> > Default locale: en_CA, platform encoding: UTF-8
> > OS name: "linux", version: "4.4.0-21-generic", arch: "i386", family:
>  "unix"
> >
> >
> > $ mvn -e clean package
> > [INFO] Error stacktraces are turned on.
> > [INFO] Scanning for projects...
> > [WARNING]
> > [WARNING] Some problems were encountered while building the effective
>  model
> > for org.apache.struts:annotations:war:1.0.0
> > [WARNING] The expression ${artifactId} is deprecated. Please use
> > ${project.artifactId} instead.
> > [WARNING]
> > ...
> > [WARNING]
> > [WARNING] It is highly recommended to fix these problems because they
> > threaten the stability of your build.
> > [WARNING]
> > [WARNING] For this reason, future Maven versions might no longer
> >> support
> > building such malformed projects.
> > [WARNING]
> > [INFO]
> > 
> >> 
> > [INFO] Re

Re: Clicking helloworld link got java.lang.NoSuchMethodError: org.apache.commons.lang3.reflect.MethodUtils.getAnnotation

2017-09-04 Thread Yasser Zamani
>> Although I had done the following:
>> export
>> CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$HOME/Struts2/struts-2.5.12/lib:$CATALINA_HOME/lib:.

If you would like to solve it like above, I think you may try below 
instead ($CLASSPATH at end):

export 
CLASSPATH=$JAVA_HOME/lib:$HOME/Struts2/struts-2.5.12/lib:$CATALINA_HOME/lib:.:$CLASSPATH

On 9/4/2017 5:24 PM, albert kao wrote:
> As per your instruction, modify catalina.sh:
> JAVA_OPTS="$JAVA_OPTS
> -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
> -XX:+TraceClassLoading -XX:+TraceClassUnloading"
>
> $ catalina.sh run > my_tomcat.log 2>&1
>
> my_tomcat.log:
> [Loaded org.apache.commons.lang3.reflect.MethodUtils from
> file:/home/alkao/tomee/apache-tomee-plus-7.0.3/lib/commons-lang3-3.5.jar]
>
> Although I had done the following:
> export
> CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$HOME/Struts2/struts-2.5.12/lib:$CATALINA_HOME/lib:.
>
> $ ls /home/alkao/Struts2/struts-2.5.12/lib/commons-lang3*
> /home/alkao/Struts2/struts-2.5.12/lib/commons-lang3-3.6.jar
>
> Therefore the helloworld link in index.jsp did not see the
> /home/alkao/Struts2/struts-2.5.12/lib/commons-lang3-3.6.jar.
>
>
> On Sat, Sep 2, 2017 at 2:46 PM, Yasser Zamani 
> wrote:
>
>> I did as you said and did not get any exception!
>>
>> Could you please add following line to catalina.bat:
>>
>> set "JAVA_OPTS=-XX:+TraceClassLoading -XX:+TraceClassUnloading"
>>
>> then:
>>
>> catalina.bat run > my_tomcat.log 2>&1
>>
>> then finally search my_tomcat.log for MethodUtils?
>>
>> I would like to see from where your tomcat load MethodUtils class!
>>
>>
>> On 9/2/2017 7:06 PM, albert kao wrote:
>>> My hello-world.war has the commons lang3 3.6:
>>> hello-world/WEB-INF/lib
>>> hello-world/WEB-INF/lib/commons-fileupload-1.3.3.jar
>>> hello-world/WEB-INF/lib/ognl-3.1.12.jar
>>> hello-world/WEB-INF/lib/struts2-core-2.5.12.jar
>>> hello-world/WEB-INF/lib/freemarker-2.3.23.jar
>>> hello-world/WEB-INF/lib/log4j-core-2.8.2.jar
>>> hello-world/WEB-INF/lib/log4j-api-2.8.2.jar
>>> hello-world/WEB-INF/lib/commons-io-2.4.jar
>>> hello-world/WEB-INF/lib/javassist-3.20.0-GA.jar
>>> hello-world/WEB-INF/lib/commons-lang3-3.6.jar
>>>
>>> However, the helloworld link in index.jsp did not see it.
>>>
>>>
>>> On Sat, Aug 26, 2017 at 7:43 PM, Yasser Zamani 
>>> wrote:
>>>
 I checked it's codes and seems ok. It has a dependency to struts 2.5.12
 which has (not optional) dependency to commons lang3 3.6. So you should
 have commons lang3 3.6 in your war lib. Do you? Or maybe you have lower
 version of commons lang3 jar in your tomcat lib? Please check both.

 albert kao  نوشت:

> I downloaded struts-examples-master.zip from
> https://github.com/apache/struts-examples.
> Unzip it and run mvn.
>
> # mvn -version
> Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5;
> 2015-11-10T11:41:47-05:00)
> Maven home: /home/alkao/maven/apache-maven-3.3.9
> Java version: 1.8.0_131, vendor: Oracle Corporation
> Java home: /home/alkao/jdk/jdk1.8.0_131/jre
> Default locale: en_CA, platform encoding: UTF-8
> OS name: "linux", version: "4.4.0-21-generic", arch: "i386", family:
 "unix"
>
>
> $ mvn -e clean package
> [INFO] Error stacktraces are turned on.
> [INFO] Scanning for projects...
> [WARNING]
> [WARNING] Some problems were encountered while building the effective
 model
> for org.apache.struts:annotations:war:1.0.0
> [WARNING] The expression ${artifactId} is deprecated. Please use
> ${project.artifactId} instead.
> [WARNING]
> ...
> [WARNING]
> [WARNING] It is highly recommended to fix these problems because they
> threaten the stability of your build.
> [WARNING]
> [WARNING] For this reason, future Maven versions might no longer
>> support
> building such malformed projects.
> [WARNING]
> [INFO]
> 
>> 
> [INFO] Reactor Build Order:
> [INFO]
> ...
> [INFO] Building Action chaining 1.0-SNAPSHOT
> [INFO]
> 
>> 
> Downloading:
> https://repo.maven.apache.org/maven2/org/apache/maven/
 plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.pom
> Downloaded:
> https://repo.maven.apache.org/maven2/org/apache/maven/
 plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.pom
> (12 KB at 21.7 KB/sec)
> Downloading:
> https://repo.maven.apache.org/maven2/org/apache/maven/
 plugins/maven-plugins/27/maven-plugins-27.pom
> Downloaded:
> https://repo.maven.apache.org/maven2/org/apache/maven/
 plugins/maven-plugins/27/maven-plugins-27.pom
> (0 B at 0.0 KB/sec)
> Downloading:
> https://repo.maven.apache.org/maven2/org/apache/maven/
 maven-parent/26/maven-parent-26.pom
> Downloaded:
> https://repo.maven.apache.org/maven2/org/apac

Re: Clicking helloworld link got java.lang.NoSuchMethodError: org.apache.commons.lang3.reflect.MethodUtils.getAnnotation

2017-09-04 Thread Yasser Zamani
So as I guessed at first, you have `commons-lang3-3.5.jar` in your tomee 
lib directory (/home/alkao/tomee/apache-tomee-plus-7.0.3/lib/) which has 
precedence to be loaded before jars in your app's lib folder! i.e. you 
will have commons-lang3-3.5 loaded rather than 3.6.

Unfortunately, with some efforts, I could not find any solution on net 
to tell tomee to also load commons-lang3-3.6.jar from webapp/web-inf/lib 
:( please continue at [1] for any solution.

[1] mailto:users-subscr...@tomee.apache.org

On 9/4/2017 5:24 PM, albert kao wrote:
> As per your instruction, modify catalina.sh:
> JAVA_OPTS="$JAVA_OPTS
> -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
> -XX:+TraceClassLoading -XX:+TraceClassUnloading"
>
> $ catalina.sh run > my_tomcat.log 2>&1
>
> my_tomcat.log:
> [Loaded org.apache.commons.lang3.reflect.MethodUtils from
> file:/home/alkao/tomee/apache-tomee-plus-7.0.3/lib/commons-lang3-3.5.jar]
>
> Although I had done the following:
> export
> CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$HOME/Struts2/struts-2.5.12/lib:$CATALINA_HOME/lib:.
>
> $ ls /home/alkao/Struts2/struts-2.5.12/lib/commons-lang3*
> /home/alkao/Struts2/struts-2.5.12/lib/commons-lang3-3.6.jar
>
> Therefore the helloworld link in index.jsp did not see the
> /home/alkao/Struts2/struts-2.5.12/lib/commons-lang3-3.6.jar.
>
>
> On Sat, Sep 2, 2017 at 2:46 PM, Yasser Zamani 
> wrote:
>
>> I did as you said and did not get any exception!
>>
>> Could you please add following line to catalina.bat:
>>
>> set "JAVA_OPTS=-XX:+TraceClassLoading -XX:+TraceClassUnloading"
>>
>> then:
>>
>> catalina.bat run > my_tomcat.log 2>&1
>>
>> then finally search my_tomcat.log for MethodUtils?
>>
>> I would like to see from where your tomcat load MethodUtils class!
>>
>>
>> On 9/2/2017 7:06 PM, albert kao wrote:
>>> My hello-world.war has the commons lang3 3.6:
>>> hello-world/WEB-INF/lib
>>> hello-world/WEB-INF/lib/commons-fileupload-1.3.3.jar
>>> hello-world/WEB-INF/lib/ognl-3.1.12.jar
>>> hello-world/WEB-INF/lib/struts2-core-2.5.12.jar
>>> hello-world/WEB-INF/lib/freemarker-2.3.23.jar
>>> hello-world/WEB-INF/lib/log4j-core-2.8.2.jar
>>> hello-world/WEB-INF/lib/log4j-api-2.8.2.jar
>>> hello-world/WEB-INF/lib/commons-io-2.4.jar
>>> hello-world/WEB-INF/lib/javassist-3.20.0-GA.jar
>>> hello-world/WEB-INF/lib/commons-lang3-3.6.jar
>>>
>>> However, the helloworld link in index.jsp did not see it.
>>>
>>>
>>> On Sat, Aug 26, 2017 at 7:43 PM, Yasser Zamani 
>>> wrote:
>>>
 I checked it's codes and seems ok. It has a dependency to struts 2.5.12
 which has (not optional) dependency to commons lang3 3.6. So you should
 have commons lang3 3.6 in your war lib. Do you? Or maybe you have lower
 version of commons lang3 jar in your tomcat lib? Please check both.

 albert kao  نوشت:

> I downloaded struts-examples-master.zip from
> https://github.com/apache/struts-examples.
> Unzip it and run mvn.
>
> # mvn -version
> Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5;
> 2015-11-10T11:41:47-05:00)
> Maven home: /home/alkao/maven/apache-maven-3.3.9
> Java version: 1.8.0_131, vendor: Oracle Corporation
> Java home: /home/alkao/jdk/jdk1.8.0_131/jre
> Default locale: en_CA, platform encoding: UTF-8
> OS name: "linux", version: "4.4.0-21-generic", arch: "i386", family:
 "unix"
>
>
> $ mvn -e clean package
> [INFO] Error stacktraces are turned on.
> [INFO] Scanning for projects...
> [WARNING]
> [WARNING] Some problems were encountered while building the effective
 model
> for org.apache.struts:annotations:war:1.0.0
> [WARNING] The expression ${artifactId} is deprecated. Please use
> ${project.artifactId} instead.
> [WARNING]
> ...
> [WARNING]
> [WARNING] It is highly recommended to fix these problems because they
> threaten the stability of your build.
> [WARNING]
> [WARNING] For this reason, future Maven versions might no longer
>> support
> building such malformed projects.
> [WARNING]
> [INFO]
> 
>> 
> [INFO] Reactor Build Order:
> [INFO]
> ...
> [INFO] Building Action chaining 1.0-SNAPSHOT
> [INFO]
> 
>> 
> Downloading:
> https://repo.maven.apache.org/maven2/org/apache/maven/
 plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.pom
> Downloaded:
> https://repo.maven.apache.org/maven2/org/apache/maven/
 plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.pom
> (12 KB at 21.7 KB/sec)
> Downloading:
> https://repo.maven.apache.org/maven2/org/apache/maven/
 plugins/maven-plugins/27/maven-plugins-27.pom
> Downloaded:
> https://repo.maven.apache.org/maven2/org/apache/maven/
 plugins/maven-plugins/27/maven-plugins-27.pom
> (0 B at 0.0 KB/sec)
> Downloading:

Re: Clicking helloworld link got java.lang.NoSuchMethodError: org.apache.commons.lang3.reflect.MethodUtils.getAnnotation

2017-09-04 Thread albert kao
As per your instruction, modify catalina.sh:
JAVA_OPTS="$JAVA_OPTS
-Djava.protocol.handler.pkgs=org.apache.catalina.webresources
-XX:+TraceClassLoading -XX:+TraceClassUnloading"

$ catalina.sh run > my_tomcat.log 2>&1

my_tomcat.log:
[Loaded org.apache.commons.lang3.reflect.MethodUtils from
file:/home/alkao/tomee/apache-tomee-plus-7.0.3/lib/commons-lang3-3.5.jar]

Although I had done the following:
export
CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$HOME/Struts2/struts-2.5.12/lib:$CATALINA_HOME/lib:.

$ ls /home/alkao/Struts2/struts-2.5.12/lib/commons-lang3*
/home/alkao/Struts2/struts-2.5.12/lib/commons-lang3-3.6.jar

Therefore the helloworld link in index.jsp did not see the
/home/alkao/Struts2/struts-2.5.12/lib/commons-lang3-3.6.jar.


On Sat, Sep 2, 2017 at 2:46 PM, Yasser Zamani 
wrote:

> I did as you said and did not get any exception!
>
> Could you please add following line to catalina.bat:
>
> set "JAVA_OPTS=-XX:+TraceClassLoading -XX:+TraceClassUnloading"
>
> then:
>
> catalina.bat run > my_tomcat.log 2>&1
>
> then finally search my_tomcat.log for MethodUtils?
>
> I would like to see from where your tomcat load MethodUtils class!
>
>
> On 9/2/2017 7:06 PM, albert kao wrote:
> > My hello-world.war has the commons lang3 3.6:
> > hello-world/WEB-INF/lib
> > hello-world/WEB-INF/lib/commons-fileupload-1.3.3.jar
> > hello-world/WEB-INF/lib/ognl-3.1.12.jar
> > hello-world/WEB-INF/lib/struts2-core-2.5.12.jar
> > hello-world/WEB-INF/lib/freemarker-2.3.23.jar
> > hello-world/WEB-INF/lib/log4j-core-2.8.2.jar
> > hello-world/WEB-INF/lib/log4j-api-2.8.2.jar
> > hello-world/WEB-INF/lib/commons-io-2.4.jar
> > hello-world/WEB-INF/lib/javassist-3.20.0-GA.jar
> > hello-world/WEB-INF/lib/commons-lang3-3.6.jar
> >
> > However, the helloworld link in index.jsp did not see it.
> >
> >
> > On Sat, Aug 26, 2017 at 7:43 PM, Yasser Zamani 
> > wrote:
> >
> >> I checked it's codes and seems ok. It has a dependency to struts 2.5.12
> >> which has (not optional) dependency to commons lang3 3.6. So you should
> >> have commons lang3 3.6 in your war lib. Do you? Or maybe you have lower
> >> version of commons lang3 jar in your tomcat lib? Please check both.
> >>
> >> albert kao  نوشت:
> >>
> >>> I downloaded struts-examples-master.zip from
> >>> https://github.com/apache/struts-examples.
> >>> Unzip it and run mvn.
> >>>
> >>> # mvn -version
> >>> Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5;
> >>> 2015-11-10T11:41:47-05:00)
> >>> Maven home: /home/alkao/maven/apache-maven-3.3.9
> >>> Java version: 1.8.0_131, vendor: Oracle Corporation
> >>> Java home: /home/alkao/jdk/jdk1.8.0_131/jre
> >>> Default locale: en_CA, platform encoding: UTF-8
> >>> OS name: "linux", version: "4.4.0-21-generic", arch: "i386", family:
> >> "unix"
> >>>
> >>>
> >>> $ mvn -e clean package
> >>> [INFO] Error stacktraces are turned on.
> >>> [INFO] Scanning for projects...
> >>> [WARNING]
> >>> [WARNING] Some problems were encountered while building the effective
> >> model
> >>> for org.apache.struts:annotations:war:1.0.0
> >>> [WARNING] The expression ${artifactId} is deprecated. Please use
> >>> ${project.artifactId} instead.
> >>> [WARNING]
> >>> ...
> >>> [WARNING]
> >>> [WARNING] It is highly recommended to fix these problems because they
> >>> threaten the stability of your build.
> >>> [WARNING]
> >>> [WARNING] For this reason, future Maven versions might no longer
> support
> >>> building such malformed projects.
> >>> [WARNING]
> >>> [INFO]
> >>> 
> 
> >>> [INFO] Reactor Build Order:
> >>> [INFO]
> >>> ...
> >>> [INFO] Building Action chaining 1.0-SNAPSHOT
> >>> [INFO]
> >>> 
> 
> >>> Downloading:
> >>> https://repo.maven.apache.org/maven2/org/apache/maven/
> >> plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.pom
> >>> Downloaded:
> >>> https://repo.maven.apache.org/maven2/org/apache/maven/
> >> plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.pom
> >>> (12 KB at 21.7 KB/sec)
> >>> Downloading:
> >>> https://repo.maven.apache.org/maven2/org/apache/maven/
> >> plugins/maven-plugins/27/maven-plugins-27.pom
> >>> Downloaded:
> >>> https://repo.maven.apache.org/maven2/org/apache/maven/
> >> plugins/maven-plugins/27/maven-plugins-27.pom
> >>> (0 B at 0.0 KB/sec)
> >>> Downloading:
> >>> https://repo.maven.apache.org/maven2/org/apache/maven/
> >> maven-parent/26/maven-parent-26.pom
> >>> Downloaded:
> >>> https://repo.maven.apache.org/maven2/org/apache/maven/
> >> maven-parent/26/maven-parent-26.pom
> >>> (0 B at 0.0 KB/sec)
> >>> Downloading:
> >>> https://repo.maven.apache.org/maven2/org/apache/maven/
> >> plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.jar
> >>> Downloaded:
> >>> https://repo.maven.apache.org/maven2/org/apache/maven/
> >> plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.jar
> >>> (46 KB at 415.4 KB/sec)
> >>> Downloading:
> >>> https://r

Re: Clicking helloworld link got java.lang.NoSuchMethodError: org.apache.commons.lang3.reflect.MethodUtils.getAnnotation

2017-09-02 Thread Yasser Zamani
I did as you said and did not get any exception!

Could you please add following line to catalina.bat:

set "JAVA_OPTS=-XX:+TraceClassLoading -XX:+TraceClassUnloading"

then:

catalina.bat run > my_tomcat.log 2>&1

then finally search my_tomcat.log for MethodUtils?

I would like to see from where your tomcat load MethodUtils class!


On 9/2/2017 7:06 PM, albert kao wrote:
> My hello-world.war has the commons lang3 3.6:
> hello-world/WEB-INF/lib
> hello-world/WEB-INF/lib/commons-fileupload-1.3.3.jar
> hello-world/WEB-INF/lib/ognl-3.1.12.jar
> hello-world/WEB-INF/lib/struts2-core-2.5.12.jar
> hello-world/WEB-INF/lib/freemarker-2.3.23.jar
> hello-world/WEB-INF/lib/log4j-core-2.8.2.jar
> hello-world/WEB-INF/lib/log4j-api-2.8.2.jar
> hello-world/WEB-INF/lib/commons-io-2.4.jar
> hello-world/WEB-INF/lib/javassist-3.20.0-GA.jar
> hello-world/WEB-INF/lib/commons-lang3-3.6.jar
>
> However, the helloworld link in index.jsp did not see it.
>
>
> On Sat, Aug 26, 2017 at 7:43 PM, Yasser Zamani 
> wrote:
>
>> I checked it's codes and seems ok. It has a dependency to struts 2.5.12
>> which has (not optional) dependency to commons lang3 3.6. So you should
>> have commons lang3 3.6 in your war lib. Do you? Or maybe you have lower
>> version of commons lang3 jar in your tomcat lib? Please check both.
>>
>> albert kao  نوشت:
>>
>>> I downloaded struts-examples-master.zip from
>>> https://github.com/apache/struts-examples.
>>> Unzip it and run mvn.
>>>
>>> # mvn -version
>>> Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5;
>>> 2015-11-10T11:41:47-05:00)
>>> Maven home: /home/alkao/maven/apache-maven-3.3.9
>>> Java version: 1.8.0_131, vendor: Oracle Corporation
>>> Java home: /home/alkao/jdk/jdk1.8.0_131/jre
>>> Default locale: en_CA, platform encoding: UTF-8
>>> OS name: "linux", version: "4.4.0-21-generic", arch: "i386", family:
>> "unix"
>>>
>>>
>>> $ mvn -e clean package
>>> [INFO] Error stacktraces are turned on.
>>> [INFO] Scanning for projects...
>>> [WARNING]
>>> [WARNING] Some problems were encountered while building the effective
>> model
>>> for org.apache.struts:annotations:war:1.0.0
>>> [WARNING] The expression ${artifactId} is deprecated. Please use
>>> ${project.artifactId} instead.
>>> [WARNING]
>>> ...
>>> [WARNING]
>>> [WARNING] It is highly recommended to fix these problems because they
>>> threaten the stability of your build.
>>> [WARNING]
>>> [WARNING] For this reason, future Maven versions might no longer support
>>> building such malformed projects.
>>> [WARNING]
>>> [INFO]
>>> 
>>> [INFO] Reactor Build Order:
>>> [INFO]
>>> ...
>>> [INFO] Building Action chaining 1.0-SNAPSHOT
>>> [INFO]
>>> 
>>> Downloading:
>>> https://repo.maven.apache.org/maven2/org/apache/maven/
>> plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.pom
>>> Downloaded:
>>> https://repo.maven.apache.org/maven2/org/apache/maven/
>> plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.pom
>>> (12 KB at 21.7 KB/sec)
>>> Downloading:
>>> https://repo.maven.apache.org/maven2/org/apache/maven/
>> plugins/maven-plugins/27/maven-plugins-27.pom
>>> Downloaded:
>>> https://repo.maven.apache.org/maven2/org/apache/maven/
>> plugins/maven-plugins/27/maven-plugins-27.pom
>>> (0 B at 0.0 KB/sec)
>>> Downloading:
>>> https://repo.maven.apache.org/maven2/org/apache/maven/
>> maven-parent/26/maven-parent-26.pom
>>> Downloaded:
>>> https://repo.maven.apache.org/maven2/org/apache/maven/
>> maven-parent/26/maven-parent-26.pom
>>> (0 B at 0.0 KB/sec)
>>> Downloading:
>>> https://repo.maven.apache.org/maven2/org/apache/maven/
>> plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.jar
>>> Downloaded:
>>> https://repo.maven.apache.org/maven2/org/apache/maven/
>> plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.jar
>>> (46 KB at 415.4 KB/sec)
>>> Downloading:
>>> https://repository.apache.org/content/groups/public/org/
>> apache/struts/struts2-core/2.5.12/struts2-core-2.5.12.pom
>>> Downloaded:
>>> https://repository.apache.org/content/groups/public/org/
>> apache/struts/struts2-core/2.5.12/struts2-core-2.5.12.pom
>>> (17 KB at 30.1 KB/sec)
>>> ...
>>> [INFO]
>>> 
>>> [INFO] BUILD SUCCESS
>>> ...
>>>
>>>
>>>
>>> Copy hello-world.war to Apache TomEE:
>>> # cp helloworld/target/hello-world.war $CATALINA_HOME/webapps/.
>>>
>>>
>>> In a browser accessing URL:
>>> http://localhost:8080/hello-world/index.jsp
>>>
>>>
>>> which display:
>>> "Welcome To Struts 2!
>>>
>>> Hello World"
>>>
>>>
>>>
>>> Then clicking the 'Hello World' link got the url:
>>> http://localhost:8080/hello-world/hello.action;jsessionid=
>> 8EEA47306A76BAE87F665C6090D518E3
>>>
>>>
>>> which display:
>>> HTTP Status 500 - Filter execution threw an exception
>>>
>>> type Exception report
>>>
>>> message Filter execution threw an exception

Re: Clicking helloworld link got java.lang.NoSuchMethodError: org.apache.commons.lang3.reflect.MethodUtils.getAnnotation

2017-09-02 Thread albert kao
My hello-world.war has the commons lang3 3.6:
hello-world/WEB-INF/lib
hello-world/WEB-INF/lib/commons-fileupload-1.3.3.jar
hello-world/WEB-INF/lib/ognl-3.1.12.jar
hello-world/WEB-INF/lib/struts2-core-2.5.12.jar
hello-world/WEB-INF/lib/freemarker-2.3.23.jar
hello-world/WEB-INF/lib/log4j-core-2.8.2.jar
hello-world/WEB-INF/lib/log4j-api-2.8.2.jar
hello-world/WEB-INF/lib/commons-io-2.4.jar
hello-world/WEB-INF/lib/javassist-3.20.0-GA.jar
hello-world/WEB-INF/lib/commons-lang3-3.6.jar

However, the helloworld link in index.jsp did not see it.


On Sat, Aug 26, 2017 at 7:43 PM, Yasser Zamani 
wrote:

> I checked it's codes and seems ok. It has a dependency to struts 2.5.12
> which has (not optional) dependency to commons lang3 3.6. So you should
> have commons lang3 3.6 in your war lib. Do you? Or maybe you have lower
> version of commons lang3 jar in your tomcat lib? Please check both.
>
> albert kao  نوشت:
>
> >I downloaded struts-examples-master.zip from
> >https://github.com/apache/struts-examples.
> >Unzip it and run mvn.
> >
> ># mvn -version
> >Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5;
> >2015-11-10T11:41:47-05:00)
> >Maven home: /home/alkao/maven/apache-maven-3.3.9
> >Java version: 1.8.0_131, vendor: Oracle Corporation
> >Java home: /home/alkao/jdk/jdk1.8.0_131/jre
> >Default locale: en_CA, platform encoding: UTF-8
> >OS name: "linux", version: "4.4.0-21-generic", arch: "i386", family:
> "unix"
> >
> >
> >$ mvn -e clean package
> >[INFO] Error stacktraces are turned on.
> >[INFO] Scanning for projects...
> >[WARNING]
> >[WARNING] Some problems were encountered while building the effective
> model
> >for org.apache.struts:annotations:war:1.0.0
> >[WARNING] The expression ${artifactId} is deprecated. Please use
> >${project.artifactId} instead.
> >[WARNING]
> >...
> >[WARNING]
> >[WARNING] It is highly recommended to fix these problems because they
> >threaten the stability of your build.
> >[WARNING]
> >[WARNING] For this reason, future Maven versions might no longer support
> >building such malformed projects.
> >[WARNING]
> >[INFO]
> >
> >[INFO] Reactor Build Order:
> >[INFO]
> >...
> >[INFO] Building Action chaining 1.0-SNAPSHOT
> >[INFO]
> >
> >Downloading:
> >https://repo.maven.apache.org/maven2/org/apache/maven/
> plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.pom
> >Downloaded:
> >https://repo.maven.apache.org/maven2/org/apache/maven/
> plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.pom
> >(12 KB at 21.7 KB/sec)
> >Downloading:
> >https://repo.maven.apache.org/maven2/org/apache/maven/
> plugins/maven-plugins/27/maven-plugins-27.pom
> >Downloaded:
> >https://repo.maven.apache.org/maven2/org/apache/maven/
> plugins/maven-plugins/27/maven-plugins-27.pom
> >(0 B at 0.0 KB/sec)
> >Downloading:
> >https://repo.maven.apache.org/maven2/org/apache/maven/
> maven-parent/26/maven-parent-26.pom
> >Downloaded:
> >https://repo.maven.apache.org/maven2/org/apache/maven/
> maven-parent/26/maven-parent-26.pom
> >(0 B at 0.0 KB/sec)
> >Downloading:
> >https://repo.maven.apache.org/maven2/org/apache/maven/
> plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.jar
> >Downloaded:
> >https://repo.maven.apache.org/maven2/org/apache/maven/
> plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.jar
> >(46 KB at 415.4 KB/sec)
> >Downloading:
> >https://repository.apache.org/content/groups/public/org/
> apache/struts/struts2-core/2.5.12/struts2-core-2.5.12.pom
> >Downloaded:
> >https://repository.apache.org/content/groups/public/org/
> apache/struts/struts2-core/2.5.12/struts2-core-2.5.12.pom
> >(17 KB at 30.1 KB/sec)
> >...
> >[INFO]
> >
> >[INFO] BUILD SUCCESS
> >...
> >
> >
> >
> >Copy hello-world.war to Apache TomEE:
> ># cp helloworld/target/hello-world.war $CATALINA_HOME/webapps/.
> >
> >
> >In a browser accessing URL:
> >http://localhost:8080/hello-world/index.jsp
> >
> >
> >which display:
> >"Welcome To Struts 2!
> >
> >Hello World"
> >
> >
> >
> >Then clicking the 'Hello World' link got the url:
> >http://localhost:8080/hello-world/hello.action;jsessionid=
> 8EEA47306A76BAE87F665C6090D518E3
> >
> >
> >which display:
> >HTTP Status 500 - Filter execution threw an exception
> >
> >type Exception report
> >
> >message Filter execution threw an exception
> >
> >description The server encountered an internal error that prevented it
> from
> >fulfilling this request.
> >
> >exception
> >
> >javax.servlet.ServletException: Filter execution threw an exception
> >root cause
> >
> >java.lang.NoSuchMethodError:
> >org.apache.commons.lang3.reflect.MethodUtils.getAnnotation(Ljava/lang/
> reflect/Method;Ljava/lang/Class;ZZ)Ljava/lang/annotation/Annotation;
> >org.apache.struts2.interceptor.validation.AnnotationValidationIntercepto
> r.doIntercept(AnnotationVali

Re: Clicking helloworld link got java.lang.NoSuchMethodError: org.apache.commons.lang3.reflect.MethodUtils.getAnnotation

2017-08-26 Thread Yasser Zamani
I checked it's codes and seems ok. It has a dependency to struts 2.5.12 which 
has (not optional) dependency to commons lang3 3.6. So you should have commons 
lang3 3.6 in your war lib. Do you? Or maybe you have lower version of commons 
lang3 jar in your tomcat lib? Please check both.

albert kao  نوشت:

>I downloaded struts-examples-master.zip from
>https://github.com/apache/struts-examples.
>Unzip it and run mvn.
>
># mvn -version
>Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5;
>2015-11-10T11:41:47-05:00)
>Maven home: /home/alkao/maven/apache-maven-3.3.9
>Java version: 1.8.0_131, vendor: Oracle Corporation
>Java home: /home/alkao/jdk/jdk1.8.0_131/jre
>Default locale: en_CA, platform encoding: UTF-8
>OS name: "linux", version: "4.4.0-21-generic", arch: "i386", family: "unix"
>
>
>$ mvn -e clean package
>[INFO] Error stacktraces are turned on.
>[INFO] Scanning for projects...
>[WARNING]
>[WARNING] Some problems were encountered while building the effective model
>for org.apache.struts:annotations:war:1.0.0
>[WARNING] The expression ${artifactId} is deprecated. Please use
>${project.artifactId} instead.
>[WARNING]
>...
>[WARNING]
>[WARNING] It is highly recommended to fix these problems because they
>threaten the stability of your build.
>[WARNING]
>[WARNING] For this reason, future Maven versions might no longer support
>building such malformed projects.
>[WARNING]
>[INFO]
>
>[INFO] Reactor Build Order:
>[INFO]
>...
>[INFO] Building Action chaining 1.0-SNAPSHOT
>[INFO]
>
>Downloading:
>https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.pom
>Downloaded:
>https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.pom
>(12 KB at 21.7 KB/sec)
>Downloading:
>https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/27/maven-plugins-27.pom
>Downloaded:
>https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/27/maven-plugins-27.pom
>(0 B at 0.0 KB/sec)
>Downloading:
>https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/26/maven-parent-26.pom
>Downloaded:
>https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/26/maven-parent-26.pom
>(0 B at 0.0 KB/sec)
>Downloading:
>https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.jar
>Downloaded:
>https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.jar
>(46 KB at 415.4 KB/sec)
>Downloading:
>https://repository.apache.org/content/groups/public/org/apache/struts/struts2-core/2.5.12/struts2-core-2.5.12.pom
>Downloaded:
>https://repository.apache.org/content/groups/public/org/apache/struts/struts2-core/2.5.12/struts2-core-2.5.12.pom
>(17 KB at 30.1 KB/sec)
>...
>[INFO]
>
>[INFO] BUILD SUCCESS
>...
>
>
>
>Copy hello-world.war to Apache TomEE:
># cp helloworld/target/hello-world.war $CATALINA_HOME/webapps/.
>
>
>In a browser accessing URL:
>http://localhost:8080/hello-world/index.jsp
>
>
>which display:
>"Welcome To Struts 2!
>
>Hello World"
>
>
>
>Then clicking the 'Hello World' link got the url:
>http://localhost:8080/hello-world/hello.action;jsessionid=8EEA47306A76BAE87F665C6090D518E3
>
>
>which display:
>HTTP Status 500 - Filter execution threw an exception
>
>type Exception report
>
>message Filter execution threw an exception
>
>description The server encountered an internal error that prevented it from
>fulfilling this request.
>
>exception
>
>javax.servlet.ServletException: Filter execution threw an exception
>root cause
>
>java.lang.NoSuchMethodError:
>org.apache.commons.lang3.reflect.MethodUtils.getAnnotation(Ljava/lang/reflect/Method;Ljava/lang/Class;ZZ)Ljava/lang/annotation/Annotation;
>org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:47)
>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
>com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.doIntercept(ConversionErrorInterceptor.java:139)
>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
>com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:134)
>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
>com.opensymphony.xwork2.interceptor.Parameters

Clicking helloworld link got java.lang.NoSuchMethodError: org.apache.commons.lang3.reflect.MethodUtils.getAnnotation

2017-08-26 Thread albert kao
I downloaded struts-examples-master.zip from
https://github.com/apache/struts-examples.
Unzip it and run mvn.

# mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5;
2015-11-10T11:41:47-05:00)
Maven home: /home/alkao/maven/apache-maven-3.3.9
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /home/alkao/jdk/jdk1.8.0_131/jre
Default locale: en_CA, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-21-generic", arch: "i386", family: "unix"


$ mvn -e clean package
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model
for org.apache.struts:annotations:war:1.0.0
[WARNING] The expression ${artifactId} is deprecated. Please use
${project.artifactId} instead.
[WARNING]
...
[WARNING]
[WARNING] It is highly recommended to fix these problems because they
threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support
building such malformed projects.
[WARNING]
[INFO]

[INFO] Reactor Build Order:
[INFO]
...
[INFO] Building Action chaining 1.0-SNAPSHOT
[INFO]

Downloading:
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.pom
Downloaded:
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.pom
(12 KB at 21.7 KB/sec)
Downloading:
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/27/maven-plugins-27.pom
Downloaded:
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/27/maven-plugins-27.pom
(0 B at 0.0 KB/sec)
Downloading:
https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/26/maven-parent-26.pom
Downloaded:
https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/26/maven-parent-26.pom
(0 B at 0.0 KB/sec)
Downloading:
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.jar
Downloaded:
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.jar
(46 KB at 415.4 KB/sec)
Downloading:
https://repository.apache.org/content/groups/public/org/apache/struts/struts2-core/2.5.12/struts2-core-2.5.12.pom
Downloaded:
https://repository.apache.org/content/groups/public/org/apache/struts/struts2-core/2.5.12/struts2-core-2.5.12.pom
(17 KB at 30.1 KB/sec)
...
[INFO]

[INFO] BUILD SUCCESS
...



Copy hello-world.war to Apache TomEE:
# cp helloworld/target/hello-world.war $CATALINA_HOME/webapps/.


In a browser accessing URL:
http://localhost:8080/hello-world/index.jsp


which display:
"Welcome To Struts 2!

Hello World"



Then clicking the 'Hello World' link got the url:
http://localhost:8080/hello-world/hello.action;jsessionid=8EEA47306A76BAE87F665C6090D518E3


which display:
HTTP Status 500 - Filter execution threw an exception

type Exception report

message Filter execution threw an exception

description The server encountered an internal error that prevented it from
fulfilling this request.

exception

javax.servlet.ServletException: Filter execution threw an exception
root cause

java.lang.NoSuchMethodError:
org.apache.commons.lang3.reflect.MethodUtils.getAnnotation(Ljava/lang/reflect/Method;Ljava/lang/Class;ZZ)Ljava/lang/annotation/Annotation;
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:47)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.doIntercept(ConversionErrorInterceptor.java:139)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:134)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:134)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:199)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultAct