WildFly 10 Deployment Issues - java

I am using an archetype from Maven called "spring-mvc-webapp, 1.0.0CR8" in my eclipse project. Infact i have not done anything to the project yet. I just want to deploy it and test it with the default application that comes with the archetype. I have spent hours trying to fix it but with no success
I call my application from the browser like localhost:8080/myapp and i get forbidden in the browser. But when i go to localhost:8080 i see the default home page of wildfly. When i go also to the management console of Wildfly, i see that my app is deployed yet it is not working.
Any idea to fix it is appreciated.

Related

How to deploy wildfly EAR application on opshift 3

Am trying to deploy my wildfy 10 EAR application to openshift.
I have successfully completed the following process.
Push project to a git repository
Create a openshift project
Create a openshift application in the project
Point application to the git repository
Configured webhook for the project.
The challenge now is that any time i try to access my application from the link i was given am directed to this page
I was actually expecting that i will directed to my project index.jsp page, just as it does on my localhost.
I also clicked on the Administration Console and still nothing, i cant login,
What am i missing please, how do i make my project work the way it's meant to.
Thank you.

Build web app in Eclipse to run on Tomcat

I'm a newbie in building web apps. I just created dynamic web project in my Eclipse and successfully ran the jsp file on tomcat (as an eclipse's plugin)
However, when I tried to ran it on my actual server it failed, and I found a post here where someone addressed this issue. But the problem is I don't know how to build my web app and
Thus the servlet was not compiled, and no File "myServlet.class" was
deployed to the server
Can someone direct me to the right solution please?

Spring MVC App runs in Eclipse but not Intellij - 404 Not Found

I've written a Spring MVC app that is functional on an app server. I'm attempting to switch development of this app from Eclipse and to Intellij. I am very new to the IDE so I'm not sure where I have gone wrong here.
When I run this application on the server in Eclipse it goes to localhost just fine and works as expected. I created a run configuration in IntelliJ, the app compiles and the server log says it was deployed successfully.
However in the browser it gives the standard HTTP Status 404 - Resource Not Available.
I really don't think it's the servlet or web.xml because those are working just fine in Eclipse. I've also created a brand new app in Intellij to test it and it works fine. So it must be something specific to IntelliJ that I have misconfigured or not setup at all...any ideas? Let me know if you need to see specific screens or anything.
So after toying with this, making it worse a few times, and then getting it back to the original 404 I found the difference.
Eclipse has an internal tomcat server it runs projects on, Intellij runs its projects on the default tomcat server installed on your computer. Intellij exports the project you are running to the server in the web apps folder as the name of your project.
So after I found that, in my tomcat run configuration in Intellij I had to specifiy the application context. Edit Configurations -> Deployment tab -> Application context, and set it to /YourProjectName. My guess is that this tells tomcat where to find your project within the web apps folder.
I hope this can help anyone else who is a relative beginner to tomcat/java EE and intellij like I am.
There is a plugin in intellij called "Smart Tomcat", it allows running spring or web app with much fewer configurations.

Spring MVC application deployed on Tomcat does not run on IntelliJ

I try to run a basic Spring MVC application, like the one here (or also the Spring MVC tutorial here).
I just open the project in IntelliJ, import it on a Tomcat 7 instance, and start the Tomcat server. But when I try to reach the http://localhost:8080, I get a 404 error.
The project I downloaded from GitHub provides 2 ways to start the application, with mvn jetty:run or mvn tomcat7:run. When I run any of these commands (outside IntelliJ), the application starts succesfully, and the web page is displayed correctly on the http://localthost:8080 URL, which led me think that the problem comes from IntelliJ.
Adding some debug information, it appears that when run under IntelliJ, the WebInitializer class is loaded, but not the WebConfig class, even if the method WebInitializer.getServletConfigClasses() is called.
With mvn jetty:run or mvn tomcat7:run, both classes are correctly instantiated.
Unfortunately, I have no error at all in any logs provided by Tomcat / IntelliJ, so I'm a bit lost.
What I am doing wrong, or what I've missed in the configuration of my project in IntelliJ?
Thanks
Technical info: Java 7, Tomcat 7, IntelliJ Ultimate 12.1.4, Spring 3.2.2.RELEASE
My problem is solved. I was using Tomcat 7.0.8 in IntelliJ, while the tomcat7-maven-plugin relies on Tomcat 7.0.30.
So I downloaded the latest version, 7.0.42, and now IntelliJ is working fine.
I'm not sure what feature was missing in the 7.0.8, but IntelliJ was not able to start my Spring MVC application correctly.

Running a multi-module Maven web app in Eclipse

I'm trying to run a multi-module Maven web app in Eclipse (EE Helios SR 1). In NetBeans one have just to click the run button. But here it's probably a little more complicated.
I've added Tomcat 7.0.26 as a server for the war module of the project. When I try running the app, in the Servers part of the window I see Apache Tomcat v.7.0.26 at localhost [Started, Synchronized], but browser doesn't react. Does the system browser need to show the page when the app is running?
I tried to move to localhost:8080 and localhost:8080/welcome.html (the second one should be processed by the app) when the server was started, but I got 404 error both times. I also didn't see the new folder in the apache-tomcat-7.0.26/webapps/. Should Eclipse place the project there when running the application? I'd be really grateful if someone tells me what I'm missing here.
If not specified, tomcat integration with eclipse deploy by default war to a specific folder in .metadata, in my case somethings like: ~/workspace/<my_project_workspace_name>/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/
Every war are then unzipped to a folder. If your maven pom.xml you'll find a
<build>
<finalName>myapp</finalName>
</build>
Then it'll deployed to tomcat as :
localhost:8080/myapp/welcome.html
I have had a lot of bad experience with running web servers in Eclipse. Most of the time, this was related to unreliable class/resource reloading.
My solution was to add Jetty to my app in a new module (see Embedding Jetty). This basically turns my web app into a Java application, avoiding most of the problems. It also allows me to specify a filter (written in Java) when the app should reload.
This solves all the problems with class reloading (classes and resources are never copied anywhere; they are loaded from Eclipse's bin folders), startup is much faster (we got the startup time from several minutes down to 15s) and reliable.
Maven Projects are different from the ones with Web Application Facets, You cannot directly run a Maven App as a web app because the folder structure is different. In order to run your application directly from eclipse, try to add Web Application nature to your maven project [A complex modification involving modification of .project and .classpath files along with addition of few other files]. I would recommend modifying your pom.xml file accordingly

Categories