Wildfly : ClassNotFoundException: org.apache.xerces.parsers.SAXParser when deploying - deployment

I'm facing this error when deploying a war containing a spring-ws:
{"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operatio
n step-2" => {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"FLUX-WSApp.war\".undertow-deploym
ent" => "org.springframework.beans.factory.BeanCreationException: Error creating bean
...
Caused by: org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser from [Module \"deployment.FLUX-WSApp.
war\" from Service Module Loader]
Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser from [Module \"deploym
ent.FLUX-WSApp.war\" from Service Module Loader]"}}}}
So I looked if the module was loaded (he is):
/core-service=module-loading:module-info(name=org.apache.xerces)
{
"outcome" => "success",
"result" => {
"name" => "org.apache.xerces",
"main-class" => undefined,
"fallback-loader" => undefined,
"dependencies" => [
{
"dependency-name" => "ModuleDependency",
"module-name" => "java.base",
"export-filter" => "Reject",
"import-filter" => "multi-path filter {exclude children of \"META-INF/\", exclude equals \"
META-INF\", default accept}",
"optional" => false
},
{
"dependency-name" => "ModuleDependency",
"module-name" => "jdk.xml.dom",
"export-filter" => "Reject",
"import-filter" => "multi-path filter {exclude children of \"META-INF/\", exclude equals \"
META-INF\", default accept}",
"optional" => false
},
{
"dependency-name" => "ModuleDependency",
"module-name" => "java.xml",
"export-filter" => "Reject",
"import-filter" => "multi-path filter {exclude children of \"META-INF/\", exclude equals \"
META-INF\", default accept}",
"optional" => false
}
],
"local-loader-class" => undefined,
"resource-loaders" => [
{
"type" => "org.jboss.modules.JarFileResourceLoader",
"paths" => [
"",
"org/w3c/dom/html",
"org/w3c",
"org/apache/xerces/xni/parser",
"org/apache/xerces/xpointer",
"META-INF/maven/xerces/xercesImpl",
"org/apache/xerces/impl/xpath/regex",
"org/apache/html",
"org/apache/xerces/impl/dv",
"org/apache/html/dom",
"org/apache/wml",
"org/w3c/dom",
"org/apache/xerces/parsers",
"org/apache/xerces/dom/events",
"org/apache/xerces/xs/datatypes",
"org/apache/xerces/impl/dv/dtd",
"org/apache/xerces/xni/grammars",
"org/apache/xerces/impl/dv/util",
"org/apache/xerces/dom",
"META-INF/maven/xerces",
"org/apache/xerces/impl/io",
"org/apache/xerces/dom3/as",
"org/apache/xerces/dom3",
"META-INF",
"org/apache/xerces/impl/xs/traversers",
"META-INF/maven",
"org/apache/xerces/xni",
"org/apache/xerces/impl",
"org/apache/xerces/impl/xs/util",
"META-INF/services",
"org/apache/xerces/xs",
"org/apache/xerces/xinclude",
"org/apache/xerces/impl/dv/xs",
"org/apache/xerces/jaxp/validation",
"org/apache",
"org/apache/xerces/impl/validation",
"org/apache/xml",
"org/apache/xerces/util",
"org/apache/xerces/stax/events",
"org/apache/xerces/impl/xs/identity",
"org/apache/xerces/impl/dtd",
"org/apache/wml/dom",
"org",
"org/apache/xerces/jaxp",
"org/apache/xerces/impl/xs/models",
"org/apache/xml/serialize",
"org/apache/xerces/impl/xpath",
"org/apache/xerces/impl/msg",
"org/apache/xerces/jaxp/datatype",
"org/apache/xerces",
"org/apache/xerces/impl/dtd/models",
"org/apache/xerces/impl/xs",
"org/apache/xerces/impl/xs/opti",
"org/apache/xerces/stax"
]
},
{
"type" => "org.jboss.modules.NativeLibraryResourceLoader",
"paths" => undefined
}
]
}
}
I have another server where deploying this war doesn't cause error.
I can compare them, but I can't see any difference.(in standalone.xml particulary).
The jar and main/module.xml are the same on two servers. The acl are identicals.
cat ~/modules/system/layers/base/org/apache/xerces/main/module.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2011, Red Hat, Inc., and individual contributors
~ as indicated by the #author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<module name="org.apache.xerces" xmlns="urn:jboss:module:1.8">
<resources>
<resource-root path="xercesImpl-2.12.0.SP02.jar"/>
</resources>
<dependencies>
<module name="jdk.xml.dom"/>
<module name="java.xml"/>
</dependencies>
</module>
ll ./modules/system/layers/base/org/apache/xerces/main/
total 1800
-rw-r--r-- 1 wildfly-flux wildfly-flux 1366 Jul 3 11:33 module.xml
-rw-r--r-- 1 wildfly-flux wildfly-flux 1835126 Jul 3 11:33 xercesImpl-2.12.0.SP02.jar
jar -tvf ./modules/system/layers/base/org/apache/xerces/main/xercesImpl-2.12.0.SP02.jar |grep SAX
...
2177 Fri Aug 24 11:10:24 CEST 2018 org/apache/xerces/parsers/SAXParser.class
...
9918 Fri Aug 24 11:10:26 CEST 2018 org/apache/xerces/jaxp/SAXParserImpl.class
...
I cannot edit code of the deploying war, I'm not the developer, but I can de-compile it.
I noticed the only reference about org.apache.xerces is:
package org.springframework.instrument.classloading;
...
/**
* ClassLoader decorator that shadows an enclosing ClassLoader,
* applying registered transformers to all affected classes.
...
public class ShadowingClassLoader extends DecoratingClassLoader {
/** Packages that are excluded by default */
public static final String[] DEFAULT_EXCLUDED_PACKAGES =
new String[] {"java.", "javax.", "sun.", "oracle.", "com.sun.", "com.ibm.", "COM.ibm.",
"org.w3c.", "org.xml.", "org.dom4j.", "org.eclipse", "org.aspectj.", "net.sf.cglib",
"org.springframework.cglib", "org.apache.xerces.", "org.apache.commons.logging."};
Does somebody can help ?
Where should I look to ?

I have re-install completely wildfly. The problem doesn't occur any more.

Related

WFLYCTL0180: Services with missing/unavailable dependencies in Wildfly 26 with EJB SecurityDomain annotation

We've got an application with several web services annotated with #SecurityDomain("our-ws") (I've also tried setting this in jboss-web.xml). For example:
#Stateless
#Interceptors(OurTransactionInterceptor.class)
#WebService(targetNamespace = "...", portName = "AddStuff", serviceName = "AddStuffService")
#SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
#WebContext(authMethod = "BASIC", contextRoot = "/service", urlPattern = "/AddStuffService")
#SecurityDomain("our-ws")
public class AddStuffService { ... }
We are upgrading to Wildfly 26, and attempting to use elytron following the example from
WildFly Elytron Security, section 4.1.3. However, on startup, I'm getting an error like:
13 Jan 2023 11:26:01,763 ERROR [management-operation Controller Boot Thread] WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "service.war")]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.security.security-domain.our-ws"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"service.war\".component.AddStuffService.CREATE is missing [jboss.security.security-domain.our-ws]"]
}
In standalone.xml, under <subsystem xmlns="urn:wildfly:elytron:15.1"...> We've got a datasource, which I'll call 'ourDS' (not shown) used by a jdbc-realm, jdbc:
<jdbc-realm name="jdbc">
<principal-query sql="SELECT password FROM CFG_WS_USERS_T WHERE username=?" data-source="evercoreDS">
<clear-password-mapper password-index="1"/>
</principal-query>
<principal-query sql="SELECT roles from CFG_WS_ROLES_T r join CFG_WS_USERS_T u on u.WS_USERS_PK=r.WS_USERS_FK where u.username=?" data-source="ourDS">
<attribute-mapping>
<attribute to="roles" index="1"/>
</attribute-mapping>
</principal-query>
</jdbc-realm>
And a security-domain for those web services:
<security-domain name="our-ws" default-realm="jdbc" permission-mapper="default-permission-mapper">
<realm name="jdbc" role-decoder="groups-to-roles"/>
</security-domain>
So I don't get why jboss.security.security-domain.our-ws is not installed (unless, maybe, it is looking for it in the legacy security configuration.).
How, do I get the SecurityDomain annotation (or the security-domain tag in jboss-web.xml) to refer to the elytron configuration, or why would my security-domain under elytron not be installed?
EDIT: In response to #ehsavoie's comment, I'll note that, per section 4.1.3 of the doc, we also have an http-authentication-factory and application-security-domain:
<http-authentication-factory name="our-ws-http-auth" security-domain="our-ws" http-server-mechanism-factory="global">
<mechanism-configuration>
<mechanism mechanism-name="BASIC">
<mechanism-realm realm-name="our-ws"/>
</mechanism>
</mechanism-configuration>
</http-authentication-factory>
<application-security-domains>
<application-security-domain name="defaultASD" security-domain="ApplicationDomain"/>
<application-security-domain name="our-ws-appsecurity-domain" http-authentication-factory="our-ws-http-auth"/>
</application-security-domains>
(I'm a bit confused by the mechanism-realm realm-name="our-ws", since our-ws is not a security-realm, but a security-domain, but it follows the documentation - again section 4.1.3-- and I also tried using the jdbc security-realm there, with the the same error.)

Importing tensorflow into Scala

I have installed Tensorflow for Scala on my OSX, and although everything seemed fine, I have a NoClassDefFoundError when trying to run simple example like that –
import org.platanios.tensorflow.api.Tensor
val tensor = Tensor( 1.2, 4.5)
which gives:
java.lang.NoClassDefFoundError: Could not initialize class org.platanios.tensorflow.api.package$
at #worksheet#.tensor$lzycompute(testone.sc:3)
at #worksheet#.tensor(testone.sc:3)
at #worksheet#.get$$instance$$tensor(testone.sc:3)
at A$A16$.main(testone.sc:17)
at A$A16.main(testone.sc)
at #worksheet#.#worksheet#(testone.sc)
Similar error both on a Jupyter Notebook and an IntelliJ worksheet. My build.sbt:
scalaVersion := "2.12.4"
resolvers += Resolver.sonatypeRepo("snapshots")
libraryDependencies += "org.platanios" %% "tensorflow" % "0.1.2-SNAPSHOT"
libraryDependencies += "org.platanios" %% "tensorflow" % "0.1.2-SNAPSHOT" classifier "darwin-cpu-x86_64"
The problem could be due to a missing dependency library of libtensorflow_jni.so contained by the scala_tensorflow jar
To find the missing library:
sbt console
then from the scala shell import the tensorflow api:
scala> import org.platanios.tensorflow.api._
scala> val tensor = Tensor.zeros(INT32, Shape(2, 5))
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/angelo/.ivy2/cache/org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.7.16.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/angelo/.ivy2/cache/ch.qos.logback/logback-classic/jars/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
log4j:WARN No appenders could be found for logger (TensorFlow Native).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
java.lang.UnsatisfiedLinkError: /tmp/tensorflow_scala_native_libraries3327494822622243889/libtensorflow_jni.so: libcusolver.so.9.0: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at org.platanios.tensorflow.jni.TensorFlow$$anonfun$load$3.apply(TensorFlow.scala:95)
at org.platanios.tensorflow.jni.TensorFlow$$anonfun$load$3.apply(TensorFlow.scala:93)
at scala.Option.foreach(Option.scala:257)
at org.platanios.tensorflow.jni.TensorFlow$.load(TensorFlow.scala:93)
at org.platanios.tensorflow.jni.TensorFlow$.<init>(TensorFlow.scala:155)
at org.platanios.tensorflow.jni.TensorFlow$.<clinit>(TensorFlow.scala)
at org.platanios.tensorflow.jni.Tensor$.<init>(Tensor.scala:24)
at org.platanios.tensorflow.jni.Tensor$.<clinit>(Tensor.scala)
at org.platanios.tensorflow.api.tensors.Context$.apply(Context.scala:50)
at org.platanios.tensorflow.api.package$.<init>(package.scala:89)
at org.platanios.tensorflow.api.package$.<clinit>(package.scala)
... 40 elided
You can check all the missing libraries using ldd on another terminal (ldd in linux or otool -L on macosx):
ldd /tmp/tensorflow_scala_native_libraries3327494822622243889/libtensorflow_jni.so
/tmp/tensorflow_scala_native_libraries3327494822622243889/libtensorflow_jni.so: /usr/lib/libcublas.so.9.0: version `libcublas.so.9.0' not found (required by /tmp/tensorflow_scala_native_libraries3327494822622243889/libtensorflow.so)
/tmp/tensorflow_scala_native_libraries3327494822622243889/libtensorflow_jni.so: /usr/lib/libcublas.so.9.0: version `libcublas.so.9.0' not found (required by /tmp/tensorflow_scala_native_libraries3327494822622243889/libtensorflow_framework.so)
linux-vdso.so.1 => (0x00007ffc00d85000)
libdlfaker.so => /usr/lib/x86_64-linux-gnu/libdlfaker.so (0x00007f0cd05d8000)
librrfaker.so => /usr/lib/x86_64-linux-gnu/librrfaker.so (0x00007f0cd033d000)
libtensorflow.so => /tmp/tensorflow_scala_native_libraries3327494822622243889/libtensorflow.so (0x00007f0cc8023000)
libtensorflow_framework.so => /tmp/tensorflow_scala_native_libraries3327494822622243889/libtensorflow_framework.so (0x00007f0cc714b000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0cc6dc9000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f0cc6bb3000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0cc67e9000)
libGL.so.1 => /usr/lib/nvidia-390/libGL.so.1 (0x00007f0cc64ac000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0cc62a8000)
libturbojpeg.so.0 => /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0 (0x00007f0cc6047000)
libXv.so.1 => /usr/lib/x86_64-linux-gnu/libXv.so.1 (0x00007f0cc5e42000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f0cc5b08000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f0cc58f6000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0cc56d9000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0cc53d0000)
/lib64/ld-linux-x86-64.so.2 (0x00007f0cd0a66000)
libcublas.so.9.0 => /usr/lib/libcublas.so.9.0 (0x00007f0cc1caf000)
libcusolver.so.9.0 => not found
libcudart.so.9.0 => not found
libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f0cc1a8d000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f0cc1885000)
libcuda.so.1 => /usr/lib/x86_64-linux-gnu/libcuda.so.1 (0x00007f0cc0ce5000)
libcudnn.so.7 => /usr/local/cuda-9.1/targets/x86_64-linux/lib/libcudnn.so.7 (0x00007f0cafd54000)
libcufft.so.9.0 => not found
libcurand.so.9.0 => not found
libcudart.so.9.0 => not found
libnvidia-tls.so.390.30 => /usr/lib/nvidia-390/tls/libnvidia-tls.so.390.30 (0x00007f0cafb50000)
libnvidia-glcore.so.390.30 => /usr/lib/nvidia-390/libnvidia-glcore.so.390.30 (0x00007f0cadd50000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f0cadb2e000)
libnvidia-fatbinaryloader.so.390.30 => /usr/lib/nvidia-390/libnvidia-fatbinaryloader.so.390.30 (0x00007f0cad8e2000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f0cad6de000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f0cad4d8000)
On my computer the rutime linking process cannot resolve libcusolver.so.9.0 since I have installed cuda-9.1
To make it working I had to compile tensorflow as follows:
git clone https://github.com/tensorflow/tensorflow.git
cd tensorflow
./configure
bazel build --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" --config=opt //tensorflow:libtensorflow.so
Copy the libraries into a path which is in LD_LIBRARY_PATH:
sudo cp bazel-bin/tensorflow/libtensorflow.so /usr/local/lib
sudo cp bazel-bin/tensorflow/libtensorflow_framework.so /usr/local/lib
Finally I was able to compile the tensorflow_scala project:
sbt compile
Now from the tensorflow_scala project I can run sbt console and it works:
scala> import org.platanios.tensorflow.api._
import org.platanios.tensorflow.api._
scala> val tensor = Tensor.zeros(INT32, Shape(2, 5))
2018-02-16 17:08:26.184 [run-main-0] INFO TensorFlow Native - Extracting the 'tensorflow_jni' native library to /tmp/tensorflow_scala_native_libraries8283851378265055495/libtensorflow_jni.so.
2018-02-16 17:08:26.188 [run-main-0] INFO TensorFlow Native - Copied 645872 bytes to /tmp/tensorflow_scala_native_libraries8283851378265055495/libtensorflow_jni.so.
2018-02-16 17:08:26.254 [run-main-0] INFO TensorFlow Native - Extracting the 'tensorflow_ops' native library to /tmp/tensorflow_scala_native_libraries8283851378265055495/libtensorflow_ops.so.
2018-02-16 17:08:26.254 [run-main-0] INFO TensorFlow Native - Copied 78232 bytes to /tmp/tensorflow_scala_native_libraries8283851378265055495/libtensorflow_ops.so.
2018-02-16 17:08:26.449239: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:898] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-02-16 17:08:26.449483: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1331] Found device 0 with properties:
name: GeForce GTX 1050 major: 6 minor: 1 memoryClockRate(GHz): 1.493
pciBusID: 0000:01:00.0
totalMemory: 3,95GiB freeMemory: 1,53GiB
2018-02-16 17:08:26.449498: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1410] Adding visible gpu devices: 0
2018-02-16 17:08:26.670568: I tensorflow/core/common_runtime/gpu/gpu_device.cc:911] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-02-16 17:08:26.670601: I tensorflow/core/common_runtime/gpu/gpu_device.cc:917] 0
2018-02-16 17:08:26.670610: I tensorflow/core/common_runtime/gpu/gpu_device.cc:930] 0: N
2018-02-16 17:08:26.670698: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1021] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 1287 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050, pci bus id: 0000:01:00.0, compute capability: 6.1)
2018-02-16 17:08:26.698355: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1410] Adding visible gpu devices: 0
2018-02-16 17:08:26.698399: I tensorflow/core/common_runtime/gpu/gpu_device.cc:911] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-02-16 17:08:26.698408: I tensorflow/core/common_runtime/gpu/gpu_device.cc:917] 0
2018-02-16 17:08:26.698414: I tensorflow/core/common_runtime/gpu/gpu_device.cc:930] 0: N
2018-02-16 17:08:26.698518: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1021] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 224 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050, pci bus id: 0000:01:00.0, compute capability: 6.1)
tensor: org.platanios.tensorflow.api.tensors.Tensor = INT32[2, 5]
To use the locally built tensorflow_scala:
sbt
sbt:TensorFlow for Scala> + publishLocal
The jar will be placed into ~/.ivy2/local/org.platanios ; then you can add the jar to your sbt project e.g:
libraryDependencies ++= { Seq("org.platanios" %% "tensorflow" % "0.1.2-SNAPSHOT") }

WildFly10 - unable to deploy my ears

Unable to deploy my ears into WildFly10.0.0 and same ear working fine in JBoss7.1.1 server. Here are the details of my project and error which i'm facing while adding my ear to server. Jar file used in ejbModule to prepare ear file attached as a screen shot. Giving an exception while adding it to server. same ear working fine in JBoss7.1.1 Final version.
**jboss-deployment-structure.xml**
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="com.hway.blz.fm" export="true"/>
<module name="com.hway.blz.common" export="true"/>
<module name="com.blazesoft" export="true"/>
<module name="com.thoughtworks" export="true"/>
<module name="org.jboss.ws.cxf.jbossws-cxf-client" services="true" export="true"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
fm-web.jar:
Jar having two classes to expose my object model as wsdl using RPC\soap binding
\fm-web\ejbModule\com\hway\blz\fm\Fmbean.java
[Error details provided in the attached screen shot][1] Pls. help me on this issue resolution.
Dismiss
Wed Apr 19 21:51:18 GMT-500 2017
Unable to assign fm-rules.ear.
Unexpected HTTP response: 500
Request
{
"operation" => "composite",
"address" => undefined,
"steps" => [{
"operation" => "add",
"address" => [
("server-group" => "main-server-group"),
("deployment" => "fm-rules.ear")
],
"runtime-name" => "fm-rules.ear",
"enabled" => true
}]
}
Response
Internal Server Error
{
"outcome" => "failed",
"result" => {"step-1" => {
"outcome" => "failed",
"rolled-back" => true
}},
"failure-description" => {"WFLYDC0074: Operation failed or was rolled back on all servers. Server failures:" => {"server-group" => {"main-server-group" => {"host" => {"master" => {
"server-one" => {"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => {"WFLYCTL0080: Failed services" => {
"jboss.module.service.\"deployment.fm-rules.ear\".main" => "org.jboss.msc.service.StartException in service jboss.module.service.\"deployment.fm-rules.ear\".main: WFLYSRV0179: Failed to load module: deployment.fm-rules.ear:main
Caused by: org.jboss.modules.ModuleNotFoundException: com.hway.blz.fm:main",
"jboss.module.service.\"deployment.fm-rules.ear.fm-web.jar\".main" => "org.jboss.msc.service.StartException in service jboss.module.service.\"deployment.fm-rules.ear.fm-web.jar\".main: WFLYSRV0179: Failed to load module: deployment.fm-rules.ear.fm-web.jar:main
Caused by: org.jboss.modules.ModuleNotFoundException: com.hway.blz.fm:main"
}}}},
"server-two" => {"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => {"WFLYCTL0080: Failed services" => {
"jboss.module.service.\"deployment.fm-rules.ear.fm-web.jar\".main" => "org.jboss.msc.service.StartException in service jboss.module.service.\"deployment.fm-rules.ear.fm-web.jar\".main: WFLYSRV0179: Failed to load module: deployment.fm-rules.ear.fm-web.jar:main
Caused by: org.jboss.modules.ModuleNotFoundException: com.hway.blz.fm:main",
"jboss.module.service.\"deployment.fm-rules.ear\".main" => "org.jboss.msc.service.StartException in service jboss.module.service.\"deployment.fm-rules.ear\".main: WFLYSRV0179: Failed to load module: deployment.fm-rules.ear:main
Caused by: org.jboss.modules.ModuleNotFoundException: com.hway.blz.fm:main"
}}}}
}}}}}}
[1]: https://i.stack.imgur.com/UEP0O.png
[1]: https://i.stack.imgur.com/W9WHi.png
It looks like you're missing a module Caused by: org.jboss.modules.ModuleNotFoundException: com.hway.blz.fm:main. You'll need to make sure that module is installed in the $JBOSS_HOME/modules directory.

Archiva deployment on wildfly 10

I have the following problem when i try to deploy archiva 2.2.1 on wildfly 10.
Can someone help me to resolve it ?
Unexpected HTTP response: 500
Request
{
"operation" => "deploy",
"address" => [("deployment" => "archiva.war")]
}
Response
Internal Server Error
{
"outcome" => "failed",
"failure-description" => {"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.archiva.archiva.env.mail.Session is missing [jboss.naming.context.java.jboss.resources.mail.Session]"]},
"rolled-back" => true
}
You need to specify the JNDI name in your WEB-INF/web.xml file in the archiva JAR.
<resource-ref>
<res-ref-name>mail/Session</res-ref-name>
<res-type>javax.mail.Session</res-type>
<jndi-name>java:jboss/mail/Default</jndi-name>
</resource-ref>
You can find the JNDI name by referring to the standalone/configurations/standalone-full.xml.
<subsystem xmlns="urn:jboss:domain:mail:2.0">
<mail-session name="default" jndi-name="java:jboss/mail/Default">
<smtp-server outbound-socket-binding-ref="mail-smtp"/>
</mail-session>
</subsystem>
Note the JNDI name of the mail session is java:jboss/mail/Default.

Zend Framework 2 SOAP server WSDL failed to load

I can't get the SOAP server working in Zend Framework 2 module. I am not completely sure, but I believe that the problem is the WSDL file. I try to create the WSDL file via Autodiscover, which is provided by the Zend Framework. Here is the error.log:
[Fri Apr 19 20:39:29 2013] [error] [client 172.23.31.109] PHP Warning: SoapServer::SoapServer(): I/O warning : failed to load external entity "http-LINK/services?wsdl" in /PATH/public_html/vendor/zendframework/zendframework/library/Zend/Soap/Server.php on line 749
[Fri Apr 19 20:39:29 2013] [error] [client 172.23.31.109] PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http-LINK/services?wsdl' : failed to load external entity "http-LINK/services?wsdl"\n in /PATH/public_html/vendor/zendframework/zendframework/library/Zend/Soap/Server.php on line 749
I added an own module for this services test, this is the structure, module is called "Services":
-Services
--config
---module.config.php
--src
---Services
----API
-----1.0
------servicesAPI.php
---Controller
----ServicesController.php
--view
---services
----serivces
-Module.php
-autoload_classmap.php
This is my file "servicesAPI.php"
class servicesAPI {
/**
* This method takes a value and gives back the md5 hash of the value
*
* #param String $value
* #return String
*/
public function md5Value($value) {
return md5($value);
}
}
And this is ServicesController.php:
namespace Services\Controller;
ini_set("soap.wsdl_cache_enabled", 0);
use Zend\Mvc\Controller\AbstractActionController;
use Zend\Soap\AutoDiscover;
use Zend\Soap\Server;
require_once __DIR__ . '/../API/1.0/servicesAPI.php';
class ServicesController extends AbstractActionController {
private $_options;
private $_URI = "http-LINK/services";
private $_WSDL_URI = "http-LINK/services?wsdl";
public function indexAction() {
if (isset($_GET['wsdl'])) {
$this->handleWSDL();
} else {
$this->handleSOAP();
}
}
private function handleWSDL() {
$autodiscover = new AutoDiscover();
$autodiscover->setClass('servicesAPI')
->setUri($this->_URI);
$autodiscover->handle();
}
private function handleSOAP() {
$soap = new Server($this->_WSDL_URI);
$soap->setClass('servicesAPI');
$soap->handle();
}
}
So when I deploy this and open http-LINK/services in the browser, it gives me the following:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>WSDL</faultcode>
<faultstring>
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http-LINK/services?wsdl' : failed to load external entity "http-LINK/services?wsdl"
</faultstring>
<detail/>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
On this call also the PHP error output is written!
If I try to open the services?wsdl in browser, it shows me this (chrome and safari):
This page contains the following errors:
error on line 3 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.
This method takes a value and gives back the md5 hash of the value
But if I inspect the element, it looks completely ok:
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http-LINK/services" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="servicesAPI" targetNamespace="http-LINK/services"><types><xsd:schema targetNamespace="http-LINK/services"/></types><portType name="servicesAPIPort"><operation name="md5Value"><documentation>This method takes a value and gives back the md5 hash of the value</documentation><input message="tns:md5ValueIn"/><output message="tns:md5ValueOut"/></operation></portType><binding name="servicesAPIBinding" type="tns:servicesAPIPort"><soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/><operation name="md5Value"><soap:operation soapAction="http-LINK/services#md5Value"/><input><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http-LINK/services"/></input><output><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http-LINK/services"/></output></operation></binding><service name="servicesAPIService"><port name="servicesAPIPort" binding="tns:servicesAPIBinding"><soap:address location="http-LINK/services"/></port></service><message name="md5ValueIn"><part name="value" type="xsd:string"/></message><message name="md5ValueOut"><part name="return" type="xsd:string"/></message></definitions>
I can validate this xml with any xml validator, it seems to be valid.
I read all the posts concerning this on stackoverflow, searched google, but none of the solutions helped me. Here a short list of what else I tried:
According to this: https://bugs.php.net/bug.php?id=48216 I tried to save the wsdl xml to a file and open it from this file when starting the soap server, fail
I tried to run the autodiscover and soapserver statements with try/catch to catch any exceptions, nothing appears
I tried with echo-ing through toXML() and other outputs, fail
Used XMLReader::open and isValid to make sure, that the xml is valid (it is)
Some more information:
PHP Version 5.3.23
Ubuntu server 11.04
php-soap module is loaded
Zend Framework version 2.1.4
Any help or hints are appreciated. Thanks in advance.
Try instantiate the Soap Server class this way:
...
private function handleSOAP() {
$soap = new Server(
null, array(,
'wsdl' => http-LINK/services?wsdl,
)
);
$soap->setClass('servicesAPI');
$soap->handle();
}
....
Also you should add this line to the end of your indexAction()
return $this->getResponse();
.. it disables the layout.