Deployment error with Maven

Splash Forums Rewrite Users Deployment error with Maven

This topic contains 6 replies, has 2 voices, and was last updated by  Bueno 1 year, 4 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #27011

    Bueno
    Participant

    Hello,

    (sorry for my english)

    I am trying to add rewrite in my project.

    I added this dependecy

    <dependency>
    	<groupId>org.ocpsoft.rewrite</groupId>
    	<artifactId>rewrite-servlet</artifactId>
    	<version>2.0.12.Final</version>
    </dependency>

    I also added this in my web.xml

    <listener>
    		<listener-class>org.ocpsoft.rewrite.servlet.impl.RewriteServletRequestListener</listener-class>
    	</listener>
    	<listener>
    		<listener-class>org.ocpsoft.rewrite.servlet.impl.RewriteServletContextListener</listener-class>
    	</listener>
    	<filter>
    		<filter-name>OCPsoft Rewrite Filter</filter-name>
    		<filter-class>org.ocpsoft.rewrite.servlet.RewriteFilter</filter-class>
    		<async-supported>true</async-supported>
    	</filter>
    	<filter-mapping>
    		<filter-name>OCPsoft Rewrite Filter</filter-name>
    		<url-pattern>/*</url-pattern>
    		<dispatcher>FORWARD</dispatcher>
    		<dispatcher>REQUEST</dispatcher>
    		<dispatcher>INCLUDE</dispatcher>
    		<dispatcher>ASYNC</dispatcher>
    		<dispatcher>ERROR</dispatcher>
    	</filter-mapping>

    and created a configuraitonprovider

    public class RewriteConfig extends HttpConfigurationProvider {
    
    	@Override
    	public Configuration getConfiguration(ServletContext context) {
    		return ConfigurationBuilder.begin().addRule()
    				.perform(Log.message(Level.INFO, "Rewrite is active."));
    	}
    
    	@Override
    	public int priority() {
    		return 10;
    	}
    
    }

    But when i try to deploy I got this error

    [24/03/15 17:19:19:849 CET] 000000bb SystemErr     R org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException: rewrite-servlet-2.0.12.Final.jar
    Stack trace of nested exception:
    java.io.FileNotFoundException: File [ rewrite-servlet-2.0.12.Final.jar ] not found in archive [ TemplateJava-0.0.1-SNAPSHOT.war ] at [ C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\wstemp\appmgmt\mbean\AppManagement_14c4c8236b4_1\app_14c4c947674\mrg\TemplateJava-0.0.1-SNAPSHOT.war]
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.DirectoryLoadStrategyImpl.basicGetInputStream(DirectoryLoadStrategyImpl.java:1118)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.DirectoryLoadStrategyImpl.getInputStream(DirectoryLoadStrategyImpl.java:1063)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ContainerImpl.primGetInputStream(ContainerImpl.java:625)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.primGetInputStream(ArchiveImpl.java:2112)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.FileImpl.getInputStream(FileImpl.java:176)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.FileIteratorImpl.getInputStream(FileIteratorImpl.java:77)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategyImpl.save(SaveStrategyImpl.java:540)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategyImpl.saveFiles(SaveStrategyImpl.java:505)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategyImpl.save(SaveStrategyImpl.java:235)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.save(ArchiveImpl.java:2929)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ModuleFileImpl.save(ModuleFileImpl.java:525)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategyImpl.save(SaveStrategyImpl.java:603)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ZipStreamSaveStrategyImpl.save(ZipStreamSaveStrategyImpl.java:241)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategyImpl.save(SaveStrategyImpl.java:525)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategyImpl.saveFiles(SaveStrategyImpl.java:505)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategyImpl.save(SaveStrategyImpl.java:235)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.save(ArchiveImpl.java:2929)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ModuleFileImpl.save(ModuleFileImpl.java:525)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.saveAsNoReopen(ArchiveImpl.java:3149)
    	at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.saveAs(ArchiveImpl.java:2969)
    	at com.ibm.ws.management.application.task.FileMergeTask.update(FileMergeTask.java:358)
    	at com.ibm.ws.management.application.task.FileMergeTask.performTask(FileMergeTask.java:154)
    	at com.ibm.ws.management.application.SchedulerImpl.run(SchedulerImpl.java:315)
    	at java.lang.Thread.run(Thread.java:773)
    
    [24/03/15 17:19:19:850 CET] 000000bb SystemErr     R Stack trace of nested exception:
    [24/03/15 17:19:19:850 CET] 000000bb SystemErr     R java.io.FileNotFoundException: File [ rewrite-servlet-2.0.12.Final.jar ] not found in archive [ TemplateJava-0.0.1-SNAPSHOT.war ] at [ C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\wstemp\appmgmt\mbean\AppManagement_14c4c8236b4_1\app_14c4c947674\mrg\TemplateJava-0.0.1-SNAPSHOT.war]
    [24/03/15 17:19:19:850 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.DirectoryLoadStrategyImpl.basicGetInputStream(DirectoryLoadStrategyImpl.java:1118)
    [24/03/15 17:19:19:850 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.DirectoryLoadStrategyImpl.getInputStream(DirectoryLoadStrategyImpl.java:1063)
    [24/03/15 17:19:19:850 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ContainerImpl.primGetInputStream(ContainerImpl.java:625)
    [24/03/15 17:19:19:850 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.primGetInputStream(ArchiveImpl.java:2112)
    [24/03/15 17:19:19:850 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.FileImpl.getInputStream(FileImpl.java:176)
    [24/03/15 17:19:19:850 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.FileIteratorImpl.getInputStream(FileIteratorImpl.java:77)
    [24/03/15 17:19:19:850 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategyImpl.save(SaveStrategyImpl.java:540)
    [24/03/15 17:19:19:850 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategyImpl.saveFiles(SaveStrategyImpl.java:505)
    [24/03/15 17:19:19:851 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategyImpl.save(SaveStrategyImpl.java:235)
    [24/03/15 17:19:19:851 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.save(ArchiveImpl.java:2929)
    [24/03/15 17:19:19:851 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ModuleFileImpl.save(ModuleFileImpl.java:525)
    [24/03/15 17:19:19:851 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategyImpl.save(SaveStrategyImpl.java:603)
    [24/03/15 17:19:19:851 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ZipStreamSaveStrategyImpl.save(ZipStreamSaveStrategyImpl.java:241)
    [24/03/15 17:19:19:851 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategyImpl.save(SaveStrategyImpl.java:525)
    [24/03/15 17:19:19:851 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategyImpl.saveFiles(SaveStrategyImpl.java:505)
    [24/03/15 17:19:19:851 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategyImpl.save(SaveStrategyImpl.java:235)
    [24/03/15 17:19:19:851 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.save(ArchiveImpl.java:2929)
    [24/03/15 17:19:19:851 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ModuleFileImpl.save(ModuleFileImpl.java:525)
    [24/03/15 17:19:19:851 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.saveAsNoReopen(ArchiveImpl.java:3149)
    [24/03/15 17:19:19:851 CET] 000000bb SystemErr     R 	at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.saveAs(ArchiveImpl.java:2969)
    [24/03/15 17:19:19:852 CET] 000000bb SystemErr     R 	at com.ibm.ws.management.application.task.FileMergeTask.update(FileMergeTask.java:358)
    [24/03/15 17:19:19:852 CET] 000000bb SystemErr     R 	at com.ibm.ws.management.application.task.FileMergeTask.performTask(FileMergeTask.java:154)
    [24/03/15 17:19:19:852 CET] 000000bb SystemErr     R 	at com.ibm.ws.management.application.SchedulerImpl.run(SchedulerImpl.java:315)
    [24/03/15 17:19:19:852 CET] 000000bb SystemErr     R 	at java.lang.Thread.run(Thread.java:773)

    And don’t understand what is happening.

    I’m working on RAD 9 with Websphere 8.5.5

    #27014

    Looks like a weird packaging problem to me. Try running the build on the command line and inspect the resulting WAR.

    #27017

    Bueno
    Participant

    I have some difficulties to do it.

    I have an EAR and a WAR project and i build them on RAD with maven. The WAR is a dependency of the EAR.

    The fact is that the error with the rewrite-servlet dependency only occur with this dependency. I added other dependencies and it worked.

    #27020

    Not sure how I can help here. Looks like a Maven & Packaging issue.

    #27023

    Bueno
    Participant

    Yeah I’m sorry nothing to deal with rewrite. I don’t have the error anymore.

    However, the configuration is not working … I got ClassNotFOundException on RewriteServletRequestListener, RewriteServletContextListener and RewriteFilter.

    Do you see why ?

    #27024

    Looks like yet another packaging problem. 😉

    #27025

    Bueno
    Participant

    I finally managed to make it working. You were right it was Maven. I never used it before so i find it quite difficult.

    Nevermind, sorry for bothering you for nothing. Thank you again.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

Comments are closed.