[Question Updated: See below]
I have a maven web project (portal-web) that references another maven project (portal-framework). The webserver is Wilfly 10.0.0 and the IDE is Eclipse MARS with the Jboss tools for the connector.
The framework project contains a TLD file on src\main\resourcesMETA-INF\taglib.tld. which I'm using on my JSP:
<%@taglib uri="http://fhc.pt/tags/fmc" prefix="fmc"%> <fmc:lookup attr1="this" attr2="that"></fmc:lookup>
Problem is, using the tag library on my JSP causes an access denied error:
Stack Trace org.apache.jasper.JasperException: java.io.FileNotFoundException: C:\Program Files\Java\wildfly-10.0.0.Final\standalone\deployments\portal.web.war\WEB-INF\lib\portal.framework-0.0.1-SNAPSHOT.jar (Access Denied) org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:151) org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:412) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:475) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1456) org.apache.jasper.compiler.Parser.parse(Parser.java:143) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:223) org.apache.jasper.compiler.ParserController.parse(ParserController.java:102) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:200) org.apache.jasper.compiler.Compiler.compile(Compiler.java:354) org.apache.jasper.compiler.Compiler.compile(Compiler.java:334) org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)
Now, when deploying the main project to wildlfy the dependent JAR is exploded on:
wildfly-10.0.0.Final\standalone\deployments\portal.web.war\WEB-INF\lib\portal.framework-0.0.1-SNAPSHOT.jar <- **This is a folder.**
I noticed that the JAR project appears to be handled diferently between eclipse, the connector and wildfly, as shown here:
I have tons of dependent packages on my project (Spring, hibernate, etc...) but only those two appear as an "J2EE utility JAR". Is this related to the JAR being exploded on deploy?
I also tried enabling the option "Deploy as a compressed archive" on the wildfly connector, but it doesn't really work (spring doesn't start at all after deploy).
After searching about this issue, I'm extremely confused with what might be causing this: Is it eclipse? M2E? the POM's ? Wildfly ? Eclipse Facets? I tried multiple combinations of those obscure deployment options properties, tried to remove the "utility facet" and even running maven eclipse:eclipse but to be honest I'm totally lost because I don't understand where to search for the problema.
How can I sort this?
Here are my POM's. Simplified:
"Parent POM" - For all projects:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>pt.fhc.fmc</groupId> <artifactId>core-dependencies</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>pom</packaging> <dependencies> <!-- Usual dependencies for Spring, Logging, Mysql, etc... --> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.0</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build> </project>
Portal-Framework POM (The JAR)
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>portal.framework</artifactId> <name>FMC Framework</name> <parent> <groupId>pt.fhc.fmc</groupId> <artifactId>core-dependencies</artifactId> <version>0.0.1-SNAPSHOT</version> <relativePath>..\fmc-dependencies\pom.xml</relativePath> </parent> </project>
Portal-WEB POM (The WAR) Note: this project uses maven overlays for different modules, but that works fine as the modules are correctly added to the final WAR. It's just the JAR that gets exploded
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>portal.web</artifactId> <packaging>war</packaging> <name>web Module</name> <parent> <groupId>pt.fhc.fmc</groupId> <artifactId>core-dependencies</artifactId> <version>0.0.1-SNAPSHOT</version> <relativePath>..\fmc-dependencies\pom.xml</relativePath> </parent> <dependencies> <dependency> <groupId>pt.fhc.fmc</groupId> <artifactId>portal.framework</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <!-- Modules --> <dependency> <groupId>pt.fhc.fms.modules</groupId> <artifactId>module-a</artifactId> <type>war</type> <version>0.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>pt.fhc.fms.modules</groupId> <artifactId>module-b</artifactId> <type>war</type> <version>0.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>pt.fhc.fms.modules</groupId> <artifactId>module-c</artifactId> <type>war</type> <version>0.0.1-SNAPSHOT</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.6</version> <configuration> <overlays> <overlay> <groupId>pt.fhc.fms.modules</groupId> <artifactId>module-a</artifactId> </overlay> <overlay> <groupId>pt.fhc.fms.modules</groupId> <artifactId>module-b</artifactId> </overlay> <overlay> <groupId>pt.fhc.fms.modules</groupId> <artifactId>module-c</artifactId> </overlay> </overlays> </configuration> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.3</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build> </project>
Update: I noticed that using the wildfly maven plugin and running mvn wildfly:deploy everything works (utility JAR gets deployed as an archive), so the problem must be in eclipse that is exploding the utility JAR.
0 comments:
Post a Comment