Wildfly 10: Cannot upload deployment, Required services that are not installed - postgresql

Every time I deploy a war file in wildfly 10, I got this following error :
Cannot upload deployment: {"WFLYCTL0080: Failed services" =>
{"jboss.deployment.unit.\"member.war\".FIRST_MODULE_USE" =>
"org.jboss.msc.service.StartException in service
jboss.deployment.unit.\"member.war\".FIRST_MODULE_USE: WFLYSRV0153:
Failed to process phase FIRST_MODULE_USE of deployment \"member.war\"
Caused by:
org.jboss.as.server.deployment.DeploymentUnitProcessingException:
WFLYJCA0064: Exception deploying datasource java:/PostgresDS Caused
by: org.jboss.msc.service.DuplicateServiceException: Service
jboss.data-source.\"jboss.naming.context.java.PostgresDS\" is already
registered"},"WFLYCTL0412: Required services that are not installed:"
=> ["jboss.deployment.unit.\"member.war\".FIRST_MODULE_USE"],"WFLYCTL0180:
Services with missing/unavailable dependencies" => undefined}
It happens when I changed my persistence.xml and *-ds.xml which is telling my application to use the PostgresDS as its datasource.

Without looking at the files, it seems like you are registering your data source twice, once in the *-ds.xml and once in the persistence.xml (or maybe in the standalone.xml?).
Regarding missing/unavailable dependencies, are you certain the the Postgres SQL Module is installed in Wildfly and the driver is configured in the standalone.xml?
See also:
Wildfly DuplicateServiceException
How to add PostgreSQL datasource to WildFly 9.0?

Related

Java EE WFLYCTL0412 Required services that are not installed

Hi im trying to deploy a javaEE application in my wildfly server and when i try to run my server it throws me an exception about services that are not installed this happened any ideas what can be in conflict? Here is the output:
Deploying C:\wildfly-26.1.0.Final\standalone\deployments\ProyectoServidor.ear
{
"WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"ProyectoServidor.ear\".\"ProyectoEJB-ejb.jar\".POST_MODULE" => "WFLYSRV0153: Failed to process phase POST_MODULE of subdeployment \"ProyectoEJB-ejb.jar\" of deployment \"ProyectoServidor.ear\"
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class com.fannog.proyectoservidor.utils.Encryptor with ClassLoader ModuleClassLoader for Module \"deployment.ProyectoServidor.ear.ProyectoEJB-ejb.jar\" from Service Module Loader
Caused by: java.lang.NoClassDefFoundError: org/jasypt/util/password/StrongPasswordEncryptor
Caused by: java.lang.ClassNotFoundException: org.jasypt.util.password.StrongPasswordEncryptor from [Module \"deployment.ProyectoServidor.ear.ProyectoEJB-ejb.jar\" from Service Module Loader]"},
"WFLYCTL0412: Required services that are not installed:" => [
"jboss.deployment.unit.\"ProyectoServidor.ear\".WeldStartService",
"jboss.deployment.unit.\"ProyectoServidor.ear\".beanmanager"
],
"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"ProyectoServidor.ear\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"ProyectoServidor.ear\".beanmanager, jboss.deployment.unit.\"ProyectoServidor.ear\".WeldStartService]"]
}
C:\Users\facun\git\servidor\nbproject\build-impl.xml:330: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 6 seconds)
Your ejb is using org.jasypt.util.password.StrongPasswordEncryptor which is not provided in your application thus you are getting a ClassNotFoundException:
java.lang.ClassNotFoundException: org.jasypt.util.password.StrongPasswordEncryptor from [Module "deployment.ProyectoServidor.ear.ProyectoEJB-ejb.jar" from Service Module Loader]"},

Wildfly 22 - WFLYCTL0180: Services with missing/unavailable dependencies

In Wildfly 22.0.0 or later, the following error occurs.
2022-08-24 15:59:43,380 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "shcm")]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => [
"org.wildfly.clustering.cache.group.web.default-server",
"org.wildfly.clustering.cache.registry.web.default-server"
],
"WFLYCTL0180: Services with missing/unavailable dependencies" =>
["org.wildfly.clustering.web.route-locator.\"shcmupdate.war\" is missing
[org.wildfly.clustering.cache.registry.web.default-server,
org.wildfly.clustering.cache.group.web.default-server]"]
}
I have clustering configuration in web.xml and jboss-web.xml in my application.
if use standalone-ha.xml, it works normally.
but subsystem error occurs when standalone.xml is used from Wildfly 22.0.0 or later.
What changes were made in Wildfly 22?
Seems like it was never supported to be enable for non-standalone.xml builds, so it was likely removed in this PR (distributable-web.xml includes an Infinispan cache that distributable-web-local.xml does not).
The WildFly HA docs should be able to help you migrate to WF 22.
This was really unfortunate decision. It is killing EAP v. 7.4.5 (7.4.6) deployments.
I had replication-config as a part of jboss-web.xml file, that causes this issue. The application runs in ha mode in production, so the configuration is needed, but for the development there is no reason to maintain the whole cluster so I was happy the setting was ignored.
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_10_0.xsd"
version="10.0">
<context-root>my-application</context-root>
<!--
<replication-config>
<replication-granularity>ATTRIBUTE</replication-granularity>
</replication-config> -->
</jboss-web>
Commented out configuration is the part, that was causing the issue.

Wildfly 11 Elytron - Properties File Based Authentication failing with required services not installed

I have a new instance of Wildfly 11, where I am trying to setup Properties File Based Authentication within Elytron. I'm using the Standalone-full.xml and manually deploying the application outside of an IDE.
https://docs.jboss.org/author/display/WFLY/Properties+File+Based+Authentication+Migration
I created the myApp-user and myApp-roles properties files with name valued pairs and included #$REALM_NAME=myAppPropRealm$
I ran the following CLI commands to create the
Create Prop Realm
/subsystem=elytron/properties-realm=myAppPropRealm:add(groups-attribute=groups,groups-properties={path=myApp-roles.properties,relative-to=jboss.server.config.dir},users-properties={path=myApp-users.properties,relative-to=jboss.server.config.dir,plain-text=true})
Configure Security-Domain
/subsystem=elytron/security-domain=myAppSecurityDomain:add(realms=[{realm=myAppPropRealm,role-decoder=groups-to-roles}],default-realm=myAppPropRealm,permission-mapper=default-permission-mapper)
Configure http-authentication-factory
/subsystem=elytron/http-authentication-factory=myApp-http-auth:add(http-server-mechanism-factory=global,security-domain=myAppSecurityDomain,mechanism-configurations=[{mechanism-name=BASIC,mechanism-realm-configurations=[{realm-name=myApp_ApplicationDomain}]}])
Configure application-security-domain in Undertow
/subsystem=undertow/application-security-domain=myApp_ApplicationDomain:add(http-authentication-factory=myApp-http-auth)
JBoss-web.xml
</jboss-web>
<security-domain>myApp_ApplicationDomain</security-domain>
</jboss-web>
I get the following error when my app tries to deploy
2018-11-29 09:06:55,695 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "MyApplication-ws.war")]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.security.security-domain.myApp_ApplicationDomain"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
I suspect it is because I have not defined 'myApp_ApplicationDomain' but this is where I'm stuck. What commands do I run to add/reference
the myApp_ApplicationDomain?
Wildfly is looging for legacy security domain jboss.security.security-domain.myApp_ApplicationDomain for some reason. But seems you have correctly declared myApp_ApplicationDomain in undertow. Most probably you are using myApp_ApplicationDomain somewhere outside of undertow subsystem.

jasper server war deployment over jboss getting failed

I am trying to deploy jaserserver war on jsboss but its getting failded
war putted at location #location
`D:\Software\jboss-as-7.1.1.Final\standalone\deployments
jboss server log Server
15:18:24,371 ERROR [org.jboss.as.controller.management-operation] (Cont*roller Boot Thread) JBAS01461
2: Operation ("deploy") failed - address: ([("deployment" => "jasperserver.war")]) - failure descrip
tion: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.m
odule.jasperserver.jasperserver.env.jdbc.jasperserver is missing [jboss.naming.context.java.jdbc.jas
perserver]"]}*
I any clue what is going wrong ? i am running jboss server using standalone.bat (run as a administrator )

Wildfly 10 Not using database but getting a jpa error

I recently installed Wildfly-10.0.0.Final. To get my feet wet, I created an elementary EJB that does not require a database connection. For some reason when I try to deploy the EJB, I get the following error:
Cannot upload deployment: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"JavaEE_Wildfly1.jar\".
FIRST_MODULE_USE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.
\"JavaEE_Wildfly1.jar\".
FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment \"JavaEE_Wildfly1.jar\"
Caused by: javax.persistence.PersistenceException: WFLYJPA0057: PersistenceProvider 'org.eclipse.persistence.jpa.PersistenceProvider' not found"}}
Since I am not using a database, do I still have to specify a Persistence provider? I do not have a persistence.xml because I did not think I needed one.
I don't think you need a persistence.xml. Check out this EJB-In-A-War wildfly quickstart for an example of a #Stateless EJB deployed without a persistence.xml.