I'm trying to deploy my application to a Wildfly Application server but I keep getting the following error:
Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.1.0.Alpha1:deploy (default) on project medical-api:
Deployment failed: Operation failed: {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" =>
{
"Operation step-2" => {"JBAS014671: Failed services" =>
{
"jboss.deployment.unit.medical-api-ian.POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.medical-api-ian.POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment \"medical-api-ian\" Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException: dao.MaternityPlanDaoJpaImpl from [Module \"deployment.medical-api-ian:main\" from Service Module Loader] Caused by: java.lang.ClassNotFoundException: dao.MaternityPlanDaoJpaImpl from [Module \"deployment.medical-api-ian:main\" from Service Module Loader]"}
}
}
} -> [Help 1]
The class MaternityPlanDaoJpaImpl is in my folder structure I can see it clearly so I'm confused as to why it's throwing this error.
For shits and giggles I deleted the class and then it chose to throw the same exception about a different class in a different package.
Thanks in advance for any help.
First, change to the version 8.2.0.Final or 9.0.0.CR2.
Many Bugs Fixed since 8.1.0-Final version.
https://issues.jboss.org/browse/WFLY/?selectedTab=com.atlassian.jira.jira-projects-plugin:changelog-panel
You can see examples of use here.
https://github.com/wildfly/quickstart
Use the stable version of wildfly-maven-plugin.
<dependency>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.0.2.Final</version>
</dependency>
Note:
Possibly you are compiling with a JDK version that is not supported by WildFly.
You may be compiling with a version and running with a version in another.
I recommend you use the latest most stable version JDK if possible.
make a jar file using ant build and put it in WEB-INF/lib or WEB-INF/class folder in your war folder
use ant to compile or make jar with ant put jar files or class file in
deployment folder\war-folder\WEB_INF\lib or classes folder
Related
When trying to deploy EJB with Arquillian, ShrikWrap it causes the following issue:
Service jboss.naming.context.java.module.test.test.EJBContext is already registered
The reason found when debugging was that, we were using separate custom EJBContext class in our context and somehow Arquillian's ShrinkWrap deploys a test.war which tries to re-register EJBContext which is then failing to complete the deployment process.
Throughout the debugging following bidingName is trying to redeploy to the container ("java:module/EJBContext")
My question is; Is there any way to avoid such duplication of deployment with Arquillian. or any better solution how to overcome this issue?
Used sample custom Context for EJB:
#Singleton
public class EJBContext
{
public EJBContext() {
}
}
Error log:
org.jboss.arquillian.container.spi.client.container.DeploymentException: Cannot deploy test.war: {"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"test.war\".INSTALL" => "WFLYSRV0153: Failed to process phase INSTALL of deployment \"test.war\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEE0052: Failed to install component EJBContext
Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.naming.context.java.module.test.test.EJBContext is already registered"},"WFLYCTL0412: Required services that are not installed:" => ["jboss.deployment.unit.\"test.war\".beanmanager","jboss.deployment.unit.\"test.war\".WeldStartService"],"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"test.war\".batch.artifact.factory is missing [jboss.deployment.unit.\"test.war\".beanmanager]","jboss.deployment.unit.\"test.war\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"test.war\".beanmanager, jboss.deployment.unit.\"test.war\".WeldStartService]"]}}}
I've got an EAR file which contains two wars and multiple jars. I'm using maven-ear-plugin to generate this file.
All jars are added in lib. There are few local jars and I'm adding them directly under EAR file. I've 2 local jars with a different name but contains the same package say abc.jar and xyz.jar
When I deploy this file on server I get following error:
"{\"WFLYCTL0080: Failed services\" => {\"jboss.mbean.service.publish:service=StreamReceiverStartup.start\" => \"org.jboss.msc.service.StartException in service jboss.mbean.service.publish:service=StreamReceiverStartup.start: WFLYSAR0001: Failed to execute legacy service start() method
Caused by: java.lang.reflect.InvocationTargetException
Caused by: java.lang.NoClassDefFoundError: <package_name>/<class_file>
Caused by: java.lang.ClassNotFoundException: <class_file> from [Module \\\"deployment.<ear_file_name>.ear.<jar_name>.jar:main\\\" from Service Module Loader]\"}}"
It's trying to detect from abc.jar instead xyz.jar which contains .
How to resolve this conflict? I tried removing one of the jar files. It results in the same exception but for a different class file, so I cannot discard any of these jars.
This is fixed by removing jars from application.xml
This question is asked before, I know, but I have a special case which doesn't seem to fall under the other answers.
I already have two web apps who packages and deploys on to my JBoss EAP 7.x as expected. My third attempt, however, will not work. Here are where it is different from the other two:
It was originally created as a standard maven archetype, and not a web app archetype (jar pancaking not war). It is simply an auto-updating tool, which runs scheduled updates on data. It is not meant to host any pages, but I needed to code it as a web application, as it seemed the easiest way to deploy to a web application server, given my current knowledge and coding skills. I converted it using the Project Facets tab in project properties.
The web.xml does not include any servlets, but it does contain a ServletContextListener, which starts the update loop.
When I try to deploy my war-file, I get the following error:
Cannot upload deployment: {"WFLYCTL0080: Failed services" =>
{"jboss.undertow.deployment.default-server.default-host./auto-update-
tool.UndertowDeploymentInfoService" => "org.jboss.msc.service.StartException
in service jboss.undertow.deployment.default-server.default-host./auto-
update-tool.UndertowDeploymentInfoService: java.lang.ClassNotFoundException:
servlet.ServletContextListener from [Module \"deployment.auto-update-
tool.war:main\" from Service Module Loader] Caused by:
java.lang.ClassNotFoundException: servlet.ServletContextListener from
[Module \"deployment.auto-update-tool.war:main\" from Service Module
Loader]"}}
These kind of messages are not new to me, but this time I am struggling to solve it.
Basics first: How do I import the javax.servlet API in my Eclipse project?
I have followed this to the point. I do have the JavaEE dependency in my pom file. That goes for all three of my projects. They all have scope provided:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
If i completely remove this, I get a packaging error in maven command line. If I only remove the provided scope line, I get another, but similar error:
Cannot upload deployment: {"WFLYCTL0080: Failed services" =>
{"jboss.deployment.unit.\"auto-update-tool.war\".POST_MODULE" =>
"org.jboss.msc.service.StartException in service
jboss.deployment.unit.\"auto-update-tool.war\".POST_MODULE: WFLYSRV0153:
Failed to process phase POST_MODULE of deployment \"auto-update-tool.war\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException:
java.lang.ClassNotFoundException: servlet.ServletContextListener from
[Module \"deployment.auto-update-tool.war:main\" from Service Module Loader]
Caused by: java.lang.ClassNotFoundException: servlet.ServletContextListener
from [Module \"deployment.auto-update-tool.war:main\" from Service Module
Loader]"}}
I've also tried to switch out my javax dependency, with what I believe is the same version implemented in JBoss 7.x:
<dependency>
<groupId>org.jboss.spec.javax.servlet</groupId>
<artifactId>jboss-servlet-api_3.1_spec</artifactId>
<version>1.0.1.Final</version>
<scope>provided</scope>
</dependency>
The error message is now gone, but replaced with a simple "Upload failed" with no error message whatsoever. I tried to look in the log files, but nothing there either. And I still find it strange that both my other applications work with the other javax dependency.
I am lost. Any advice on how to proceed from here?
I am not so into Maven and NetBeans (I used Eclipse and Ant in the past) and I have the following problem trying to deploy and execute on TomCat a web application that use Spring.
I have obtaine a project using the Maven feature named Project from Archetype and choosing the archetype specified from the tutorial (an archetype named entando-archetype-portal-bootstrap, that is an archetype that generate an Entando portal).
In the next NetBeans window I specified the project name as myfirstportal and as Group id I specified com.entando
I have no changed the default project path that is:
/home/andrea/NetBeansProjects/myfirstportal
Then, in the NetBeans projects tab I select my project and I perform the Maven Clean and build task that works for some seconds and that correctly end with a BUILD SUCCESS message.
So it seems that the build process is ok.
Then I select my project and I perform Run, so I choose my TomCat installation.
The starting process start but at the end I always obtain this error message:
ebapp assembled in [9582 msecs]
Building war: /home/andrea/NetBeansProjects/myfirstportal/target/myfirstportal.war
--- tomcat7-maven-plugin:2.1:exec-war-only (war-build-standalone) # myfirstportal ---
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 31.067s
Finished at: Thu Jul 02 18:23:41 CEST 2015
Final Memory: 48M/233M
------------------------------------------------------------------------
NetBeans: Deploying on Apache Tomcat or TomEE
profile mode: false
debug mode: false
force redeploy: true
Checking data source definitions for missing JDBC drivers...
Undeploying ...
undeploy?path=/myfirstportal
OK - Undeployed application at context path /myfirstportal
In-place deployment at /home/andrea/NetBeansProjects/myfirstportal/target/myfirstportal
Deployment is in progress...
deploy?config=file%3A%2Ftmp%2Fcontext5305066681099450691.xml&path=/myfirstportal
FAIL - Deployed application at context path /myfirstportal but context failed to start
As you can see at the end the process fail with this specific error message:
FAIL - Deployed application at context path /myfirstportal but context failed to start
So I investigated further opening the NetBeans Services window Right-click on the Tomcat Server and select View Server Log and here I obtain the exception that should cause failure:
03-Jul-2015 13:33:40.806 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
03-Jul-2015 13:33:41.546 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
03-Jul-2015 13:33:52.989 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.entando.entando.aps.servlet.StartupListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'InitializerManager' defined in class path resource [spring/baseSystemConfig.xml]: Invocation of init method failed; nested exception is java.lang.Exception: Error while initializating Db Installer
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
................................................................
................................................................
................................................................
Caused by: java.lang.Exception: Error while initializating Db Installer
at org.entando.entando.aps.system.init.InitializerManager.init(InitializerManager.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
................................................................
................................................................
................................................................
Caused by: java.lang.RuntimeException: Error while loading component installation report - version: production
at org.entando.entando.aps.system.init.InstallationReportDAO.loadReport(InstallationReportDAO.java:58)
at org.entando.entando.aps.system.init.AbstractInitializerManager.extractReport(AbstractInitializerManager.java:40)
... 66 more
Caused by: com.agiletec.aps.system.exception.ApsSystemException: Error getting connection to the datasource
at com.agiletec.aps.system.common.AbstractDAO.getConnection(AbstractDAO.java:64)
at org.entando.entando.aps.system.init.InstallationReportDAO.loadReport(InstallationReportDAO.java:40)
... 67 more
Caused by: java.sql.SQLException: Cannot load JDBC driver class 'org.apache.derby.jdbc.EmbeddedDriver'
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2043)
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:1939)
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1412)
at com.agiletec.aps.system.common.AbstractDAO.getConnection(AbstractDAO.java:61)
... 68 more
Caused by: java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2034)
... 71 more
03-Jul-2015 13:35:54.960 INFO [http-nio-8080-exec-14] org.apache.catalina.core.ApplicationContext.log Closing Spring root WebApplicationContext
It seems that it could depend by some database connectivity problem
What could be the problem? What am I missing? How can I try to fix it?
Tnx
EDIT 1:
So it seems to me that into the Dependencies folder of my NetBeans project (the one that contains all the jar download from Maven) I do'nt have the derby-10.x.x.x.jar file but into the pom.xml file I have this reference to the detby driver class:
<properties>
<!--
<test.database.driver>org.postgresql.Driver</test.database.driver>
<test.database.hostname>localhost</test.database.hostname>
<test.database.port>5432</test.database.port>
<test.database.username>agile</test.database.username>
<test.database.password>agile</test.database.password>
<test.database.port.url>jdbc:postgresql://${test.database.hostname}:${test.database.port}/${project.artifactId}testPort</test.database.port.url>
<test.database.serv.url>jdbc:postgresql://${test.database.hostname}:${test.database.port}/${project.artifactId}testServ</test.database.serv.url>
-->
<!--
<test.database.driver>com.mysql.jdbc.Driver</test.database.driver>
<test.database.hostname>localhost</test.database.hostname>
<test.database.port>3306</test.database.port>
<test.database.username>root</test.database.username>
<test.database.password>agile</test.database.password>
<test.database.port.url>jdbc:mysql://${test.database.hostname}:${test.database.port}/${project.artifactId}testPort</test.database.port.url>
<test.database.serv.url>jdbc:mysql://${test.database.hostname}:${test.database.port}/${project.artifactId}testServ</test.database.serv.url>
-->
<test.database.driver>org.apache.derby.jdbc.EmbeddedDriver</test.database.driver>
<test.database.hostname>localhost</test.database.hostname>
<test.database.port>1527</test.database.port>
<test.database.username>agile</test.database.username>
<test.database.password>agile</test.database.password>
<test.database.port.url>jdbc:derby:${project.build.directory}/test/db/${project.artifactId}testPort;create=true</test.database.port.url>
<test.database.serv.url>jdbc:derby:${project.build.directory}/test/db/${project.artifactId}testServ;create=true</test.database.serv.url>
<skipDerby>true</skipDerby>
<skipStandalone>true</skipStandalone>
<entando.version>4.2.0-TP1</entando.version>
<spring.version>4.0.6.RELEASE</spring.version>
<struts2.version>2.3.16.3</struts2.version>
<cxf.version>3.0.0-milestone2</cxf.version>
</properties>
As you can see the sections related to postgresql and to MySql DBMS are disablet, instead the one related to org.apache.derby.jdbc.EmbeddedDriver seems to be enabled.
And into the dependencies section I found:
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.9.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<version>10.9.1.0</version>
</dependency>
So I think that Maven should correctly download and configure the derby driver classes.
Why it seems that it have no dowload this jar?
It sais that the Driver was not found. In case of tomcat - put the driver jar into the libs folder and try to start it again.
EDIT: The way you provide the dependency, it is available only at compile time, but not in the resulting war. I think you should use something like assembly-plugin or shade-plugin in order to provide this jar inside war.
But if you look at the tomcat documentation... ta-daaa - (search for the word forget) - you should provide the driver jars to the lib folder.
Add maven dependencies to the java build path will resolve your error.
Go to add library and select maven dependencies in the java build path menu.
You need to derby-10.x.x.x.jarderby download to your class path/lib.
Hy,
I have a maven project.
mvn clean install
works perfect.
When deploying on my jboss server i receive this strange error:
Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: javax.ws.rs.core.Response
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 93 more
I've checked if artifact exists and it's there.
C:\Users\Cristian.m2\repository\org\jboss\resteasy\jaxrs-api\2.0-beta-4\
Does anyone have a work-around for this problem?
Your dependecy isn't in the deployed application. You may have to change the "provided" scope to "compile"
Resources :
Maven - Dependecy scope