File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 can't find TLD file in Struts Core JAR

 
Scott Selikoff
author
Saloon Keeper
Posts: 3896
16
Eclipse IDE Flex Google Web Toolkit
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the tutorials for Struts 2 I've come across, including the following line at the top of a given JSP will properly load the tag library:

The tag library is stored at "struts2-core.jar / META-INF / struts-tags.tld". My server, running JBoss 4.2.3 cannot find this file and throws the exception:

org.apache.jasper.JasperException: File "/struts-tags" not found error

The temporary solution, which seems to resolve the issue, is to extract the struts-tags.tld to the WEB-INF folder than change the call in the JSP to:

The problem is, this seems to go against every example I've seen, so I'm wondering if I'm doing something wrong such that my server cannot find and load the TLD file inside the jar. I can't imagine everyone using JBoss and Struts2 has had to do this therefore I'm assuming something's wrong with my Struts setup.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has been reported previously (here, for example); IIRC nothing was ever discovered--it's a JBoss issue, but the same person posted on a JBoss forum here and AFAICT there wasn't an answer.

Searching the web for a combination of Struts 2 +jboss +tld not found may turn up additional info.
 
Scott Selikoff
author
Saloon Keeper
Posts: 3896
16
Eclipse IDE Flex Google Web Toolkit
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The more I work with Struts 2 the more I'm inclined to return to Struts and/or Spring.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I couldn't see even *considering* a return to Struts 1--no way, no how.

I've already used SpringMVC a fair amount (not the most recent versions) and see a lot of similarities, and a few differences. S2 works better in my head, but Spring's another great choice.

If you have specific concerns, bring them up on the Struts user mailing list or if you have specific bugs, file an issue on the Struts issue tracker.
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:This has been reported previously (here, for example); IIRC nothing was ever discovered--it's a JBoss issue,


If someone can point me to the tutorial that shows up this issue, then i think i can try this out on JBoss and see what the issue is,

P.S: I would have now replied to the post in JBoss forum, but that post has been moved to a "Bad Post" forum (not sure where the OP posted earlier).

 
Scott Selikoff
author
Saloon Keeper
Posts: 3896
16
Eclipse IDE Flex Google Web Toolkit
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaikiran Pai wrote:
David Newton wrote:This has been reported previously (here, for example); IIRC nothing was ever discovered--it's a JBoss issue,


If someone can point me to the tutorial that shows up this issue, then i think i can try this out on JBoss and see what the issue is,

P.S: I would have now replied to the post in JBoss forum, but that post has been moved to a "Bad Post" forum (not sure where the OP posted earlier).


I went off this tutorial: http://www.java-samples.com/showtutorial.php?tutorialid=199
The only thing missing was adding the appropriate struts files to the WEB-INF/lib and adding the filter to the web.xml

I would move this post to JBoss, although are we sure this is a Struts issue and not a JBoss issue? I still think this might be a struts config issue.
 
Scott Selikoff
author
Saloon Keeper
Posts: 3896
16
Eclipse IDE Flex Google Web Toolkit
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UPDATE: I did a test using the simplest possible configuration and I think the issue might have been that of Eclipse, not struts nor JBoss. I was adding my shared libraries into the EAR (not the WAR) and using Eclipse to establish the runtime dependencies by going to the WAR's "(Project Properties) --> J2EE Module Dependencies". It worked for resolving the runtime class-path (never got class not found error) but not for finding the TLD file. When I opened the EAR/WAR that Eclipse created manually, there wasn't anything in the WEB-INF\lib folder.

When I copied the struts-core jar file directly into the WEB-INF/lib folder instead of the EAR, all the issues went away. Guess I added another argument for why build scripts are better than IDE's any day of the week.
 
stefano Tra
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have you solved it?

I've put all the libraries inside the Jboss lib but it doesn't work anymore.

I'm looking for a solution but it's seems to be impossible to do.

i used Netbeans.

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic