aspose file tools*
The moose likes Struts and the fly likes Struts 2 can't find TLD file in Struts Core JAR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 can Watch "Struts 2 can New topic
Author

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

Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    5

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.


My Blog: Down Home Country Coding with Scott Selikoff
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    5

The more I work with Struts 2 the more I'm inclined to return to Struts and/or Spring.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Jul 20, 2005
Posts: 9318
    
109

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).


[My Blog] [JavaRanch Journal]
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    5

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
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    5

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

Joined: Apr 09, 2009
Posts: 10
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
 
subject: Struts 2 can't find TLD file in Struts Core JAR
 
Similar Threads
Struts2 + AjaxTags JSTL not working
Beginner Struts Problem (Solved)
trying to get an object from a map in struts2
Error in building an application using Struts2
missing struts*.tld files