struts-community-plugins / struts2-jquery

Struts2 jQuery Plugin
Apache License 2.0
82 stars 50 forks source link

Struts2.5.18 and jquery-plugin 4.0.2 do not work together #165

Open hkfechner opened 6 years ago

hkfechner commented 6 years ago

Since struts2.5.18 and jquery-plugin 4.0./4.0.3 (running on tomcat 8.5.34) javascript and jquery-files (contained in struts2-core-2.5.18.jar) can't be loaded. Until struts2.5.17 and jquery-plugin 4.0./4.0.3 appplication works fine. As attachmend i will send screenshorts and a ant-based eclipse-project (test.zip).

test.zip struts2 5 18_jquery-plugin4 0 2 struts2 5 17_jquery-plugin4 0 2

lukaszlenart commented 6 years ago

Can you post logs from container? And what other plugins do you use (bootstrap)?

hkfechner commented 6 years ago

Dear Mr. Lenart

As attachment I send the tomcat- and application-log (2517..: application runs with strut2-core-2.5.17, 2518..: application runs with strut2-core-2.5.17).

Best regards Dr. Siegfried Fechner Abteilung / Referat: TI1 /TI15

Deutscher Wetterdienst Frankfurter Straße 135 63067 Offenbach/Main

Tel: 069 8062-2865 Fax: 069 8062- 3566 E-Mail: siegfried.fechner@dwd.demailto:siegfried.fechner@dwd.de http://www.dwd.dehttp://www.dwd.de/

Von: Lukasz Lenart [mailto:notifications@github.com] Gesendet: Mittwoch, 24. Oktober 2018 12:01 An: struts-community-plugins/struts2-jquery Cc: hkfechner; Author Betreff: Re: [struts-community-plugins/struts2-jquery] Struts2.5.18 and jquery-plugin 4.0.2 do not work together (#165)

Can you post logs from container? And what other plugins do you use (bootstrap)?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/struts-community-plugins/struts2-jquery/issues/165#issuecomment-432594446, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AqLkXN24ackO-1ev2fheBnfEYVLPQKjHks5uoDpRgaJpZM4X3jAK.

hkfechner commented 6 years ago

Dear Mr. Lenart,

we use for our applications only „pure“ javascript, jquery and jqueryui.

Best regards Dr. Siegfried Fechner Abteilung / Referat: TI1 /TI15

Deutscher Wetterdienst Frankfurter Straße 135 63067 Offenbach/Main

Tel: 069 8062-2865 Fax: 069 8062- 3566 E-Mail: siegfried.fechner@dwd.demailto:siegfried.fechner@dwd.de http://www.dwd.dehttp://www.dwd.de/

Von: Lukasz Lenart [mailto:notifications@github.com] Gesendet: Mittwoch, 24. Oktober 2018 12:01 An: struts-community-plugins/struts2-jquery Cc: hkfechner; Author Betreff: Re: [struts-community-plugins/struts2-jquery] Struts2.5.18 and jquery-plugin 4.0.2 do not work together (#165)

Can you post logs from container? And what other plugins do you use (bootstrap)?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/struts-community-plugins/struts2-jquery/issues/165#issuecomment-432594446, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AqLkXN24ackO-1ev2fheBnfEYVLPQKjHks5uoDpRgaJpZM4X3jAK.

lukaszlenart commented 6 years ago

GitHub doesn't accept other attachments than images. Please examine the logs, maybe there is an issue with loading classes.

hkfechner commented 6 years ago

Dear Mr. Lenart

As attachment I send the tomcat- and application-logs (2517..: application runs with strut2-core-2.5.17, 2518..: application runs with strut2-core-2.5.17). logs.zip

lukaszlenart commented 6 years ago

Do you use {{devMode=true}}? Please try to disable it and test again. Also clean up Tomcat's temp folder.

lukaszlenart commented 6 years ago

It is probably related to this issue https://lists.apache.org/thread.html/3c44da89a32ae0882a07644464c99d52c579fc449d6f67e3a3682f4f@%3Cdev.struts.apache.org%3E

you can post your comments there

hkfechner commented 6 years ago

Dear Mr. Lenart,

I had published Logs, based on “devMode=true”

Best regards Dr. Siegfried Fechner Abteilung / Referat: TI1 /TI15

Deutscher Wetterdienst Frankfurter Straße 135 63067 Offenbach/Main

Tel: 069 8062-2865 Fax: 069 8062- 3566 E-Mail: siegfried.fechner@dwd.demailto:siegfried.fechner@dwd.de http://www.dwd.dehttp://www.dwd.de/

Von: Lukasz Lenart [mailto:notifications@github.com] Gesendet: Donnerstag, 25. Oktober 2018 07:20 An: struts-community-plugins/struts2-jquery Cc: hkfechner; Author Betreff: Re: [struts-community-plugins/struts2-jquery] Struts2.5.18 and jquery-plugin 4.0.2 do not work together (#165)

Do you use {{devMode=true}}? Please try to disable it and test again. Also clean up Tomcat's temp folder.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/struts-community-plugins/struts2-jquery/issues/165#issuecomment-432918113, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AqLkXNLhQhVwlOOQUoCXGrM2lLmAWG5yks5uoUoFgaJpZM4X3jAK.

lukaszlenart commented 6 years ago

Do you use Maven? If such could you publish result of mvn dependency:tree? If not could you list all the JARs from WEB-INF\lib?

hkfechner commented 6 years ago

sorry, security constrains of Deutscher Wetterdienst do not accept access to Maven repository outsite DWD. There we can’t use Maven. Therefore I had published an ANT-Project.

logs2018_10_25.zip

hkfechner commented 6 years ago

Sorry here are the list. lib_liste.txt

sdutry commented 6 years ago

.jar.org files should not be in your dependencies (they should be .jar files and they're also from 2 different versions?)

-rw------- 1 sfechner ti1 1635849 14. Aug 04:59 struts2-core-2.5.17.jar.org -rw-r--r-- 1 sfechner ti1 1635959 18. Sep 13:38 struts2-core-2.5.18.jar.org

Op do 25 okt. 2018 om 08:14 schreef hkfechner notifications@github.com:

Sorry here are the list. lib_liste.txt https://github.com/struts-community-plugins/struts2-jquery/files/2513531/lib_liste.txt

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/struts-community-plugins/struts2-jquery/issues/165#issuecomment-432927526, or mute the thread https://github.com/notifications/unsubscribe-auth/AHkdLG4S5tQSVbSuOpEhkp-p6kGuzsLsks5uoVbMgaJpZM4X3jAK .

hkfechner commented 6 years ago

dependents on test only struts2-core-2.5.17.jar OR struts2-core-2.5.18.jar are included (.org only archives, without influence on libs); same result, if .org not in lib directory).

Best regards Dr. Siegfried Fechner Abteilung / Referat: TI1 /TI15

Deutscher Wetterdienst Frankfurter Straße 135 63067 Offenbach/Main

Tel: 069 8062-2865 Fax: 069 8062- 3566 E-Mail: siegfried.fechner@dwd.demailto:siegfried.fechner@dwd.de http://www.dwd.dehttp://www.dwd.de/

Von: Stefaan Dutry [mailto:notifications@github.com] Gesendet: Donnerstag, 25. Oktober 2018 08:27 An: struts-community-plugins/struts2-jquery Cc: hkfechner; Author Betreff: Re: [struts-community-plugins/struts2-jquery] Struts2.5.18 and jquery-plugin 4.0.2 do not work together (#165)

.jar.org files should not be in your dependencies (they should be .jar files and they're also from 2 different versions?)

-rw------- 1 sfechner ti1 1635849 14. Aug 04:59 struts2-core-2.5.17.jar.org -rw-r--r-- 1 sfechner ti1 1635959 18. Sep 13:38 struts2-core-2.5.18.jar.org

Op do 25 okt. 2018 om 08:14 schreef hkfechner notifications@github.com:

Sorry here are the list. lib_liste.txt https://github.com/struts-community-plugins/struts2-jquery/files/2513531/lib_liste.txt

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/struts-community-plugins/struts2-jquery/issues/165#issuecomment-432927526, or mute the thread https://github.com/notifications/unsubscribe-auth/AHkdLG4S5tQSVbSuOpEhkp-p6kGuzsLsks5uoVbMgaJpZM4X3jAK .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/struts-community-plugins/struts2-jquery/issues/165#issuecomment-432930071, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AqLkXLaYvkzXGe3tIEzutQ6lLX_LH3ogks5uoVmlgaJpZM4X3jAK.

sdutry commented 6 years ago

I just did a small test using struts version 2.5.18 and the struts2-jquery-plugin version 4.0.2 and it seems to work.

Can you please post us a demo jsp file in which we can see how the struts2-jquery tags are used and with which attributes? particularly the <sj:head/> tag

lukaszlenart commented 6 years ago

I think it's a matter of outdated dependencies but our page is also outdated - it targets 2.5.14.1 ;-)

https://struts.apache.org/maven/struts2-core/dependencies.html

Right now I'm working to fix that

hkfechner commented 6 years ago

Dear Mr. Dutry

As attachment I send our jsp-structure, including all used *. Jspf

tag is a standard tag from jquery-plugin

Best regard Dr. Siegfried Fechner Abteilung / Referat: TI1 /TI15

Deutscher Wetterdienst Frankfurter Straße 135 63067 Offenbach/Main

Tel: 069 8062-2865 Fax: 069 8062- 3566 E-Mail: siegfried.fechner@dwd.demailto:siegfried.fechner@dwd.de http://www.dwd.dehttp://www.dwd.de/

Von: Stefaan Dutry [mailto:notifications@github.com] Gesendet: Donnerstag, 25. Oktober 2018 09:11 An: struts-community-plugins/struts2-jquery Cc: hkfechner; Author Betreff: Re: [struts-community-plugins/struts2-jquery] Struts2.5.18 and jquery-plugin 4.0.2 do not work together (#165)

I just did a small test using struts version 2.5.18 and the struts2-jquery-plugin version 4.0.2 and it seems to work.

Can you please post us a demo jsp file in which we can see how the struts2-jquery tags are used and with which attributes? particularly the tag

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/struts-community-plugins/struts2-jquery/issues/165#issuecomment-432939502, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AqLkXHhxJYe9hjHU-cOagvqK-hbOrzRFks5uoWP7gaJpZM4X3jAK.

sdutry commented 6 years ago

@hkfechner I'm not seeing the attachments.

can you also please list the jars that are in the WEB-INF/lib folder after deploying to the tomcat? Just trying to get a full picture.

I'll take a thorough look into this this evening and create a minimal project trying to reproduce your problem.

hkfechner commented 6 years ago

Sorry!! Our mailserver blocked this zip-file

Issue165_jsp_struktur.ZIP

lukaszlenart commented 6 years ago

Ok, the page is up2date now https://struts.apache.org/maven/struts2-core/dependencies.html

I had the same issue but re-building and cleaning up temp folder worked for me, there is a dependency clash but I'm not sure which JARs are the reason.

hkfechner commented 6 years ago

„can you also please list the jars that are in the WEB-INF/lib folder after deploying to the tomcat? Just trying to get a full picture. I'll take a thorough look into this this evening and create a minimal project trying to reproduce your problem.” I send You the list of the WEB-INF/lib folder after deploying to the tomcat: 1058767 56 -rw-r----- 1 sfechner ti1 53259 25. Okt 10:13 asm-5.2.jar 1058768 48 -rw-r----- 1 sfechner ti1 47197 25. Okt 10:13 asm-commons-5.2.jar 1058769 32 -rw-r----- 1 sfechner ti1 29582 25. Okt 10:13 asm-tree-5.2.jar 1058770 576 -rw-r----- 1 sfechner ti1 588337 25. Okt 10:13 commons-collections-3.2.2.jar 1058771 72 -rw-r----- 1 sfechner ti1 70604 25. Okt 10:13 commons-fileupload-1.3.3.jar 1058829 204 -rw-r----- 1 sfechner ti1 208700 25. Okt 10:13 commons-io-2.5.jar 1058830 256 -rw-r----- 1 sfechner ti1 261809 25. Okt 10:13 commons-lang-2.4.jar 1058831 484 -rw-r----- 1 sfechner ti1 494856 25. Okt 10:13 commons-lang3-3.6.jar 1058832 64 -rw-r----- 1 sfechner ti1 61829 25. Okt 10:13 commons-logging-1.2.jar 1058833 1464 -rw-r----- 1 sfechner ti1 1496146 25. Okt 10:13 freemarker-2.3.26-incubating.jar 1058834 736 -rw-r----- 1 sfechner ti1 750581 25. Okt 10:13 javassist-3.20.0-GA.jar 1058835 4 -rw-r----- 1 sfechner ti1 1638 25. Okt 10:13 lib_liste.txt 1058836 64 -rw-r----- 1 sfechner ti1 63731 25. Okt 10:13 log4j-1.2-api-2.11.1.jar 1058837 260 -rw-r----- 1 sfechner ti1 264060 25. Okt 10:13 log4j-api-2.11.1.jar 1058838 1572 -rw-r----- 1 sfechner ti1 1607947 25. Okt 10:13 log4j-core-2.11.1.jar 1058839 232 -rw-r----- 1 sfechner ti1 235459 25. Okt 10:13 ognl-3.1.15.jar 1058840 1600 -rw-r----- 1 sfechner ti1 1635959 25. Okt 10:13 struts2-core-2.5.18.jar 1058841 2604 -rw-r----- 1 sfechner ti1 2665309 25. Okt 10:13 struts2-jquery-plugin-4.0.2.jar 1058842 440 -rw-r----- 1 sfechner ti1 449505 25. Okt 10:13 velocity-1.7.jar 1058843 340 -rw-r----- 1 sfechner ti1 346580 25. Okt 10:13 velocity-tools-2.0.jar

Best rega Mit freundlichen Grüßen Dr. Siegfried Fechner Abteilung / Referat: TI1 /TI15

Deutscher Wetterdienst Frankfurter Straße 135 63067 Offenbach/Main

Tel: 069 8062-2865 Fax: 069 8062- 3566 E-Mail: siegfried.fechner@dwd.demailto:siegfried.fechner@dwd.de http://www.dwd.dehttp://www.dwd.de/

rds

Von: Stefaan Dutry [mailto:notifications@github.com] Gesendet: Donnerstag, 25. Oktober 2018 09:11 An: struts-community-plugins/struts2-jquery Cc: hkfechner; Author Betreff: Re: [struts-community-plugins/struts2-jquery] Struts2.5.18 and jquery-plugin 4.0.2 do not work together (#165)

I just did a small test using struts version 2.5.18 and the struts2-jquery-plugin version 4.0.2 and it seems to work.

Can you please post us a demo jsp file in which we can see how the struts2-jquery tags are used and with which attributes? particularly the tag

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/struts-community-plugins/struts2-jquery/issues/165#issuecomment-432939502, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AqLkXHhxJYe9hjHU-cOagvqK-hbOrzRFks5uoWP7gaJpZM4X3jAK.

sdutry commented 6 years ago

@hkfechner tried to make a project with the exact same library dependencies: see: https://github.com/sdutry/struts2-jquery-issue165-poc

items of interest:

i only tried running it with the jetty plugin localy so far, but the jquery files all loaded and i didn't have a problem. (so http on port 80) Can you try and deploy this war to your tomcat application server and see if you are able to load the jquery files? ( /index.action under the context-root)

hkfechner commented 6 years ago

I found the problem!

if some constants ar use insite struts.xml application can be failed (depends on constant and value) examples.: true is ok, false fails! true is ok, false fails!

hkfechner commented 6 years ago

I found the problem!

if some constants are used insite struts.xml, application can be failed (depends on constant and value) examples: "struts.devMode": true is ok, false fails "struts.configuration.xml.reload": true is ok, false fails

hkfechner commented 6 years ago

I found the problem!

if some constants are used insite struts.xml, application can be failed (depends on constant and value) examples: --sorry, correct is: "struts.devMode": false is ok, true fails "struts.configuration.xml.reload": false is ok, true fails

sdutry commented 6 years ago

aha, you're right.

<constant name="struts.devMode" value="true"/>

This lets me reproduce the problem. I'll look into it this evening to find the exact cause.

Until then i'd suggest putting those values to false.

sdutry commented 6 years ago

seeing the line number it would suggest that the variable pathPrefixes is null

sdutry commented 6 years ago

@lukaszlenart

Do you know this by heart? It seems the DefaultStaticContentLoader is recreated for each request if it's set to struts.devMode=true therefore the method setHostConfig doesn't get called on the new instance and that means the pathPrefixes variable is null, causing the NPE. Is this the expected behavior?

Step completed: "thread=main", org.apache.struts2.dispatcher.DefaultStaticContentLoader.setHostConfig(), line=148 bci=42

main[1] print params
com.sun.tools.example.debug.expr.ParseException: Name unknown: params
 params = null
main[1] print packages
 packages = "org.apache.struts2.static template static org.apache.struts2.interceptor.debugging"
main[1] next
>
Step completed: "thread=main", org.apache.struts2.dispatcher.DefaultStaticContentLoader.setHostConfig(), line=149 bci=51

main[1] print pahtPrefixes
com.sun.tools.example.debug.expr.ParseException: Name unknown: pahtPrefixes
 pahtPrefixes = null
main[1] print pahtPrefixes
com.sun.tools.example.debug.expr.ParseException: Name unknown: pahtPrefixes
 pahtPrefixes = null
main[1] print param
 param = null
main[1] print packages
 packages = "org.apache.struts2.static template static org.apache.struts2.interceptor.debugging"
main[1] print pathPrefixes
 pathPrefixes = "[org/apache/struts2/static/, template/, static/, org/apache/struts2/interceptor/debugging/]"
main[1] print this
 this = "org.apache.struts2.dispatcher.DefaultStaticContentLoader@6b2ef50e"
main[1] run
>
Breakpoint hit: "thread=qtp1574503358-29", org.apache.struts2.dispatcher.DefaultStaticContentLoader.findStaticResource(), line=199 bci=7

qtp1574503358-29[1] print pathPrefixes
 pathPrefixes = null
qtp1574503358-29[1] print this
 this = "org.apache.struts2.dispatcher.DefaultStaticContentLoader@1eab2c1a"
qtp1574503358-29[1]
lukaszlenart commented 6 years ago

The only idea I have is because of fixed FileManager which properly reloads files now, it is related to this issue https://issues.apache.org/jira/browse/WW-4948

lukaszlenart commented 6 years ago

I mean, it properly reloads JARs now, this was somehow broken in previous versions