Problem in deploying to IBM bluemix java/spring service - websphere

I am deploying a java spring boot application as a deployable war into an IBM bluemix environment via jenkins. I am able to build and run the service in my local environment. During the build pipeline, I am getting this. Any ideas?
Staging app and tracing logs...
Downloading liberty-for-java...
Downloaded liberty-for-java
Cell 26776ec2-6370-4ef1-8987-54aa61d8fe79 creating container for instance 1cc919a5-8e81-4c91-aa64-9b7274d7715d
Cell 26776ec2-6370-4ef1-8987-54aa61d8fe79 successfully created container for instance 1cc919a5-8e81-4c91-aa64-9b7274d7715d
Downloading app package...
Downloaded app package (2.6K)
-----> Liberty Buildpack Version: v3.44-20200430-1451
E, [2021-02-22T22:06:45.730075 #22] ERROR -- /tmp/buildpacks/fb2e823ce09e8909e2afd757be3d1971/lib/liberty_buildpack/buildpack.rb:50:in `rescue in drive_buildpack_with_logger': Compile failed with exception #<RuntimeError: No supported application type was detected>
No supported application type was detected
Failed to compile droplet: Failed to compile droplet: exit status 1
Exit status 223
Cell 26776ec2-6370-4ef1-8987-54aa61d8fe79 stopping instance 1cc919a5-8e81-4c91-aa64-9b7274d7715d
Cell 26776ec2-6370-4ef1-8987-54aa61d8fe79 destroying container for instance 1cc919a5-8e81-4c91-aa64-9b7274d7715d
Error staging application: App staging failed in the buildpack compile phase
FAILED

The error basically means the buildpack did not find an artifact it recognizes as an app it supports. The liberty buildpack recognizes wars, jars, liberty server directories and packaged servers.
The buildpack will look for an artifact in the current directory or in the directory specified with the -p CLI flag or path in the manifest.
Ensure your artifact exists where the buildpack can find it.

Related

how does jenkins undeploy and deploy war to tomcat works?

Im wondering how does Jenkins undeploy and deploy a war into a Tomcat container. I have a job which builds and deploy the created war to a tomcat server and i cant understand how Jenkins does the undeploy.
**
IMPORTANT: ExampleName.war and ExampleName#test-1234.war are the SAME project, but built with different pom version naming conventions**
If i deploy a war named ExampleName.war in Tomcat andm later i build-deploy via jenkins the same war with the same name, it automatically detects it.. so Jenkins goes for a Undeploy -> Deploy war into the server.
Now here's my question: if the war already deployed is ExampleName.war and then i build and deploy via jenkins a war named ExampleName#test-1234.war , the job fails. How does Jenkins and Tomcat communicate to detect if a war is already deployed, so in case does the undeploy-deploy?
Is the check made by war name? If so, actually the war name is different so it should skip the undeploy?
Here the error i get from Jenkins in the 2nd case (war name obscured):
Discard old builds...
[DeployPublisher][INFO] Attempting to deploy 1 war file(s)
[DeployPublisher][INFO] Deploying ExampleName#test-1234.war to container Tomcat 7.x Remote with context null
**Redeploying ExampleName#test-1234.war]**
** Undeploying [ExampleName#test-1234.war]**
**ERROR: Build step failed with exception
org.codehaus.cargo.container.ContainerException: Failed to undeploy [ExampleName#test-1234.war]**
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:132)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:165)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:81)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:167)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:136)
at hudson.FilePath.act(FilePath.java:1200)
at hudson.FilePath.act(FilePath.java:1183)
at hudson.plugins.deploy.CargoContainerAdapter.redeployFile(CargoContainerAdapter.java:133)
at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeployFile(PasswordProtectedAdapterCargo.java:95)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:113)
at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:79)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:47)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:816)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:765)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1072)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:709)
at hudson.model.Run.execute(Run.java:1922)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:442)
**Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The Tomcat Manager responded "FAIL - No context exists for path /ExampleName#test-1234.war**
**" instead of the expected "OK" message**
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:721)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:501)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.undeploy(TomcatManager.java:441)
at org.codehaus.cargo.container.tomcat.Tomcat7xRemoteDeployer.performUndeploy(Tomcat7xRemoteDeployer.java:58)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:122)
... 20 more
**org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The Tomcat Manager responded "FAIL - No context exists for path /ExampleName#test-1234.war**
**" instead of the expected "OK" message**
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:721)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:501)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.undeploy(TomcatManager.java:441)
at org.codehaus.cargo.container.tomcat.Tomcat7xRemoteDeployer.performUndeploy(Tomcat7xRemoteDeployer.java:58)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:122)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:165)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:81)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:167)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:136)
at hudson.FilePath.act(FilePath.java:1200)
at hudson.FilePath.act(FilePath.java:1183)
at hudson.plugins.deploy.CargoContainerAdapter.redeployFile(CargoContainerAdapter.java:133)
at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeployFile(PasswordProtectedAdapterCargo.java:95)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:113)
at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:79)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:47)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:816)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:765)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1072)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:709)
at hudson.model.Run.execute(Run.java:1922)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:442)
**Build step 'Deploy war/ear to a container' marked build as failure
Finished: FAILURE**
Jenkins tries to undeploy ExampleName#test-1234.war even if the war previously deployed is ExampleName.war.
Which is ok, i mean i want to "override" ExampleName.war with ExampleName#test-1234.war ... but i guess he doesnt know what to undeploy if not specified (or if war name isnt exactly the same?)
Thank you very much

Deploying my Java Dynamic Web Project to Heroku

I've been trying to deploy a dynamic web project created in Eclipse to Heroku but I've been having a few difficulties. This project does not use a pom file/maven and does not seem to work with any of the java buildpacks that I try to use. I added a jvm buildpack and this appeared to help my project pass deployment, but when I try to open my app, I get the following error:
"Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail"
Is there a specific buildpack that I should use for this project?

Unable to push service to PCF, error staging application in buildpack compile phase

I am trying to push a service to PCF using cf push command. I am getting the following error:
-----> Java Buildpack v4.16.1 (offline) | https://github.com/cloudfoundry/java-buildpack.git#41b8ff8
[Buildpack] ERROR Finalize failed with exception #<RuntimeError: No container can run this application. Please ensure that you've pushed a valid JVM artifact or artifacts using the -p command line argument or path manifest entry. Information about valid JVM artifacts can be found at https://github.com/cloudfoundry/java-buildpack#additional-documentation. >
No container can run this application. Please ensure that you've pushed a valid JVM artifact or artifacts using the -p command line argument or path manifest entry. Information about valid JVM artifacts can be found at https://github.com/cloudfoundry/java-buildpack#additional-documentation.
Failed to compile droplet: Failed to run finalize script: exit status 1
Exit status 223
Cell 73976a3c-ee0d-4c45-8067-55f73fc1b90a stopping instance 13e76fc9-87be-40be-a3b7-0f0cb1efc55f
Cell 73976a3c-ee0d-4c45-8067-55f73fc1b90a destroying container for instance 13e76fc9-87be-40be-a3b7-0f0cb1efc55f
Cell 73976a3c-ee0d-4c45-8067-55f73fc1b90a successfully destroyed container for instance 13e76fc9-87be-40be-a3b7-0f0cb1efc55f
Error staging application: App staging failed in the buildpack compile phase
FAILED
I have the following contents in my yml file:
applications:
- name: Someapplication
buildpack: java_buildpack_offline
memory: 1G
path: target/someapp-SNAPSHOT.jar
instances: 1
env:
SPRING_PROFILES_ACTIVE: env1
The jar was not generating properly. I added this plugin and was able to resolve the issue.
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

java.lang.NoClassDefFoundError: org.springframework.context.support.ClassPathXmlApplicationContext

What I am trying to achieve is to upload Temenos T24 Design Studio web services on Axis2.
Unfortunately, I am getting a Class not found error when uploading the service using "aar" (Axis2 archive) file.
I have already deployed Axis2 1.4.4 on IBM Websphere 9.
Note : There has been certain conflicts while deploying Axis2 application on IBM websphere JAX-WS, which I have used this guide to resolve them;
https://www-01.ibm.com/support/docview.wss?uid=swg21315686
Below is the error I am getting;
=================================
This Web axisService has deployment faults
Error: java.lang.NoClassDefFoundError: org.springframework.context.support.ClassPathXmlApplicationContext at com.temenos.services.designstudioinstaller.DesignStudioInstallerServiceSpringContext.loadServiceContext(DesignStudioInstallerServiceSpringContext.java:27)
You have to remove the following jar files from the t24lib directory:
t24-EB_ResourceProviderService-ejb.jar
t24-EB_ResourceProviderService-ProxyAdaptor.jar
t24-EB_ResourceProviderService-jws.aar
t24-EB_ResourceProviderService-provider.jar
t24-EB_ResourceProviderService-tafj-jws.aar
t24-EB_ResourceProviderService-tafj-provider.jar
For any service component such as EB_ResourceProviderService, only the below jars must be present within the t24lib directory:
EB_ResourceProviderService.jar
t24-EB_ResourceProviderService-Data.jar
t24-EB_ResourceProviderService-t24service.jar
Restart the application server after removing them and the axis2 should deploy successfully.
I had similar error deploying axis2.war inflated with Temenos aar files on JBoss EAP 7.1 and it was solved by removing the duplicated .jar and .aar files in t24lib:
[INFO] The t24-EB_ResourceProviderService-tafj-jws.aar service, which is not valid, caused java.lang.NoClassDefFoundError: org/springframework/context/support/ClassPathXmlApplicationContext
at com.temenos.services.resourceprovider.ResourceProviderServiceSpringContext.loadServiceContext(ResourceProviderServiceSpringContext.java:27)

Team City: Cannot Redeploy to Tomcat7

I have a build configuration that uses the Team City deployer plugin.
I'm using a container deploy to deploy the war file to Tomcat.7.0.63 installed as a service on a Windows Server 2012 R2 box.
The first time I run the the build, the artifact (a war file_ deploys successfully.
The second time, and all subsequent runs, the deploy fails.
The error message:
Build failure message received: org.codehaus.cargo.container.ContainerException: Failed to undeploy
The log file error:
Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Unable to delete
When I go to the webapps folder on the remote server, the war file is deleted, but the expanded folder is only partially deleted. Most files are gone, except for a png file.
I am not able to manually delete the folder because Tomcat still has a lock on it.
If I restart tomcat, I'm then able to run the build successfully (war file deploys).
One thought I had was to restart Tomcat before or after each deploy.
How would I restart Tomcat from TeamCity?
Or perhaps, does anyone have suggestions on how to fix this problem?
You can configure the Tomcat Context using the antiResourceLocking option, as detailed further in the online documentation. This does come with some trade-offs however; definitely worth reading the documentation in full and evaluating if it's a suitable option for your application.

Resources