Fehler beim bereitstellen und ausführen von Frühling-app in RAD 8 bei der Auswahl Ausführen des server-Ressourcen im Arbeitsbereich
Meine Anwendung hat vier kleine Projekte:
- bauen-Projekt - Hat nur der root-POM
- Ohr-Modul - Dies ist die Anwendung ear-Projekt enthält ein web-Projekt
- web-Projekt - web-app
- utility-Projekt - Web-Projekt verwendet diese als Abhängigkeit und diese jar-Datei enthalten ist, als Glas
Keine EJBs.
Bin ich mit dem RAD 8, - Bereitstellung funktioniert einwandfrei, wenn ich wählen Sie zum ausführen der Anwendung mit der Publishing-Einstellungen für Websphere "Run server with resources on Server
" in TAD8.
Jedoch, wenn ich versuche das gleiche zu tun mit "Sie" Ausführen server mit der Ressourcen in den Arbeitsbereich", und öffnen Sie die Anwendung in meinem Browser, es schlägt fehl mit dieser Fehlermeldung:
[6/1/13 1:44:04:678 EDT] 0000001c annotations W com.ibm.ws.amm.scan.context.ScannerContextImpl getInputDataForClass Failed to open resource [ org/springframework/web/context/ContextLoaderListener.class ] from module [ abc-web.war ]
[6/1/13 1:44:04:678 EDT] 0000001c annotations W com.ibm.ws.amm.scan.context.ScannerContextImpl getInputDataForClass Class loader [ org.eclipse.jst.j2ee.commonarchivecore.internal.util.WarFileDynamicClassLoader@64662b13 ]
[6/1/13 1:44:04:678 EDT] 0000001c annotations W com.ibm.ws.amm.scan.context.ScannerContextImpl getInputDataForClass Class loader [ com.ibm.ws.bootstrap.ExtClassLoader@d64e7229 ]
[6/1/13 1:44:04:678 EDT] 0000001c annotations W com.ibm.ws.amm.scan.context.ScannerContextImpl getInputDataForClass Class loader [ org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@e9f56141 ]
[6/1/13 1:44:04:678 EDT] 0000001c annotations W com.ibm.ws.amm.scan.context.ScannerContextImpl getInputDataForClass Class loader [ sun.misc.Launcher$AppClassLoader@964626a4 ]
[6/1/13 1:44:04:678 EDT] 0000001c annotations W com.ibm.ws.amm.scan.context.ScannerContextImpl getInputDataForClass Class loader [ sun.misc.Launcher$ExtClassLoader@ad8046ad ]
[6/1/13 1:44:14:724 EDT] 0000001f ApplicationMg A WSVR0220I: Application stopped: myapp-ear
[6/1/13 1:44:14:896 EDT] 0000001f CompositionUn A WSVR0193I: Composition unit WebSphere:cuname=myapp-ear in BLA WebSphere:blaname=myapp-ear stopped.
[6/1/13 1:44:36:470 EDT] 0000001f annotation W com.ibm.ws.webcontainer.annotation.WASAnnotationHelper collectClasses SRVE8000W: Skipped class that failed to initialize for annotation scanning.
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:213)
at com.ibm.ws.webcontainer.annotation.WASAnnotationHelper.loadClass(WASAnnotationHelper.java:753)
at com.ibm.ws.webcontainer.annotation.WASAnnotationHelper.collectClasses(WASAnnotationHelper.java:188)
at com.ibm.ws.webcontainer.annotation.WASAnnotationHelper.<init>(WASAnnotationHelper.java:143)
at com.ibm.ws.webcontainer.annotation.WASAnnotationHelperManager.getAnnotationHelper(WASAnnotationHelperManager.java:63)
at com.ibm.ws.webcontainer.metadata.WebMetaDataFactory.handOffReferenceData(WebMetaDataFactory.java:450)
at com.ibm.ws.webcontainer.metadata.WebMetaDataFactory.createMetaData(WebMetaDataFactory.java:423)
at com.ibm.ws.runtime.component.MetaDataMgrImpl.createMetaDataFromFactories(MetaDataMgrImpl.java:228)
at com.ibm.ws.runtime.component.MetaDataMgrImpl.createMetaData(MetaDataMgrImpl.java:411)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:630)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:967)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:766)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1354)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2150)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445)
Hier ist der maven-pom für das Projekt erstellen( root-Projekt zu bauen)
<groupId>com.mytest</groupId>
<artifactId>myapp</artifactId>
<version>2.0.0</version>
<packaging>pom</packaging>
<name>myapp</name>
<properties>
<project.build.source>1.6</project.build.source>
<project.build.target>1.6</project.build.target>
<project.encoding>UTF-8</project.encoding>
<springVersion>3.2.1.RELEASE</springVersion>
</properties>
<modules>
<module>../myapp-domain</module>
<module>../myapp-web</module>
<module>../myapp-ear</module>
</modules>
<dependencyManagement>
<dependencies>
<!-- external dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${springVersion}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${springVersion}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>opensymphony</groupId>
<artifactId>oscache</artifactId>
<version>2.4</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
....... other dependencies .......
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${project.build.source}</source>
<target>${project.build.target}</target>
<encoding>${project.encoding}</encoding>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4</version>
<configuration>
<encoding>${project.encoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
<configuration>
<disableXmlReport>true</disableXmlReport>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>2.0-beta-6</version>
</plugin>
Hier ist der maven-pom für das ear-Projekt
<parent>
<groupId>com.mytest</groupId>
<artifactId>myapp</artifactId>
<version>2.0.0</version>
</parent>
<artifactId>myapp-ear</artifactId>
<packaging>ear</packaging>
<name>MyappEAR</name>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>myapp-web</artifactId>
<type>war</type>
<version>2.0.0</version>
</dependency>
</dependencies>
<build>
<finalName>myapp</finalName>
<resources>
<resource>
<directory>META-INF</directory>
<targetPath>../myapp/META-INF</targetPath>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.7</version>
<configuration>
<applicationXml>${basedir}/META-INF/application.xml</applicationXml>
<generateApplicationXml>false</generateApplicationXml>
<modules>
<webModule>
<groupId>${project.groupId}</groupId>
<artifactId>myapp-web</artifactId>
<bundleFileName>myapp-web.war</bundleFileName>
</webModule>
</modules>
<encoding>${project.encoding}</encoding>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<maven.ear.final.name>myapp.ear</maven.ear.final.name>
</properties>
==================================================================================================
Hier ist die Web-Projekt-POM
<artifactId>myapp-web</artifactId>
<packaging>war</packaging>
<name>myappWeb</name>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${springVersion}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${springVersion}</version>
</dependency>
<build>
<finalName>myapp-web</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<warSourceDirectory>src/main/webapp</warSourceDirectory>
<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
Merkwürdige ist, dass wenn ich versuche, um das Ohr in Add-und remove-option, Websphere 8, indem Sie mit der rechten Maustaste auf server sehe ich, dass das Ohr erzeugt hat
Struktur wie diese. So hat es zwei Kriege in den gleichen Krieg. Aber ich schaute auf die Anwendung.ear-Datei gebaut und es hat nur einen Krieg.
myapp-ear -
|-myapp-web
| |-Spring-web-3.2.1RELEASE.jar
| |-Anwendung-domain-jar
|
|-myapp-web.Krieg
InformationsquelleAutor user2442578 | 2013-06-01
Du musst angemeldet sein, um einen Kommentar abzugeben.
Dies ist ein Fehler in den deployment-Mechanismus, der das RAD mit maven-Projekte mit Spring in den Versionen >= 3.2.0 und dokumentiert ist in diesem bugreport:
https://jira.springsource.org/browse/SPR-10494
Es gibt zwei Möglichkeiten der Behebung Ihres Problems:
"YOURWORKSPACE.die Metadaten.plugins\org.eclipse.wst.server.core\tmpX*\lib" (jedem server in der Server-Ansicht bekommt seinen eigenen temp-Ordner, so dass, wenn Sie nur einen server, der Ordner wird tmp0
Die zweite option ist mehr ein workaround, das ist nur erforderlich für den Einsatz direkt in der IDE. Wenn Sie exportieren Sie Ihr web-Projekt ein .war-Datei und stellen Sie es manuell auf Websphere-es wird einfach funktionieren.
Es gibt ein workaround, das ich nur Lesen, wenn die Untersuchung das problem selber, aber auch nicht versucht, aus mir selbst, und kann nicht finden den link entweder, so handle mit Sorgfalt. Nach, können Sie Verpacken Ihre eigentliche Quelle in ein neues Projekt einbinden und diese jar in Ihrem web-Projekt mit den erforderlichen Abhängigkeiten
edit:
Wir probierten Frühjahr 4.0.0 und der bug war Weg, so könnte dies die beste Lösung, wenn Sie nicht stecken mit einer niedrigeren Feder-version.
Mein bearbeitetes Beratung stellte sich tatsächlich heraus, dass die meisten hilfreich für uns, da wir nicht nur in der Frühlings-version, die wir verwenden. Seit dem Frühjahr 4 GA für eine Weile jetzt, ich denke, die beste Lösung für das problem ist die Aktualisierung der Frühlings-version (wenn Sie sind nicht eingeschränkt auf version 3.2)
Ich erlebe dasselbe Problem mit der Feder 4.1.4, Web Sphere 7.0.0.9 mit osgi-feature pack.
InformationsquelleAutor Tobi Nonymous
Als die Ausnahme, sagt, es ist
ClassNotFoundException
. Dies bedeutet, dass die erforderlichen Feder-Gläser sind definiertprovided
Umfang und Ihre Bereitstellung fehlschlägt, um es zu lösen zur Laufzeit.Auch:
Ich sehe nicht, dass Sie definiert haben, müssen Sie Ihre multi-Modul-Abhängigkeiten korrekt. Wenn
build-project
(das ist der Typ Krieg) definiertutility
jar als Abhängigkeit beiprovided
Umfang, es muss gebündelt werden, mit dem Ohr.Wenn Ihr
utility
jar ist nicht korrekt freigegeben werden, über mehrere war-Dateien, Sie konnte es beheben, indem Sie hinzufügenutility
beicompile
Umfang zubuild-project
Hoffe, das hilft
InformationsquelleAutor Chris