So I've uploaded my Jar file created with the pom file below using maven and I'm having the errors in the logs and can't figure out what the problem is. The Spring Boot both builds and runs fine locally but won't work when trying to deploy.
The logs give me this error
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication
and my build in my pom file is
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
I've tried loads of different things but am coming at a loss. Any help would be appreciated.
Related
I have a maven project with a web.xml and run it using mvn jetty:run
How can I disable the http-tracing?
Edit: I looked here but I was unable to identify the relevant tags...
This is the relevant plugin:
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.2.11.v20150529</version>
<configuration>
<jettyXml>src/jetty.xml</jettyXml>
</configuration>
</plugin>
Two things.
Jetty 9.2 is EOL (End of Life) - consider upgrading to something supported and stable (such as the recently released 9.4.14.v20181114)
The TRACE method in HTTP is disabled by default (via the webdefaults.xml descriptor).
The only way you can use TRACE is to both intentionally configure your webapp to use a custom default descriptor without this constraint (which your <configuration> section doesn't do), and have a Servlet that implements doTrace() or service() methods to support the TRACE method.
What is the best way to save and publish git version of Cloud Foundry app?
Is it possible to specify what version string aka git revision should be added to application metadata, and how to get this information outside of app?
If you are using spring boot there are plugins for maven and gradle to git information to the build.
Maven:
<build>
<plugins>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
</plugin>
</plugins>
</build>
Gradle:
plugins {
id "com.gorylenko.gradle-git-properties" version "1.4.17"
}
The information will then be available on /info if you are using actuators
More information:https://docs.pivotal.io/pivotalcf/1-12/console/spring-boot-actuators.html
In jetty-9 the mvn jetty:deploy-war fails to start the web application. Maven just ends the build, while I expect it to block with a running jetty server. According to the logging output the jetty maven plugin does start a connector on port 8080, and it starts the WebAppContext. It seems to fail binding the port to the context though.
Steps to reproduce:
Create a web app: mvn archetype:generate -DinteractiveMode=false -DarchetypeArtifactId=maven-archetype-webapp -DgroupId=jetty -DartifactId=jetty-demo
Add this plugins-section to the pom:
<build>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.2.10.v20150310</version>
</plugin>
</plugins>
...
</build>
Execute:
mvn package
mvn jetty:deploy-war This should start the web app and then block, but it just ends the build
Using jetty-8 all works fine:
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.16.v20140903</version>
Note: mvn jetty:run-war works as expected in jetty 9. This is the same as deploy-war, but it triggers jetty to build the war before deployment
Reference: the jetty-9 maven plugin manual. And I debugged the jetty startup proces, but without luck so far.
The documentation you linked to tells you why.
Set the daemon parameter to false and it will block
I have a web application which has web services clients. When I right click on the client in netbeans I get option to edit web service attribute like below.
When I add maven to the same application, I do not get -wsimport options tab while editing the web service attributes. See following image.
Everything else is same in the application with just the maven used for dependency management in later application.
Please help.
The WSIMPORT is inside the Maven plugin named jaxws-maven-plugin. You may be noticed that the Netbeans automatically add it as a build plugin at your project POM file.
It can be configured in the Maven way as the following example: -
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.12</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlUrls>
<wsdlUrl>http://MY_DOMAIN/MY_SERVICE?wsdl</wsdlUrl>
</wsdlUrls>
<packageName>com.my.package.ws</packageName>
</configuration>
<phase>generate-sources</phase>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-tools</artifactId>
<version>2.2.5</version>
</dependency>
</dependencies>
<configuration>
<verbose>true</verbose>
<sourceDestDir>${basedir}/src/main/java</sourceDestDir>
</configuration>
</plugin>
You may see further information about the jaxws:wsimport and some usage example.
I hope this may help.
Regards,
Charlee Ch.
Have been trying to get integration testing working with my seam project and the Jboss embedded container but am not having much success. Have been doing a lot of reading and have been trying what is mentioned in this JIRA but am not having any luck.
Amy currently just trying to get the 'testproject-master-JBSEAM-2371.zip' project working but am getting the following exception
ERROR [org.jboss.embedded.DeploymentScanner] Failed to deploy
org.jboss.deployers.spi.DeploymentException: No deployer recognised the structure of vfsfile:/Users/aaron/Development/eclipse_workspaces/workspace_pink/testproject-web/target/test-classes/conf/jboss-service.xml
at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.determineStructure(VFSStructuralDeployersImpl.java:219)
at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers.determineStructure(AbstractStructuralDeployers.java:77)
Has oneone had any luck with getting the Seam integration tests working using maven and NOT a seam-gen project?
I gave up on the embedded JBoss and switched with using the Maven JBoss Plugin to deploy to a JBoss instance started as a separate process. Not ideal but there were to many conflicts with our code and Maven to get around. Is there a reason you need the embedded version?
You should be able to do something like this to deploy to JBoss in the pre-integration test phase so the integration test could run against. You would still have to launch jboss before maven. Not ideal, but this is working for me.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
<executions>
<execution>
<phase>pre-integration-test</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<jbossHome>/opt/JBoss/current</jbossHome>
<port>8080</port>
</configuration>
</execution>
</executions>
</plugin>