Deploy with unmanaged mode in wildfly - deployment

I come from Tomcat 9, and I need to deploy my project in wildfly 26.1.3 in --unmanaged mode, this is because according to the documentation the user is the one who has control of the project files, and what I need is to modify the . properties and some folders inside the project.
I tried it by console:
deploy /root/myproject.war --unmanaged
But I got this error:
{"WFLYCTL0062: Composite operation failed and was rolled back. Steps
that failed:" => {"Operation step-2" => {"WFLYCTL0080: Failed
services" => {"jboss.deployment.unit."myproject.war".STRUCTURE" =>
"WFLYSRV0153: Failed to process phase STRUCTURE of deployment
"sacsFlyFagarProd.war"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException:
WFLYSRV0160: Failed to mount deployment content
Caused by: java.io.FileNotFoundException: /root/myproject.war (Permission denied)"}}}}
So I tried using the admin api, creating a folder and inside all the exploded project and this path was set.
But when trying in the browser it just comes out.
404 - Not Found
I tried looking for related information but still can't find anything clear.
If there is another way to deploy my project where I can manage the files in a folder within the same project and have wildfly not delete it on restart, I would be very grateful for your help.
Sorry if my query is very basic.

WildFly supports exploded deployments with its deployment scanner and using the add content.
What you are getting is unix permission issue because WildFly isn't running as root (which should be the way).

Related

stale deployment in WAS

I'm learning to use IBM WebSphere v8.8.5 for JavaEE development. I'm using MyEclipse as the development environment.
Sometimes when I debug my project from inside MyEclipse, I could see errors like this
00000091 ComponentMeta E WSVR0603E: ComponentMetaDataAccessor beginContext method received a NULL ComponentMetaData.
00000091 AlarmListener E SCHD0063E: A task with ID 953 (mi-online-app-1.0.0-SNAPSHOT#my-online-services-1.0.0-SNAPSHOT.jar#PaymentResultCheckServiceBean) failed to run on Scheduler WebSphere_EJB_Timer_Service (WebSphere_EJB_Timer_Service) because of an exception: java.lang.NullPointerException.
But actually, there's no PaymentResultCheckServiceBean in my project. It used to be in the project but I have renamed it.
When I develop in MyEclipse, I add a WAS server. Sometimes if anything wrong, I'll directly delete the whole workspace from disk and create a new one. So I'm wondering if these ways leave some stale data in WAS folder so that when WAS starts, old deployment got to run. But I've checked C:\IBM\WebSphere85\AppServer\profiles\AppSrv01\installedApps\myserver, there's nothing here.

Error occurred while starting the build in Openshift 3

I have been trying to deploy a war file as an OpenShift project. The server used is jboss-webserver30-tomcat8. I have followed the below steps -
Put ROOT.war file under 'deployments' directory in local system.
Upload the changes in github.
Create a new JAVA project in OpenShift 3 and provide the github repository details.
No automatic build or deployment starts. On manually clicking on Start Build button, the below error is displayed:
An error occurred while starting the build. Reason: Error resolving
ImageStreamTag jboss-webserver30-tomcat8-openshift:1.2 in namespace
openshift: unable to find latest tagged image
Please suggest how can I resolve the error.
This is an issue with how the jboss-webserver30-tomcat8-openshift imagestream is defined in the cluster. We are working to correct this, it is not currently importing the correct set of tags and as a result the 1.2 tag was stopped being a valid tag, when it should be.
However the short term solution is change your buildconfig to reference one of the tags that has a valid image reference associated (e.g. 1.3) instead of the 1.2 tag it is currently referencing. Your build should then be able to run.
A (temporarily) unavailable builder image may be related to this platform upgrade that correlates with the time of posting your question.
Generally, the best place to check for any incident reports or scheduled maintenance is the Status Page (Starter | Pro clusters; it's linked in the web console too, in the upper right corner of the interface).
If this does not seem to be related (e.g. you're not on the starter-us-west-2 cluster where the platform upgrade is taking place) or persists after the maintenance is over, I would encourage you to check the open issues, and log a new bug report, if it's not in the list.
Thank you.

Wildlfy 8 : Runtime final Server has encountered an error

Any idea how to solve this issue? The following message occurs in eclipse when I attempt to start the server or publish a war to the server from eclipse:
Error renaming
C:\runtimes\wildfly-8.0.0.Final\standalone\tmp\tmp1872668876413334227.MF
to
C:\runtimes\wildfly-8.0.0.Final\standalone\deployments\ContentStore.war\META-INF\MANIFEST.MF.
This may be caused by your server's temporary deploy directory being on a different filesystem than the final destination, but in my case the deploy directory is NOT on a different filesystem.
You may adjust these settings in the server editor.

JBoss: Deployment fails with ClassNotFoundException even though the class is there - JaxrsScanningProcessor

I have a WAR file with REST services. It deploys just fine on JBoss EAP 6.2 (corresponding to AS 7.something) in the standalone mode but it fails sometimes - but often - in the domain mode with a ClassNotFoundException for my subclass of the the JAX-RS Application class, even though it is in the war (well, it runs in standalone). Since it sometimes works, I suspect there is some concurrency issue that leads to JBoss trying to load the class before it can see it.
This is the error:
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start
service jboss.deployment.unit.myapp.POST_MODULE: org.jboss.msc.service.StartException in
service jboss.deployment.unit.myapp.POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment "myapp"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127)
...
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011230: Could not load JAX-RS Application class
at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.scan(JaxrsScanningProcessor.java:218)
at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.deploy(JaxrsScanningProcessor.java:100)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120)
[jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
... 5 more
Caused by: java.lang.ClassNotFoundException: myapp.rs.RestApplication from [Module "deployment.myapp:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197)
[jboss-modules.jar:1.3.0.Final-redhat-2]
...
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.scan(JaxrsScanningProcessor.java:214)
... 7 more
The class is there:
[jboss/domain]$ unzip -l data/content/6c/0ffc675ff1c2254540b6e8caffc0d2605ed549/content | grep RestApp
2262 02-13-14 09:05 WEB-INF/classes/myapp/rs/RestApplication.class
This is how I deployed it (my user != the user running jboss, if that makes a difference):
me$ /opt/jboss/bin/jboss-cli.sh -c --controller=0.0.0.0:49999 --user=admin --password=***
[domain#0.0.0.0:49999 /] deploy /vagrant/myapp.war --all-server-groups
The deployment fails in the same way when executed via the web Admin Console. The deployment to standalone is done by copying the .war to the standalone/deployments/ directory.
Any tips?
Config info
JBoss EAP 6.2
Rest Easy 3.0.6 (replacing the default 2.x module)
We have no JAX-RS stuff in web.xml aside of the resteasy.servlet.mapping.prefix context param; we use the resteasy-servlet-initializer library instead of manually configuring a servlet or similar thing in there
It seems I have fixed the problem by removing all resteasy/jaxrs/jboss libraries from the WAR file's WEB-INF/lib/.
I have noticed the war contained many libraries it should not, such as resteasy-jaxrs-3.0.6.Final.jar, jboss-jaxr-api_1.0_spec-1.0.0.Final.jar (which, BTW, conflicts with Rest Easy 3.0.6), javax.servlet-api-3.1.0.jar etc.
So I guess the classloader did not see/find the class because of classpath hell, the server and the webapp using different "instances" of the same libraries. (No idea why it worked under JBoss standalone; but standalone has the out-of-the-box configuration while domain has been adjusted a lot).
I have also sometimes included --runtime-name=myapp in the deployment command, which seems to be wrong, I should have used --runtime-name=myapp.war (including the ending).
Even though the Author had found an answer for himself, I think it might be useful to post my situation in case other people come accross this issue and the authors solution doesn't work for them.
I had a similar issue where a class was also not found when run under a Redhat JBoss AS cartridge inside Openshift, even though it seemed unreasonable, but later I figured out that the war I was expecting to be deployed wasn't deployed, instead a different one was deployed.
ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/].[HelloWorld]] (http--127.10.254.129-8080-1) Allocate exception for servlet HelloWorld: java.lang.ClassNotFoundException: com.company.app.HelloWorld from [Module "deployment.ROOT.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
So if there are possibilities, I would run a search of all war files which are expected to have that class, unzip them and search inside the contents to see whether they contain the needed compiled class. I really suggest trying to search for all possible wars. Also look for possible YOUR_WAR.war.deployed it is most likely going to be in the same folder as the war that is currently deployed.
In my case I had these wars:
./app-root/runtime/repo/deployments/ROOT.war
./app-root/runtime/dependencies/jbossas_custom/deployments/ROOT.war.deployed
./app-root/runtime/dependencies/jbossas_custom/deployments/ROOT.war
I was expecting the real one to be in ./app-root/runtime/repo/deployments/ROOT.war because that's where maven was creating it, but seems JBoss would later have to copy it to ./app-root/runtime/dependencies/jbossas_custom/deployments/ROOT.war in my case it didn't do that itself, so therefore my updated war was never deployed, instead it always went to deploy the old one which was already in ./app-root/runtime/dependencies/jbossas_custom/deployments/ROOT.war
Hope this helps somebody to get on the right track.

Tomcat 6 not deploying webapp folders OS X

I have used MacPorts to install tomcat 6 for use with launchctl.
launchctl start org.apache.tomcat provides the following result in Catalina.date.out:
java.io.FileNotFoundException: /opt/local/share/java/tomcat6/conf/Catalina/localhost/host-manager.xml (No such file or directory) at java.io.FileOutputStream.open(Native Method) and so on
Lo and behold, there is no folder called Catalina in conf.
I don't know if this is responsible for the applications not being deployed or not, but I felt that since it's a severe issue it should be noted.
Then comes SEVERE: Error deploying web application directory manager
java.io.FileNotFoundException: /opt/local/share/java/tomcat6/conf/Catalina/localhost/manager.xml (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
and for each of the folders in the webapps folder, I get
The scratchDir you specified: /opt/local/share/java/tomcat6/work/Catalina/localhost/examples is unusable.
I have been googling this for some time now, but I have not yet stumbled across an answer.
The issue was to do with Tomcat from Macports and permissions.
My end solution was to install and configure tomcat manually.