I am building an app with Gluon-mobile in InteliJ on Windows and having problems when I add additional dependencies via Maven. On Windows, when I add a new dependency to my pom file and try to run client:build from a command line I start getting getting java.lang.NoClassDefFoundError errors.
In this case I am trying to use the obs-websocket-java module and added the dependency in my pom file. I have tried other ones too and see to have the same problem.
Error Examples
[Tue Mar 09 16:39:58 GMT-08:00 2021][INFO] We will now compile your code for x86_64-microsoft-windows. This may take some time.
[Tue Mar 09 16:39:58 GMT-08:00 2021][INFO] [SUB] Warning: Ignoring server-mode native-image argument --no-server.
[Tue Mar 09 16:40:00 GMT-08:00 2021][INFO] [SUB] [org.jdf.teamdatacollect:20756] classlist: 1,404.15 ms, 0.96 GB
[Tue Mar 09 16:40:06 GMT-08:00 2021][INFO] [SUB] [org.jdf.teamdatacollect:20756] (cap): 4,533.88 ms, 0.95 GB
[Tue Mar 09 16:40:06 GMT-08:00 2021][INFO] [SUB] [org.jdf.teamdatacollect:20756] setup: 5,221.72 ms, 0.95 GB
[Tue Mar 09 16:40:06 GMT-08:00 2021][INFO] [SUB] Error: Error parsing reflection configuration in file:/C:/Users/joshu/IdeaProjects/TeamDataCollect/target/classes/META-INF%5cnative-image%5creflect-config.json:
[Tue Mar 09 16:40:06 GMT-08:00 2021][INFO] [SUB] Could not register net.twasi.obsremotejava.OBSCommunicator: allDeclaredMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/eclipse/jetty/websocket/api/Session. To allow unresolvable reflection configuration, use option -H:+AllowIncompleteClasspath
[Tue Mar 09 16:40:06 GMT-08:00 2021][INFO] [SUB] Verify that the configuration matches the schema described in the -H:PrintFlags=+ output for option ReflectionConfigurationResources.
[Tue Mar 09 16:40:06 GMT-08:00 2021][INFO] [SUB] com.oracle.svm.core.util.UserError$UserException: Error parsing reflection configuration in file:/C:/Users/joshu/IdeaProjects/TeamDataCollect/target/classes/META-INF%5cnative-image%5creflect-config.json:
[Tue Mar 09 16:40:06 GMT-08:00 2021][INFO] [SUB] Could not register net.twasi.obsremotejava.OBSCommunicator: allDeclaredMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/eclipse/jetty/websocket/api/Session. To allow unresolvable reflection configuration, use option -H:+AllowIncompleteClasspath
[Tue Mar 09 16:40:06 GMT-08:00 2021][INFO] [SUB] Verify that the configuration matches the schema described in the -H:PrintFlags=+ output for option ReflectionConfigurationResources.
[
pom file
<modelVersion>4.0.0</modelVersion>
<groupId>org.jdf</groupId>
<artifactId>teamdatacollect</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>TeamDataCollect</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>
<javafx.version>15.0.1</javafx.version>
<attach.version>4.0.10</attach.version>
<client.plugin.version>0.1.38</client.plugin.version>
<javafx.plugin.version>0.0.5</javafx.plugin.version>
<mainClassName>org.jdf.TeamDataCollect</mainClassName>
</properties>
<dependencies>
<dependency>
<groupId>com.hierynomus</groupId>
<artifactId>sshj</artifactId>
<version>0.31.0</version>
</dependency>
<dependency>
<groupId>net.twasi</groupId>
<artifactId>obs-websocket-java</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq</groupId>
<artifactId>charm-glisten</artifactId>
<version>6.0.6</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>display</artifactId>
<version>${attach.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>lifecycle</artifactId>
<version>${attach.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>statusbar</artifactId>
<version>${attach.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>storage</artifactId>
<version>${attach.version}</version>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>util</artifactId>
<version>${attach.version}</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>Gluon</id>
<url>https://nexus.gluonhq.com/nexus/content/repositories/releases</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>${javafx.plugin.version}</version>
<configuration>
<mainClass>${mainClassName}</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>com.gluonhq</groupId>
<artifactId>client-maven-plugin</artifactId>
<version>${client.plugin.version}</version>
<configuration>
<target>${client.target}</target>
<attachList>
<list>display</list>
<list>lifecycle</list>
<list>statusbar</list>
<list>storage</list>
</attachList>
<reflectionList>
<list>org.jdf.views.CollectDataPresenter</list>
<list>org.jdf.views.SetupPresenter</list>
<list>org.jdf.views.StreamingPresenter</list>
</reflectionList>
<mainClass>${mainClassName}</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>desktop</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<client.target>host</client.target>
</properties>
<dependencies>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>display</artifactId>
<version>${attach.version}</version>
<classifier>desktop</classifier>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>lifecycle</artifactId>
<version>${attach.version}</version>
<classifier>desktop</classifier>
</dependency>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>storage</artifactId>
<version>${attach.version}</version>
<classifier>desktop</classifier>
</dependency>
</dependencies>
</profile>
<profile>
<id>ios</id>
<properties>
<client.target>ios</client.target>
</properties>
</profile>
<profile>
<id>android</id>
<properties>
<client.target>android</client.target>
</properties>
</profile>
</profiles>
</project>
I have tried running the client:runagent but that doesn't seem to help. What I found in looking through the error logs is that the classpath in the classpathJar.jar manifest file which is in target\client\x86_64-windows\gvm\tmp does not contain all the jars that the obs-websocket-java modules depends on. If I run the native-image command by hand substituting a custom classpathJar.jar I am able to make further progress but still haven.t found a magic recipe to make it build
I have also found that the jni-config.json and reflect-config.json that is generated by the client:runagent seem to be missing many of the entries that I get when I run the Graalvm agent to generate these by hand. I don't know if this is related.
Is there a step that I am missing? Any and all help appreciated.
Joshua
Related
I wanted to compile groovy along with java sources so I added groovy-eclipse-compiler to pom.xml but I got an error:
Groovy-Eclipse: source level should be in '1.1'...'1.8','9'...'15' (or '5.0'..'15.0'): 17
pom.xml as follows:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.app</groupId>
<artifactId>mb2g-alt-jvm</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<classifier>indy</classifier>
<version>3.0.10</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version><!-- 3.6.2 is the minimum -->
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
<compilerArguments>
<indy/><!-- optional; supported by batch 2.4.12-04+ -->
<configScript>config.groovy</configScript><!-- optional; supported by batch 2.4.13-02+ -->
</compilerArguments>
<failOnWarning>true</failOnWarning><!-- optional; supported by batch 2.5.8-02+ -->
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>3.7.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>3.0.10-02</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<pluginRepositories>
<pluginRepository>
<id>groovy-plugins-release</id>
<url>https://groovy.jfrog.io/artifactory/plugins-release</url>
</pluginRepository>
</pluginRepositories>
</project>
Intellij Java Compiler Version: Java 17
Module Language Level: Java 17
Error Screenshot :
How can I solve it?
Thank you.
Groovy 3 does not suitably support Java 16+ and so groovy-eclipse-batch is currently capped at Java 15. You can set release (aka java.version in you pom) to 15 as indicated in the error message.
Or you can split Java and Groovy compilation in maven so you can set separate release targets.
I am writing simple Java backend using jersey and I want to deploy it to a virtual server, running Debian. I think, I have tomcat7 installed properly together with tomcat7-admin and also set the user roles correctly (manager-gui and manager-script).
I can see tomcat running, when I visit http://my-ip-address:8080. I also can access manager through http://my-ip-address:8080/manager/html, so I think the tomcat is configured properly.
The problem is that when I want to deploy my web application (using tomcat7-maven-plugin), the deployment itself doesn't work. here is trace from maven:
[INFO] tomcatManager status code:200, ReasonPhrase:OK
[INFO] FAIL - Failed to deploy application at context path /parser
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 29.826s
[INFO] Finished at: Sun Aug 28 11:50:07 CEST 2016
[INFO] Final Memory: 40M/97M
[INFO] ------------------------------------------------------------------------
Here is also the content of catalina log about the thing:
Aug 28, 2016 11:49:29 AM org.apache.catalina.util.LifecycleBase stop
INFO: The stop() method was called on component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/parser]] after stop() had already been called. The second call will be ignored.
Aug 28, 2016 11:49:30 AM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/parser]
Aug 28, 2016 11:50:06 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/parser.war
Aug 28, 2016 11:50:07 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/var/lib/tomcat7/webapps/parser/WEB-INF/lib/tomcat-el-api-7.0.47.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.class
Aug 28, 2016 11:50:07 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/var/lib/tomcat7/webapps/parser/WEB-INF/lib/tomcat-embed-core-7.0.47.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Aug 28, 2016 11:50:07 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/var/lib/tomcat7/webapps/parser/WEB-INF/lib/tomcat-servlet-api-7.0.47.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Aug 28, 2016 11:50:07 AM org.apache.catalina.startup.ContextConfig getServletContainerInitializer
SEVERE: The ServletContentInitializer [org.apache.tomcat.websocket.server.WsSci] could not be created
java.lang.ClassNotFoundException: org.apache.tomcat.websocket.server.WsSci
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:278)
at org.apache.catalina.startup.ContextConfig.getServletContainerInitializer(ContextConfig.java:1620)
at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1530)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1233)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:855)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:346)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5209)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:537)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1468)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1436)
at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:673)
at org.apache.catalina.manager.ManagerServlet.doPut(ManagerServlet.java:431)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1003)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Aug 28, 2016 11:50:07 AM org.apache.catalina.startup.ContextConfig processServletContainerInitializers
SEVERE: Failed to process JAR found at URL [jar:file:/var/lib/tomcat7/webapps/parser/WEB-INF/lib/tomcat-embed-core-7.0.47.jar!/] for ServletContainerInitializers for context with name [/parser]
Aug 28, 2016 11:50:07 AM org.apache.catalina.startup.ContextConfig configureStart
SEVERE: Marking this application unavailable due to previous error(s)
Aug 28, 2016 11:50:07 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error getConfigured
Aug 28, 2016 11:50:07 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/parser] startup failed due to previous errors
I have no idea what errors above means, because I was able to deploy this app to my local tomcat using idea (not maven-tomcat-plugin). I will try to provide as many information as needed, because I need to fix this rather quickly.
I read some threads about similar failures and there, the solution was to set the scope of javax.servlet-api to provided. In my pom.xml I didn't have this dependency, as jersey-servlet already has it as provided, so I have no other ideas on how to fix this.
Here is my actual pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.tryit</groupId>
<artifactId>parser</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>parser</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<kotlin.version>1.0.3</kotlin.version>
</properties>
<build>
<finalName>parser</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>7</source>
<target>7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>parser</warName>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<path>/parser</path>
<username>admin</username>
<password>pwd</password>
</configuration>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>process-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.23.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>2.23.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.ext.rx</groupId>
<artifactId>jersey-rx-client-rxjava</artifactId>
<version>2.23.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>2.23.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.22.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-kotlin</artifactId>
<version>2.7.5</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-web</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-email</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
</project>
Do you have any idea, how can I fix this?
Thanks in advance
You should have tomcat7-maven-plugin in plugins not in dependencies see the usage page. Remove from dependencies and try
I am trying to create a web project using spring framework. When trying to run the project, I am getting a HTTP Status 404 error in the browser.
Here is the stack trace of the problem from the console:
Apr 17, 2016 8:43:11 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.8.0_60\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jdk1.8.0_60/bin/../jre/bin/server;C:/Program Files/Java/jdk1.8.0_60/bin/../jre/bin;C:/Program Files/Java/jdk1.8.0_60/bin/../jre/lib/amd64;C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1263\opl\bin\x64_win64;C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1263\opl\oplide\;C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1263\cplex\bin\x64_win64;C:\Program Files\IBM\ILOG\CPLEX_Studio_Community1263\cpoptimizer\bin\x64_win64;C:\Program Files\Java\jdk1.8.0_60\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\Doctrine extensions for PHP\;C:\Program Files\OpenVPN\bin;C:\Program Files\Java\jdk1.8.0_60;C:\adb;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Zorba XQuery Processor 3.0.0\bin;C:\Program Files\Java\jdk1.8.0_60;C:\Program Files (x86)\SSH Communications Security\SSH Secure Shell;C:\Users\prati\AppData\Local\atom\bin;C:\Users\prati\Downloads\eclipse-jee-mars-R-win32-x86_64\eclipse;;.
Apr 17, 2016 8:43:11 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:CRUDWebAppMavenized' did not find a matching property.
Apr 17, 2016 8:43:11 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Apr 17, 2016 8:43:11 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Apr 17, 2016 8:43:11 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 656 ms
Apr 17, 2016 8:43:11 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 17, 2016 8:43:11 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.47
Apr 17, 2016 8:43:13 PM org.apache.catalina.core.ApplicationContext log
INFO: Set web app root system property: 'webapp.root' = [C:\Users\prati\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp6\wtpwebapps\CRUDWebAppMavenized\]
Apr 17, 2016 8:43:13 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing log4j from [classpath:log4j.xml]
Apr 17, 2016 8:43:13 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.util.Log4jConfigListener
java.lang.NoClassDefFoundError: org/apache/log4j/xml/DOMConfigurator
at org.springframework.util.Log4jConfigurer.initLogging(Log4jConfigurer.java:69)
at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:151)
at org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.xml.DOMConfigurator
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
... 12 more
Apr 17, 2016 8:43:13 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Apr 17, 2016 8:43:13 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/CRUDWebAppMavenized] startup failed due to previous errors
Apr 17, 2016 8:43:13 PM org.apache.catalina.core.ApplicationContext log
INFO: Shutting down log4j
Apr 17, 2016 8:43:13 PM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class org.springframework.web.util.Log4jConfigListener
java.lang.NoClassDefFoundError: org/apache/log4j/LogManager
at org.springframework.util.Log4jConfigurer.shutdownLogging(Log4jConfigurer.java:116)
at org.springframework.web.util.Log4jWebConfigurer.shutdownLogging(Log4jWebConfigurer.java:169)
at org.springframework.web.util.Log4jConfigListener.contextDestroyed(Log4jConfigListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4980)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5626)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.LogManager
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
... 13 more
Apr 17, 2016 8:43:13 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Apr 17, 2016 8:43:13 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Apr 17, 2016 8:43:13 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2193 ms
Here is my log4j.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<!-- Appenders -->
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p: %c - %m%n" />
</layout>
</appender>
<appender name="util" class="org.apache.log4j.FileAppender">
<param name="File" value="C:\\ITLab\\logs\\GeneralLogs.log" />
<param name="Append" value="true" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%t %-5p %c{2} - %m%n"/>
</layout>
</appender>
<!-- Application Loggers -->
<logger name="com.hp.gcc">
<level value="info" />
</logger>
<!-- 3rdparty Loggers -->
<logger name="org.springframework.core">
<level value="info" />
</logger>
<logger name="org.springframework.beans">
<level value="info" />
</logger>
<logger name="org.springframework.context">
<level value="info" />
</logger>
<logger name="org.springframework.web">
<level value="info" />
</logger>
<!-- Root Logger -->
<root>
<priority value="warn" />
<appender-ref ref="console" />
</root>
</log4j:configuration>
Here is web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>CRUDWebAppMavenized</display-name>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
Here is pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>CRUDWebAppMavenized</groupId>
<artifactId>CRUDWebAppMavenized</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<org.springframework.version>3.0.5.RELEASE</org.springframework.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<!-- Hibernate resources -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.6.7.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.3.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>3.3.0.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.3.1.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.2.GA</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>20030825.184428</version>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>20030825.183949</version>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
<!-- Log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<testSourceDirectory>src/main/test</testSourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/webapp</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Kindly tell me what's wrong with my code, and please provide solutions. Thanks a lot! :)
i got it!
Problem is:
org.springframework.web.util.Log4jConfigListener
This is deprecated from Spring Framework 4.2.1. Only delete this listener!
Maybe you should add the dependencies in the pom.xml:
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.5</version>
</dependency>
I fixed by using below pom dependency !
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.5-beta5</version>
</dependency>
I am experimenting with Spring Security. The built-in login page can be displayed with:
spring-webmvc-4.2.2.RELEASE
spring-security-core-4.0.3.RELEASE
This is the good combination of jars:
But when I change to:
spring-webmvc-4.2.3.RELEASE
spring-security-core-4.0.3.RELEASE
This is the failedcombination of jars:
I encountered the following error when starting the tomcat. How could this minor change be in-compatible?
My pom.xml is quite simple as below, I only specify the org.springframework.version and org.springframework.security.version, which are both the latest. And all the others are transitive dependencies which I totally leave to Maven.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>mygroup</groupId>
<artifactId>mycloud-server</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<org.springframework.version>4.2.3.RELEASE</org.springframework.version>
<org.springframework.security.version>4.0.3.RELEASE</org.springframework.security.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${org.springframework.security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${org.springframework.security.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Dec 08, 2015 12:04:26 AM org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERE: Context initialization failed
java.lang.NoSuchMethodError:
org.springframework.aop.framework.autoproxy.AutoProxyUtils.determineTargetClass(Lorg/springframework/beans/factory/config/ConfigurableListableBeanFactory;Ljava/lang/String;)Ljava/lang/Class;
at
org.springframework.context.event.EventListenerMethodProcessor.afterSingletonsInstantiated(EventListenerMethodProcessor.java:78)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:792)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:838)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
at
org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4770)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5196)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
at java.util.concurrent.FutureTask.run(FutureTask.java:262) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Dec 08, 2015 12:04:26 AM org.apache.catalina.core.StandardContext
listenerStart SEVERE: Exception sending context initialized event to
listener instance of class
org.springframework.web.context.ContextLoaderListener
java.lang.NoSuchMethodError:
org.springframework.aop.framework.autoproxy.AutoProxyUtils.determineTargetClass(Lorg/springframework/beans/factory/config/ConfigurableListableBeanFactory;Ljava/lang/String;)Ljava/lang/Class;
at
org.springframework.context.event.EventListenerMethodProcessor.afterSingletonsInstantiated(EventListenerMethodProcessor.java:78)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:792)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:838)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
at
org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4770)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5196)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
at java.util.concurrent.FutureTask.run(FutureTask.java:262) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Dec 08, 2015 12:04:26 AM org.apache.catalina.core.StandardContext
startInternal SEVERE: Error listenerStart Dec 08, 2015 12:04:26 AM
org.apache.catalina.core.StandardContext startInternal SEVERE: Context
[/mycloud-server] startup failed due to previous errors Dec 08, 2015
12:04:26 AM org.apache.catalina.core.ApplicationContext log INFO:
Closing Spring root WebApplicationContext Dec 08, 2015 12:04:26 AM
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
doClose INFO: Closing Root WebApplicationContext: startup date [Tue
Dec 08 00:04:25 CST 2015]; root of context hierarchy Dec 08, 2015
12:04:26 AM
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
doClose WARNING: Exception thrown from LifecycleProcessor on context
close java.lang.IllegalStateException: LifecycleProcessor not
initialized - call 'refresh' before invoking lifecycle methods via the
context: Root WebApplicationContext: startup date [Tue Dec 08 00:04:25
CST 2015]; root of context hierarchy at
org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:414)
at
org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:972)
at
org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:931)
at
org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:583)
at
org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:116)
at
org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4813)
at
org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5413)
at
org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
at java.util.concurrent.FutureTask.run(FutureTask.java:262) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Thanks to #M.Deinum's suggestion. I followed this link to use the Spring IO Platform.
I encountered several strange issues during Maven update with my 10G old local repository. I solved it by using a new empty local repository.
And it works. It's quite neat to use maven dependency management.
My pom.xml now looks like this:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>xxx</groupId>
<artifactId>mycloud-server</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.spring.platform</groupId>
<artifactId>platform-bom</artifactId>
<version>2.0.0.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
And the so-called managed dependency are displayed as below:
And some tips:
Based on my experience, many Maven errors are caused by failed download of dependencies or plugins. For each failed download, a *.lastUpdated file will be created. Sometimes this file will block a second download attempt. You can use the following commands to remove them.
cd to local repository.
run: dir *.lastUpdated /s to identify all of them.
run: del *.lastUpdated /s to remove all of them.
run: Maven -> Update in eclipse again.
I am running JIRA 7.0.2 in my system and Atlassian SDK 6.1.2.
OS-Windows 7
I have my own plugins and when ever I try to run jira by atlas-debug I get this exception.
--- maven-jira-plugin:6.1.2:generate-manifest (default-generate-manifest) # jira-menu-items ---
Generating a manifest for this plugin
using maven-bundle-plugin v2.5.3
Manifest com.atlassian.plugins.tutorial:jira-menu-items:atlassian-plugin:1.1 : The default package '.' is not permitted by the Import-Package syntax.
This can be caused by compile errors in Eclipse because Eclipse creates
valid class files regardless of compile errors.
The following package(s) import from the default package null
Error(s) found in manifest configuration
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 2:32.854s
Finished at: Tue Nov 24 22:24:04 IST 2015
Final Memory: 66M/682M
------------------------------------------------------------------------
Failed to execute goal com.atlassian.maven.plugins:maven-jira-plugin:6.1.2:generate-manifest (default-generate-manifest) on project jira-menu-items: Unable to execute mojo: Error(s) found in manifest configuration -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
POM.XML
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.atlassian.plugins.tutorial</groupId>
<artifactId>jira-menu-items</artifactId>
<version>1.1</version>
<organization>
<name>Milind Company</name>
<url>http://www.milind.com/</url>
</organization>
<name>jira-menu-items</name>
<description>This is the com.atlassian.plugins.tutorial:jira-menu-items plugin for Atlassian JIRA.</description>
<packaging>atlassian-plugin</packaging>
<dependencies>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
</dependency>
<!-- Add dependency on jira-core if you want access to JIRA implementation classes as well as the sanctioned API. -->
<!-- This is not normally recommended, but may be required eg when migrating a plugin originally developed against JIRA 4.x -->
<!--
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-core</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
</dependency>
-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-annotation</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-runtime</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-amps-dispatcher-plugin</artifactId>
<version>5.0.18</version>
</dependency>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
<version>1.2.6</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>provided</scope>
</dependency>
<!-- WIRED TEST RUNNER DEPENDENCIES -->
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.2-atlassian-1</version>
</dependency>
<!-- Uncomment to use TestKit in your project. Details at https://bitbucket.org/atlassian/jira-testkit -->
<!-- You can read more about TestKit at https://developer.atlassian.com/display/JIRADEV/Plugin+Tutorial+-+Smarter+integration+testing+with+TestKit -->
<!--
<dependency>
<groupId>com.atlassian.jira.tests</groupId>
<artifactId>jira-testkit-client</artifactId>
<version>${testkit.version}</version>
<scope>test</scope>
</dependency>
-->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-jira-plugin</artifactId>
<version>${amps.version}</version>
<extensions>true</extensions>
<configuration>
<productVersion>${jira.version}</productVersion>
<productDataVersion>${jira.version}</productDataVersion>
<enableQuickReload>true</enableQuickReload>
<enableFastdev>false</enableFastdev>
<instructions>
<Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
<Export-Package>net.gisnas.jira.mailqueue.api,</Export-Package>
<Import-Package>org.springframework.osgi.*;resolution:="optional",
org.eclipse.gemini.blueprint.*;resolution:="optional", *</Import-Package>
<Spring-Context>*</Spring-Context>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
<version>1.2.6</version>
<executions>
<execution>
<goals>
<goal>atlassian-spring-scanner</goal>
</goals>
<phase>process-classes</phase>
</execution>
</executions>
<configuration>
<scannedDependencies>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-external-jar</artifactId>
</dependency>
</scannedDependencies>
<verbose>false</verbose>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<jira.version>7.0.2</jira.version>
<amps.version>6.1.2</amps.version>
<plugin.testrunner.version>1.2.3</plugin.testrunner.version>
<atlassian.spring.scanner.version>1.2.6</atlassian.spring.scanner.version>
<!-- This key is used to keep the consistency between the key in atlassian-plugin.xml and the key to generate bundle. -->
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
<!-- TestKit version 6.x for JIRA 6.x -->
<testkit.version>6.3.11</testkit.version>
</properties>
</project>
Settings.xml
<settings>
<localRepository>C:\Users\Milind\.m2\repository</localRepository>
<profiles>
<profile>
<id>atlassian-repositories</id>
<repositories>
<repository>
<id>atlassian-proxy</id>
<name>Atlassian Maven 2 Proxy</name>
<url>https://m2proxy.atlassian.com/repository/public</url>
</repository>
<repository>
<id>atlassian-contrib</id>
<name>Atlassian Contrib Repository</name>
<url>https://m2proxy.atlassian.com/contrib</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>atlassian-proxy</id>
<name>Atlassian Maven 2 Proxy</name>
<url>https://m2proxy.atlassian.com/repository/public</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>atlassian-repositories</activeProfile>
</activeProfiles>
</settings>
Try to clean up the target directory within your plugin directory or simply use command atlas-clean from plugin directory and run your plugin.
If you've made some changes in pom.xml then before running plugin, you should execute this command first atlas-mvn eclipse:eclipse. Every time you made changes in pom you should execute this command.
Please, check once that your JDK version is 8 because JIRA 7.x will only works with JDK 8.
You've set incompatible version for amps in dependency. Use 6.1.2 instead of 5.x
com.atlassian.maven.plugins
maven-amps-dispatcher-plugin
5.0.18
And if you are trying to debug the code in Eclipse after running JIRA from command then you should specify the port number to attach debugger. Your command will be like this atlas-debug --jvm -debug -port 5005.
Hope this will help you to resolve your problem.