Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load module for org.postgresql #49

Open
zafinxueqian opened this issue Apr 18, 2017 · 6 comments
Open

Failed to load module for org.postgresql #49

zafinxueqian opened this issue Apr 18, 2017 · 6 comments

Comments

@zafinxueqian
Copy link

I created module.xml in
/opt/jboss/wildfly/modules/org/postgres/main and downloaded postgresql-9.4.1212.jar in the same folder.
Then I used my customer configuration file. I added datasource and postgres driver in it. But finally I got error:

ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 33) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("jdbc-driver" => "postgresql")
]) - failure description: "WFLYJCA0041: Failed to load module for driver [org.postgresql]"

I think is a bug for adding postgresql driver, thanks

@zafinxueqian
Copy link
Author

FROM jboss/wildfly

ENV JBOSS_HOME /opt/jboss/wildfly

USER root

RUN set -x
&& mkdir -p /opt/jboss/wildfly/modules/org/postgres/main
RUN curl -L https://jdbc.postgresql.org/download/postgresql-9.4.1212.jar -o /opt/jboss/wildfly/modules/org/postgres/main/postgresql-9.4.1212.jar

ADD module.xml /opt/jboss/wildfly/modules/org/postgres/main/

ADD standalone-zplatform.xml /opt/jboss/wildfly/standalone/configuration/

ADD com.zafin.zplatform.web-standard.war /opt/jboss/wildfly/standalone/deployments/

RUN chown -R jboss:0 /opt/jboss/wildfly/modules/org
&& chown -f jboss:0 /opt/jboss/wildfly/standalone/configuration/standalone-zplatform.xml
&& chmod +r /opt/jboss/wildfly/standalone/configuration/standalone-zplatform.xml
&& chown -f jboss:0 /opt/jboss/wildfly/standalone/deployments/com.zafin.zplatform.web-standard.war

USER jboss

CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-c", "standalone-zplatform.xml", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]

@swvajanyatek
Copy link

@zafinxueqian - did you ever get this resolved? I'm facing the same issue, and this seems to work fine for natively installed wildfly

@amaline
Copy link

amaline commented Dec 10, 2017

I have the same issue. This is driving me nuts.

@uenala
Copy link

uenala commented Jul 17, 2018

This worked in my case:

FROM jboss/wildfly

ENV JBOSS_HOME /opt/jboss/wildfly

#add some deployment
ADD some.war /opt/jboss/wildfly/standalone/deployments/

# add special standalone configuration with postgres datasource
ADD standalone-special.xml /opt/jboss/wildfly/standalone/configuration/

# use root user to download a copy of the postgres driver into a new modules directory
USER root

# download postgres driver
RUN set -x && mkdir -p /opt/jboss/wildfly/modules/system/layers/base/org/postgresql/main
RUN curl -L https://jdbc.postgresql.org/download/postgresql-42.2.2.jar -o /opt/jboss/wildfly/modules/system/layers/base/org/postgresql/main/postgresql-42.2.2.jar

# add postgres module
ADD module.xml /opt/jboss/wildfly/modules/system/layers/base/org/postgresql/main/

#use jboss user to start wildfly
USER jboss

# Start WildFly using the standalone mode
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-c", "standalone-special.xml", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]

@saschaiseli
Copy link

have a look at your permissions on folder /opt/jboss/wildfly/modules/system/layers/base/org/postgresql/. they should be the same as all other module permissions

@basmussen
Copy link

check the postgres driver jar file is not corrupted and a can be read by the java process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants