Failed to execute goal tomcat:deploy Error writing to server - eclipse

I'm trying to test a spring-mvc tutorial here.
I would like to deploy the generated war on tomcat 7 using eclipse-maven.
The war works fine when deployed manually on tomcat.
Steps to follow :
import project on eclipse
add this plugin to the existing POM:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<mode>war</mode>
<url>http://localhost:8080/manager/html/</url>
<server>TomcatServer</server>
<path>/springexample</path>
</configuration>
configure a new tomcat server in eclipse with the name TomcatServer
modify the tomcat-users.xml file:
include an admin user:
<tomcat-users>
<role rolename="admin"/>
<role rolename="standard"/>
<role rolename="manager-gui"/>
<role rolename="manager"/>
<role rolename="tomcat"/>
<role rolename="manager-script"/>
<user password="password" roles="standard,manager,admin,manager-gui,manager-script,tomcat" username="admin"/>
</tomcat-users>
Add the server configuration to the setting.xml config file under .m2
user folder:
TomcatServer
admin
password
Strat tomcat server
When I execute the following goals :
Maven generate-sources : to generate the war file
then Run configuration --> with the goal :
tomcat:deploy
the error is :
[
ERROR] Failed to execute goal
org.codehaus.mojo:tomcat-maven-plugin:1.1:redeploy (default-cli) on
project springexample: Cannot invoke Tomcat manager: Error writing to
server -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:redeploy
(default-cli) on project springexample: Cannot invoke Tomcat manager
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at
org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at
org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at
org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot
invoke Tomcat manager at
org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:149)
at
org.codehaus.mojo.tomcat.AbstractWarCatalinaMojo.execute(AbstractWarCatalinaMojo.java:70)
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more Caused by: java.io.IOException: Error writing to server
at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown
Source) at
sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown
Source) at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source) at
org.codehaus.mojo.tomcat.TomcatManager.invoke(TomcatManager.java:604)
at
org.codehaus.mojo.tomcat.TomcatManager.deployImpl(TomcatManager.java:662)
at
org.codehaus.mojo.tomcat.TomcatManager.deploy(TomcatManager.java:295)
at
org.codehaus.mojo.tomcat.AbstractDeployWarMojo.deployWar(AbstractDeployWarMojo.java:85)
at
org.codehaus.mojo.tomcat.AbstractDeployMojo.invokeManager(AbstractDeployMojo.java:85)
at
org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:141)
... 22 more [ERROR] [ERROR] [ERROR] For more information about the
errors and possible solutions, please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

In my case, using the tomcat7 command for deployment worked :
tomcat7:deploy
And you should not use :
tomcat:deploy

My issue was related to the fact the WAR file was over 50mb. You need to set the config in web.xml from the tomcat manager.
The file will normally be in %tomcat installation%\webapps\manager\WEB-INF\web.xml
<multipart-config>
<!-- 50MB max -->
<max-file-size>52428800</max-file-size>
<max-request-size>52428800</max-request-size>
<file-size-threshold>0</file-size-threshold>
</multipart-config>

You should focus your effors on
Caused by: java.io.IOException: Error writing to server
at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at org.codehaus.mojo.tomcat.TomcatManager.invoke(TomcatManager.java:604)
Look at the source for TomcatManager (http://mojo.codehaus.org/tomcat-maven-plugin/xref/org/codehaus/mojo/tomcat/TomcatManager.html#672)
The maven plugin cannot read from the server. It connects, line 597, it writes the data, line 601, but fails when it reads the response, line 604
I would try to deploy at the server first (to get rid of network problems) and see if the problem persists.

Related

How to fix error 'Failed to initialize connector [Connector[HTTP/1.1-443]]' when starting tomcat

I'm trying to deploy my java backstage on a remote tomcat server (8.5.39). In order to use https, I changed these lines on /conf/server.xml
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="443" />
<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true" keystoreFile="xxx" keystorePass="xxx">
</Connector>
<Connector port="8009" protocol="AJP/1.3" redirectPort="443" />
I can run the tomcat on remote server and I can access it by domain name(https). But when I use eclipse to run java code on remote server, it comes with error like
SEVERE: Failed to initialize connector [Connector[HTTP/1.1-443]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-443]]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:552)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:875)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
at org.apache.catalina.startup.Catalina.load(Catalina.java:639)
at org.apache.catalina.startup.Catalina.load(Catalina.java:662)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:309)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed
at org.apache.catalina.connector.Connector.initInternal(Connector.java:995)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
... 12 more
Caused by: java.lang.IllegalArgumentException: C:\Users\Administrator\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\cert\server.jks (No such file or directory)
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:100)
at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:72)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:244)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1105)
at org.apache.tomcat.util.net.AbstractJsseEndpoint.init(AbstractJsseEndpoint.java:224)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:581)
at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:68)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:993)
... 13 more
Caused by: java.io.FileNotFoundException: C:\Users\Administrator\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\cert\server.jks (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:213)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:155)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:110)
at java.base/sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:86)
at java.base/sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:184)
at org.apache.tomcat.util.file.ConfigFileLoader.getInputStream(ConfigFileLoader.java:89)
at org.apache.tomcat.util.net.SSLUtilBase.getStore(SSLUtilBase.java:190)
at org.apache.tomcat.util.net.SSLHostConfigCertificate.getCertificateKeystore(SSLHostConfigCertificate.java:206)
at org.apache.tomcat.util.net.SSLUtilBase.getKeyManagers(SSLUtilBase.java:272)
at org.apache.tomcat.util.net.SSLUtilBase.createSSLContext(SSLUtilBase.java:239)
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:98)
... 20 more
Someone told me to stop tomcat on remote server and run the code. I tried but it doesn't work.
Your most deep exception cause is:
Caused by: java.io.FileNotFoundException: C:\Users\Administrator\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\cert\server.jks (No such file or directory)
Which is trying to find certificate to start service with SSL enabled.
In order to do that you'll have to either provide certificate file for SSL or remove https enpoint to start without any encription

Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.7.RELEASE e: Could not exec java: Application finished with exit code: 1

Error display when i press Ctrl+c in cmd
[INFO] BUILD FAILURE
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.7.RELEASE:run (default-cli) on project beeqe: Could not exec java: Application finished with exit code: 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin 5.7.RELEASE:run (default-cli) on project beequote: Could not exec java
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
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:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
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:498)
at org.apache.maven.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:39)
at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:122)
at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:50)
Caused by: org.apache.maven.plugin.MojoExecutionException: Could not exec java
at org.springframework.boot.maven.RunMojo.runWithForkedJvm(RunMojo.java:82)
at org.springframework.boot.maven.AbstractRunMojo.doRunWithForkedJvm(AbstractRunMojo.java:279)
at org.springframework.boot.maven.AbstractRunMojo.run(AbstractRunMojo.java:245)
at org.springframework.boot.maven.AbstractRunMojo.execute(AbstractRunMojo.java:181)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 27 more
Caused by: org.apache.maven.plugin.MojoExecutionException: Application finished with exit code: 1
at org.springframework.boot.maven.RunMojo.runWithForkedJvm(RunMojo.java:78)
... 32 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
The question is quite old but I'll share my answer in case someone stumbles upon this. I had exact same problem and the cause was incorrect configuration of logback in logback-spring.xml.
If you're using logback (it's used by default in Spring Boot), try commenting the whole configuration out and un-comment it step by step. It sounds tedious but that's what worked for me.
To show some examples of my misconfiguration:
<logger name="org.apache.camel.component.file" level="error"additivity="false">
is supposed to be
<logger name="org.apache.camel.component.file" level="error" additivity="false">
<appender name="..." class="ch.qos.logback.core.rolling.RollingFileAppender">
...
<rollingPolicy
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
...
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>10MB</maxFileSize>
</triggeringPolicy>
</rollingPolicy>
</appender>
is supposed to be
<appender name="..." class="ch.qos.logback.core.rolling.RollingFileAppender">
...
<rollingPolicy
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
...
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>10MB</maxFileSize>
</triggeringPolicy>
</appender>

Issue while Upgrading the SmartGWT version from 5.0 to 6.0

I have an application which is developed on SmartGWT. While upgrading SmartGWT 5.0 to 6.0 , This might be easy but no luck .i am getting the below exception
and i am using GWT 2.6.1 , can any one help me out to solve this issue.
[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.6.1:compile (default) on project px-smartgwt-client: Failed to read module XML file sun
.net.www.protocol.jar.JarURLConnection$JarURLInputStream#541afb85: invalid LOC header (bad signature) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.6.1:compile (default) on project px-smartgwt-client: Failed to read module XML file sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream#541afb85
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to read module XML file sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream#541afb85
at org.codehaus.mojo.gwt.shell.CompileMojo.compilationRequired(CompileMojo.java:576)
at org.codehaus.mojo.gwt.shell.CompileMojo.compile(CompileMojo.java:437)
at org.codehaus.mojo.gwt.shell.CompileMojo.doExecute(CompileMojo.java:351)
at org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo.execute(AbstractGwtShellMojo.java:172)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.codehaus.mojo.gwt.utils.GwtModuleReaderException: Failed to read module XML file sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream#541afb85
at org.codehaus.mojo.gwt.AbstractGwtModuleMojo.readModule(AbstractGwtModuleMojo.java:240)
at org.codehaus.mojo.gwt.AbstractGwtModuleMojo.readModule(AbstractGwtModuleMojo.java:194)
at org.codehaus.mojo.gwt.GwtModule.getLocalInherits(GwtModule.java:189)
at org.codehaus.mojo.gwt.GwtModule.getInherits(GwtModule.java:149)
at org.codehaus.mojo.gwt.GwtModule.getEntryPoints(GwtModule.java:114)
at org.codehaus.mojo.gwt.shell.CompileMojo.compilationRequired(CompileMojo.java:490)
... 24 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
at java.util.zip.ZipFile.read(Native Method)
at java.util.zip.ZipFile.access$1400(ZipFile.java:61)
at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:717)
at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:420)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
at org.codehaus.plexus.util.xml.XmlReader.getBOMEncoding(XmlReader.java:635)
at org.codehaus.plexus.util.xml.XmlReader.doRawStream(XmlReader.java:459)
at org.codehaus.plexus.util.xml.XmlReader.<init>(XmlReader.java:180)
at org.codehaus.plexus.util.xml.XmlReader.<init>(XmlReader.java:143)
at org.codehaus.plexus.util.xml.XmlStreamReader.<init>(XmlStreamReader.java:86)
at org.codehaus.plexus.util.ReaderFactory.newXmlReader(ReaderFactory.java:104)
at org.codehaus.mojo.gwt.AbstractGwtModuleMojo.readModule(AbstractGwtModuleMojo.java:233)
... 29 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/d...utionException
I am able to solve the above issue..Issue is with smartgwt jar is corrupted.. i downloaded the jar from this link (http://www.smartclient.com/builds/Sm...rtgwt-6.0p.zip)

Why wont NetBeans runt? (Malformed \uxxxx encoding error)

I was working on a J2ME project and out of nowhere, I just started getting this error.
My syntax is correct everywhere and I haven't had problems running it before.
D:\Users\Ihato\NetBeansProjects\JavaMEGUI3\nbproject\build-impl.xml:6:
java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
at java.util.Properties.loadConvert(Properties.java:568)
at java.util.Properties.load0(Properties.java:390)
at java.util.Properties.load(Properties.java:341)
at org.apache.tools.ant.taskdefs.Property.loadProperties(Property.java:580)
at org.apache.tools.ant.taskdefs.Property.loadFile(Property.java:597)
at org.apache.tools.ant.taskdefs.Property.execute(Property.java:497)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor178.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:285)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
BUILD FAILED (total time: 0 seconds)
I have tried searching something about it but it's very poorly documented (5500 results on google)
Why is this happening?
First few lines of the XML are:
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- *** GENERATED FROM project.xml - DO NOT EDIT *** -->
3 <project name="JavaMEGUI3-impl" default="jar" basedir="..">
4 <!--load-properties-->
5 <target name="pre-load-properties">
6 <property file="nbproject/private/private.properties"/>
7 <property name="user.properties.file" location="${netbeans.user}/build.properties"/>
8 <available property="user.properties.file.exists" file="${user.properties.file}"/>
9 </target>
I've checked the other projects and it's pretty much the same except for the name.

Class not found with Struts2 and Netbeans

I'm using Netbeans 7.1, and i try to include Struts2.3.14.3 in my J2EE project.
I tried to :
put the .jars in the WEB-INF/lib path
link the .jars in the libraries "folder" of the project in Netbeans
create a librarie including the .jars and link it to the project
But none of these solutions work, when i deploy the application on my Glassfish server it keeps rising these kind of error :
Grave: Dispatcher initialization failed
Unable to load configuration. - bean - jar:file:/C:/xxx/dist/gfdeploy/xxx/lib/struts2-convention-plugin-2.3.14.3.jar!/struts-plugin.xml:32:155
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:473)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:264)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4685)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5377)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2000)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1651)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:294)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:462)
at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:375)
at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:219)
at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:253)
at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:145)
at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:136)
at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:69)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
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:601)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: Unable to load bean: type:org.apache.struts2.convention.ActionConfigBuilder class:org.apache.struts2.convention.PackageBasedActionConfigBuilder - bean - jar:file:/C:/xxx/dist/gfdeploy/xxx/lib/struts2-convention-plugin-2.3.14.3.jar!/struts-plugin.xml:32:155
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:245)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:226)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
... 40 more
Caused by: java.lang.NoClassDefFoundError: org/apache/struts2/StrutsException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404)
at java.lang.Class.getDeclaredConstructors(Class.java:1853)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:235)
... 43 more
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.StrutsException
at com.sun.enterprise.loader.ASURLClassLoader.findClassData(ASURLClassLoader.java:787)
at com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:696)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 47 more
I have verified manually, and org.apache.struts2.StrutsException is present in the strut2-core.jar.
Here the jars i use:
asm-3.3
asm-common-3.3
asm-tree-3.3
commons-fileupload-1.2.2
commons-io-2.0.1
commons-lang-2.4
commons-lang3-3.1
freemarket-2.3.19
javassist-3.11.0.GA
ongl-3.0.6
struts2-conventin-plugin-2.3.14.3
xwork-core-2.3.14.3
struts2-bootstrap-plugin-1.6.1
struts2-core-2.3.14.3
You need a structure like this:
YourEar.ear
lib
library1.jar
library2.jar
libraryN.jar
META-INF
YourWar.war
jsp
jsp1.jsp
jsp2.jsp
jspN.jsp
META-INF
WEB-INF
lib
libraryA.jar
libraryB.jar
libraryX.jar
classes
your.package.your.classes.etc...
struts.xml
web.xml
Struts libraries goes inside war, not ear (libraryA, B, X...)
Open the generated ear/war and check thet everything is on its right place.