If I deploy my war file, my project runs fine.
I explode my war file and deploy it manually, the project runs fine.
If I deploy my project via the JBoss Tools, the project is now exploded as expected. Unfortunately, if I try to access a web page, I get a NoClassDefFoundError.
So why is my project not working with the JBoss Tools ?
Caused by: java.lang.NoClassDefFoundError: gbt/osmoze/view/GuestPreferences$1
at deployment.osmoze.war//gbt.osmoze.view.GuestPreferences.init(GuestPreferences.java:59)
... 81 more
I'm using JBoss Tool 4.27.0 Final, Wildfly-25.0.1.Final, Eclipse 2023-03
There are a few things you can do to try to shake out what's wrong.
The first is to try to restart the deployment after it's been deployed by JBossTools. If you are deploying a war or ear, you can usually go into your deployments folder and touch or create a file named your.war.dodeploy. This will tell the app server to restart the deployment.
Sometimes this works if, for some reason, the application server started to deploy the application before all the files had been copied over.
Another thing to check is that the deployment generated by JBossTools actually 100% matches the manual deployment you do. You can use some filesystem or diff tools to verify that all files in the manual deployment have a match with the same location and file size in the JBossTools generated deployment.
A lot of this will also be complicated by the type of project you are using. If you have a WTP-style project, you may find that the WTP "deployment assembly" page for your project is missing key folders or entries. If you have a maven project, the configuration in the "Deployment Assembly" page may be completely wrong. If you are using m2e-wtp to import and configure your project, it's still possible the deployment assembly page has some errors or unexpected entries, and it's always worth checking further.
As always, an example project in which this problem is easy to replicate will help the JBossTools team to debug and investigate the problem. You can open an issue at https://github.com/jbosstools/jbosstools-server/ but without either an example project or some element of debugging on your own is unlikely to yield results. But if you do find that (for example) touching the your.war.dodeploy file fixes the problem, or that the generated deployment does not match the manual deployment 100%, this information can help get to a solution faster.