2016-03-26 8 views
3

ich eine voll funktionsfähige Web-Anwendung in einer WAR-Format verpackt haben, die ich versuche, die * .jar-Dateien von/WEB-INF/lib aufnehmen und in Wildfly 10.Deployments Anteil JAR-Dateien in Wildfly 10

zu entfernen Was ich bisher (erfolglos) gemacht habe und die Ressourcen, auf die ich verwiesen habe, sind unten.

  1. Kopieren * .jar von/WEB-INF/lib C: ... \ wildfly-10.0.0.Final \ Standalone \ Installationen
  2. Eingesetzt werden die kopierten JAR-Dateien erfolgreich.
  3. eine /WEB-INF/jboss-deployment-structure.xml (gefunden unten) Erstellt die Gläser in den Implementierungen Verzeichnis

Der obige Versuch wurde als Reaktion auf Share util jar file with war deployments in Wildfly

Ich bin auch zu referenzieren offen für den Versuch, andere Methoden auszuprobieren. Ich würde denken, dass es möglich wäre, alle Gläser in meinem WEB-INF/lib in ein Glas zu füllen und WildFly 10 eine ID für das Glas zu erstellen. Dann würde meine Kriegsdatei diese ID irgendwo angeben. Das Problem ist, dass ich mir nicht ganz sicher bin, wie ich mit einer spezifischen Wildfly/J2EE-Terminologie googlen soll. Referenzieren https://docs.jboss.org/author/display/WFLY8/Class+Loading+in+WildFly gibt mir nicht wirklich konkrete Beispiele, um mir zu helfen.

jboss-Deployment-structure.xml

<jboss-deployment-structure> 
    <!-- Make sub deployments isolated by default, so they cannot see each others classes without a Class-Path entry --> 
    <ear-subdeployments-isolated>false</ear-subdeployments-isolated> 
    <!-- This corresponds to the top level deployment. For a war this is the war's module, for an ear --> 
    <!-- This is the top level ear module, which contains all the classes in the EAR's lib folder  --> 
    <deployment> 
    <!-- exclude-subsystem prevents a subsystems deployment unit processors running on a deployment --> 
    <!-- which gives basically the same effect as removing the subsystem, but it only affects single deployment --> 
    <!-- This allows you to define additional dependencies, it is the same as using the Dependencies: manifest attribute --> 
    <dependencies> 
     <module name="deployment.aesh-0.33.11.jar" /> 
     <module name="deployment.aether-api-1.13.1.jar" /> 
     <module name="deployment.aether-impl-1.13.1.jar" /> 
     <module name="deployment.aether-spi-1.13.1.jar" /> 
     <module name="deployment.aether-util-1.13.1.jar" /> 
     <module name="deployment.angular2-2.0.0-beta.7.jar" /> 
     <module name="deployment.antlr-2.7.7.jar" /> 
     <module name="deployment.antlr4-runtime-4.5.2-1.jar" /> 
     <module name="deployment.aopalliance-1.0.jar" /> 
     <module name="deployment.bcpkix-jdk15on-1.48.jar" /> 
     <module name="deployment.bcprov-jdk15on-1.48.jar" /> 
     <module name="deployment.bootstrap-3.3.6.jar" /> 
     <module name="deployment.cglib-nodep-2.1_3.jar" /> 
     <module name="deployment.checkstyle-6.16.1.jar" /> 
     <module name="deployment.commons-beanutils-1.9.2.jar" /> 
     <module name="deployment.commons-cli-1.3.1.jar" /> 
     <module name="deployment.commons-codec-1.10.jar" /> 
     <module name="deployment.commons-collections-3.2.1.jar" /> 
     <module name="deployment.commons-compress-1.5.jar" /> 
     <module name="deployment.commons-exec-1.3.jar" /> 
     <module name="deployment.commons-io-2.4.jar" /> 
     <module name="deployment.commons-lang3-3.4.jar" /> 
     <module name="deployment.commons-logging-1.2.jar" /> 
     <module name="deployment.dom4j-1.6.1.jar" /> 
     <module name="deployment.gson-2.3.1.jar" /> 
     <module name="deployment.guava-19.0.jar" /> 
     <module name="deployment.hibernate-commons-annotations-4.0.5.Final.jar" /> 
     <module name="deployment.hibernate-core-4.3.11.Final.jar" /> 
     <module name="deployment.hibernate-jpa-2.1-api-1.0.0.Final.jar" /> 
     <module name="deployment.httpclient-4.3.5.jar" /> 
     <module name="deployment.httpcore-4.3.2.jar" /> 
     <module name="deployment.jackson-core-asl-1.9.13.jar" /> 
     <module name="deployment.jackson-mapper-asl-1.9.13.jar" /> 
     <module name="deployment.jandex-1.1.0.Final.jar" /> 
     <module name="deployment.jansi-1.9.jar" /> 
     <module name="deployment.javassist-3.12.1.GA.jar" /> 
     <module name="deployment.javassist-3.18.1-GA.jar" /> 
     <module name="deployment.javax.servlet.jsp-api-2.3.1.jar" /> 
     <module name="deployment.javax.servlet-api-3.1.0.jar" /> 
     <module name="deployment.jboss-dmr-1.2.0.Final.jar" /> 
     <module name="deployment.jboss-logging-3.1.3.GA.jar" /> 
     <module name="deployment.jboss-logging-annotations-1.2.0.Beta1.jar" /> 
     <module name="deployment.jboss-marshalling-1.4.2.Final.jar" /> 
     <module name="deployment.jboss-marshalling-river-1.4.2.Final.jar" /> 
     <module name="deployment.jboss-remoting-4.0.3.Final.jar" /> 
     <module name="deployment.jboss-sasl-1.0.4.Final.jar" /> 
     <module name="deployment.jboss-threads-2.1.1.Final.jar" /> 
     <module name="deployment.jboss-transaction-api_1.2_spec-1.0.0.Final.jar" /> 
     <module name="deployment.jboss-vfs-3.2.5.Final.jar" /> 
     <module name="deployment.jcip-annotations-1.0.jar" /> 
     <module name="deployment.jcommander-1.48.jar" /> 
     <module name="deployment.jetty-rc-repacked-5.jar" /> 
     <module name="deployment.jetty-repacked-9.2.13.v20150730.jar" /> 
     <module name="deployment.jna-4.1.0.jar" /> 
     <module name="deployment.jna-platform-4.1.0.jar" /> 
     <module name="deployment.jquery-1.11.1.jar" /> 
     <module name="deployment.jstl-1.2.jar" /> 
     <module name="deployment.log4j-api-2.0.jar" /> 
     <module name="deployment.log4j-core-2.0.jar" /> 
     <module name="deployment.log4j-slf4j-impl-2.5.jar" /> 
     <module name="deployment.maven-aether-provider-3.0.5.jar" /> 
     <module name="deployment.maven-artifact-3.0.5.jar" /> 
     <module name="deployment.maven-core-3.0.5.jar" /> 
     <module name="deployment.maven-model-3.0.5.jar" /> 
     <module name="deployment.maven-model-builder-3.0.5.jar" /> 
     <module name="deployment.maven-plugin-annotations-3.2.jar" /> 
     <module name="deployment.maven-plugin-api-3.0.5.jar" /> 
     <module name="deployment.maven-repository-metadata-3.0.5.jar" /> 
     <module name="deployment.maven-settings-3.0.5.jar" /> 
     <module name="deployment.maven-settings-builder-3.0.5.jar" /> 
     <module name="deployment.mx4j-tools-3.0.1.jar" /> 
     <module name="deployment.mysql-connector-java-5.1.38.jar" /> 
     <module name="deployment.netty-3.5.7.Final.jar" /> 
     <module name="deployment.plexus-cipher-1.4.jar" /> 
     <module name="deployment.plexus-classworlds-2.4.jar" /> 
     <module name="deployment.plexus-component-annotations-1.5.5.jar" /> 
     <module name="deployment.plexus-interpolation-1.14.jar" /> 
     <module name="deployment.plexus-sec-dispatcher-1.3.jar" /> 
     <module name="deployment.plexus-utils-3.0.10.jar" /> 
     <module name="deployment.remoting-jmx-2.0.0.Final.jar" /> 
     <module name="deployment.selenium-api-2.53.0.jar" /> 
     <module name="deployment.selenium-chrome-driver-2.53.0.jar" /> 
     <module name="deployment.selenium-edge-driver-2.53.0.jar" /> 
     <module name="deployment.selenium-firefox-driver-2.53.0.jar" /> 
     <module name="deployment.selenium-ie-driver-2.53.0.jar" /> 
     <module name="deployment.selenium-java-2.53.0.jar" /> 
     <module name="deployment.selenium-leg-rc-2.53.0.jar" /> 
     <module name="deployment.selenium-remote-driver-2.53.0.jar" /> 
     <module name="deployment.selenium-safari-driver-2.53.0.jar" /> 
     <module name="deployment.selenium-server-2.53.0.jar" /> 
     <module name="deployment.selenium-support-2.53.0.jar" /> 
     <module name="deployment.sisu-guava-0.9.9.jar" /> 
     <module name="deployment.sisu-guice-3.1.0-no_aop.jar" /> 
     <module name="deployment.sisu-inject-bean-2.3.0.jar" /> 
     <module name="deployment.sisu-inject-plexus-2.3.0.jar" /> 
     <module name="deployment.slf4j-api-1.7.18.jar" /> 
     <module name="deployment.snakeyaml-1.8.jar" /> 
     <module name="deployment.spring-aop-4.1.6.RELEASE.jar" /> 
     <module name="deployment.spring-beans-4.1.6.RELEASE.jar" /> 
     <module name="deployment.spring-context-4.1.6.RELEASE.jar" /> 
     <module name="deployment.spring-core-4.1.6.RELEASE.jar" /> 
     <module name="deployment.spring-expression-4.1.6.RELEASE.jar" /> 
     <module name="deployment.spring-jdbc-4.2.4.RELEASE.jar" /> 
     <module name="deployment.spring-security-acl-4.0.3.RELEASE.jar" /> 
     <module name="deployment.spring-security-config-4.0.1.RELEASE.jar" /> 
     <module name="deployment.spring-security-core-4.0.1.RELEASE.jar" /> 
     <module name="deployment.spring-security-taglibs-4.0.3.RELEASE.jar" /> 
     <module name="deployment.spring-security-web-4.0.1.RELEASE.jar" /> 
     <module name="deployment.spring-tx-4.2.4.RELEASE.jar" /> 
     <module name="deployment.spring-web-4.1.6.RELEASE.jar" /> 
     <module name="deployment.spring-webmvc-4.1.6.RELEASE.jar" /> 
     <module name="deployment.stacks-client-1.0.2.Final.jar" /> 
     <module name="deployment.staxmapper-1.1.0.Final.jar" /> 
     <module name="deployment.wildfly-build-config-8.1.0.Final.jar" /> 
     <module name="deployment.wildfly-cli-8.1.0.Final.jar" /> 
     <module name="deployment.wildfly-controller-client-8.1.0.Final.jar" /> 
     <module name="deployment.wildfly-maven-plugin-1.0.2.Final.jar" /> 
     <module name="deployment.wildfly-protocol-8.1.0.Final.jar" /> 
     <module name="deployment.wildfly-security-manager-1.0.0.Final.jar" /> 
     <module name="deployment.xml-apis-1.0.b2.jar" /> 
     <module name="deployment.xnio-api-3.2.2.Final.jar" /> 
     <module name="deployment.xnio-nio-3.2.2.Final.jar" /> 
     <module name="deployment.xz-1.2.jar" /> 
    </dependencies> 
    <!-- These add additional classes to the module. In this case it is the same as including the jar in the EAR's lib directory --> 
    <resources> 
     <resource-root path="md.jar" /> 
    </resources> 
    </deployment> 
</jboss-deployment-structure> 

Das Fehlerprotokoll von Wildfly angibt, es kann meine ROOT.war

13:27:30,977 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "antlr4-runtime-4.5.2-1.jar" (runtime-name : "antlr4-runtime-4.5.2-1.jar") 
13:27:30,978 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "antlr-2.7.7.jar" (runtime-name : "antlr-2.7.7.jar") 
13:27:30,978 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "angular2-2.0.0-beta.7.jar" (runtime-name : "angular2-2.0.0-beta.7.jar") 
13:27:30,979 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "aether-util-1.13.1.jar" (runtime-name : "aether-util-1.13.1.jar") 
13:27:30,979 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "aether-spi-1.13.1.jar" (runtime-name : "aether-spi-1.13.1.jar") 
13:27:30,979 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "aether-impl-1.13.1.jar" (runtime-name : "aether-impl-1.13.1.jar") 
13:27:30,979 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "aether-api-1.13.1.jar" (runtime-name : "aether-api-1.13.1.jar") 
13:27:30,981 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "aesh-0.33.11.jar" (runtime-name : "aesh-0.33.11.jar") 
13:27:30,983 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report 
WFLYCTL0184: New missing/unsatisfied dependencies: 
     service jboss.deployment.unit."ROOT.war".beanmanager (missing) dependents: [service jboss.deployment.unit."ROOT.war".weld.weldClassIntrospector, service jboss.deployment.unit."ROOT.war".batch.environment] 
WFLYCTL0186: Services which failed to start:  service jboss.deployment.unit."ROOT.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."ROOT.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "ROOT.war" 

13:27:31,234 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management 
13:27:31,234 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990 
13:27:31,234 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) started (with errors) in 47550ms - Started 4867 of 5891 services (3 services failed or missing dependencies, 1357 services are lazy, passive or on-demand) 
13:27:44,221 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0028: Stopped deployment ROOT.war (runtime-name: ROOT.war) in 11969ms 
13:27:44,285 INFO [org.jboss.as.repository] (DeploymentScanner-threads - 2) WFLYDR0002: Content removed from location C:\home\toazi\apps\wildfly-10.0.0.Final\standalone\data\content\71\0188d928a988dddca670dade8e87ac9ec64b57\content 
13:27:44,285 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0009: Undeployed "ROOT.war" (runtime-name: "ROOT.war") 
13:27:44,286 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) WFLYCTL0183: Service status report 
WFLYCTL0186: Services which failed to start:  service jboss.deployment.unit."ROOT.war".INSTALL 

Antwort

1

Wildfly viele der Abhängigkeiten in der Liste stellt nicht bereitstellen (zB Hibernate , Protokollierung). Daher müssen Sie sie nicht hinzufügen, oder wenn Sie dies tun (z. B. wenn Sie eine andere Version als Wildfly benötigen), sollten Sie sie ausschließen.

Wenn jedes Glas eine eigene Bereitstellung ist, bin ich mir nicht sicher, ob sie sich sehen können.

Abgesehen davon wäre es wahrscheinlich eine bessere Idee, Ihre Jars in ein Modul zu stecken. Dann müssen Sie nur einen Verweis auf dieses Modul in der jboss-deployment-Struktur einfügen und nicht 30. Ein Beispiel dafür finden Sie auch in der Frage, die Sie verlinkt haben.

+0

"Wildfly prov ..." wahrscheinlich, warum meine Logging-Konfiguration überschrieben wird. "Wenn jeder ..." Gedanke " false" würde Gläser einander sehen lassen, aber nach dem zweiten Lesen, Bereich der Gläser einander sehen ist beschränkt auf zu sein in derselben EAR-Datei. "Abgesehen von ..." vereinbart, weshalb ich geschrieben "... möglich sein, alle Gläser in meinem WEB-INF/lib in ein Glas zu jar ..." Allerdings erschüttern 30 und versuchen zu verweisen es fügt dem ursprünglichen Problem, Wildfly zu versuchen, die Gläser zu sehen, eine weitere Ebene der Komplexität hinzu. Tks für Rückmeldung. Gibt die Richtung zur Auflösung – Coder314

+0

@ Coder314 Sie müssen nicht alles in ein JAR setzen, wenn Sie ein Modul verwenden. Sie können mehrere JARs dort platzieren und sie in module.xml mithilfe von Ressourcenstammelementen referenzieren – user140547