How to run on JBoss html file with Eclipse - eclipse

I am creating a Static Web Project using Eclipse Juno Service Release 2.
My problem is that I have an HTML file (very simple, created automatically with Eclipse with HTML5 template) in this project and I would run it in an external browser (for example, Chrome) using as Server JBoss 7.1.
I have already configured properly JBoss in Eclipse, I can run/stop it without problems.
I have configured as Web Browser Chrome.
I don't know how run the single html file in my localhost:8080.
Someone can help me?

If you have created the project then you would have to deploy it.
Refer to http://www.mastertheboss.com/eclipse/jboss-eclipse/jboss-and-eclipse?showall=&start=1 which describes how to deploy an application.
And your URL to the file would be http://localhost:8080/yourProjectName/htmlFileName
Example: http://localhost:8080/TestApp/index.html

Related

How to run/debug java web service project in eclipse

I have a Java Web Service project which was just handed over to me by a colleague who just resigned (no one is assisting me in my new company). Im new to Java (J2EE) and my background is .Net + frontend + azure so I am pretty much very confused with setting up and running the java project. Also, Since my background is .Net Im referencing everything with how things work in Visual Studio from running a project, setting up a project to setting up and debugging a WCF project which I realized now is very different from eclipse + java.
I would really appreciate if someone could explain to me how I can run this project which is supposedly a java web service (as I was told)?
First I have a project that is like this:
Im assuming that the project boxed as blue is the webservice (and the rest are just libraries)? Is this correct? if so how do I run and debug the project using eclipse
Second when I click on debug as -> debug on server this is all I see:
Another colleague told me to install JBOSS (I haven't installed a server in eclipse) because that is what they used. Is there good documentation (step-by-step guide) on how to install JBOSS to run in eclipse. Im assuming that JBOSS + eclipse is like IIS express + Visual studio. Are there also other alternatives to JBOSS + eclipse like perhaps tomcat + ecplise that I can configure.
I really really find it hard to setup the java web service project in eclipse I have little to no prior experience with java j2ee programming especially with web services so any clarifications with my questions would be much appreciated. To sum up:
How would I really know that the project is a java webservice?
If so, how do I run the project and host the project using debugging in eclipse with tomcat or jboss?
I would appreciate if anyone can point me to the right direction of figuring out the source code
From here we can only guide you, you will have to go through some tutorials to understand how java projects work.
Your project is a webservice project according to your web.xml file because its having context params for rest.
the context param sets a front url to your webservice which in this case is gametime.
Check these tutorials and you will understand how it works
http://www.mkyong.com/tutorials/jax-rs-tutorials/
Create simple examples given in the above tutorial and then you can execute your's program
Jboss is a application server which we use to run our app.
You can install jboss in eclipse or you can use it externally also.
To install eclipse and jboss you can follow the link
http://theopentutorials.com/tutorials/java-ee/installing-jboss-tools-in-eclipse/
The other option is to download eclipse and jboss seperately
and use them.
Go to jbosshome/bin
If you download both of them seperately
then in that case for jboss
Invoke the add-user.sh or add-user.bat script. ...
Choose to add a Management user. ...
Choose the realm for the user. ...
Enter the desired username and password. ...
Choose whether the user represents a remote JBoss Enterprise Application Platform 6 server instance. ...
Enter additional users. ...
Create users non-interactively.
After this go to eclipse and follow steps of below link to add jboss to eclipse
http://www.mastertheboss.com/eclipse/jboss-eclipse/jboss-and-eclipse
A Java web application among other things has a predefined directory structure including folders named WEB-INF, WEB-CONTENT etc.
On how to deploy a web application to Tomcat via Eclipse you can follow the steps in this tutorial.

How can I deploy a Java-Spring Maven Application on Tomcat v8.0 (Restful WebService)

I am unable to deploy the Spring-Maven Restful WebService on Tomcat v8.0. My OS is windows 7. When I deploy it through Tomcat App Manager then I get a screen with the link "Click To Enter", although I have not created any links like that. Please see the image below.
Thanks,
This is exactly how it is supposed to work. When you create a new "Simple Spring Web Maven" project in Eclipse (I guess this is what you did), the wizard creates a working Maven project that can be immediately built with Maven. The created WAR can be, in turn, deployed to Tomcat (i.e. copy the WAR file to the webapp folder of Tomcat) or whatever container you are using.
As I said in the comment, it looks like you actually managed to deploy the WAR and what you are seeing is the default home page corresponding to the "index.jsp" file, that is created by the wizard.

Glassfish server can not run html page in Eclipse

My ubuntu crashed and I started to setup all the development environment again.I imported my project from github. Adjusted project facets from Eclipse project properties to Dynamic Web module 3.0, Glassfish web extensions 3.1, Java, Javascript and JPA 2.0. My glassfish server 3.1 is started and running.localhost:8080 shows the server is running. My project is also added to server configuration. When I right click one of html pages and select run as -> run on server nothing happens. No error message or non started html page in the browser.
What could be the problem? Any help would be appreciated. Thanks.
I started a new dynamic web project with same project facet details and noticed glassfish-web.xml file under web content -> web-inf
In my previous project I had sun-web.xml and web.xml files and after copying the glassfish-web.xml file under same folder html page started to opened with browser.

how to deploy servlet in Web browser?

I have create My First "Hello World" Servlet in Eclipse.
It is running properly in Eclipse Browser.
I'm using Apache Tomcat, and it is also running properly.
How can I deploy my Servlet in Web browser like Internet Explorer, Chrome, Mozilla Firefox etc? I don't want to deploy my servlet in Eclipse browser.
You don't deploy to a browser. You deploy to a server. Just deploy to server and start the server the usual way (as you did in Eclipse). Then, just enter the servlet's URL in the address bar of the webbrowser of your choice yourself. It can be exactly the same URL as you see in Eclipse browser's address bar. If necessary, bookmark this URL in your favourite webbrowser so that you don't need to copypaste/enter it yourself everytime.
Go to Window menu in eclipse then click on "web browser" then click on "Internet explorer".That't it.....
Firstly, servlets are not deployed in Browsers, they are deployed on server and accessed through browsers.
Secondly: what you can do is, just copy paste the URL from eclipse browser to mozilla or chrome to access your servlet. All that you have to make sure is that the tomcat server configured in your eclipse and on which application containing this servlet is deployed, is up and running.
If you want to access this without eclipse tomcat, goto the local tomcat installation, you should have a deploy folder there, create a war file of your webapplication and copy it to the deploy folder and start te tomcat server.
You deploy application in WebServer (Tomcat in your case) not in browsers.
In eclipse, add your application in tomcat server (in servers view), start the server and open a browser of your choice.
Then put in url http://localhost:8080/NameOfYourServlet
Just copy the url from eclipse browser and paste on url bar of which browser you need. There is no separate deploy for each browser. Another thing you can change your eclipse default browser.If you changed, project will start in browser you selected instead of eclipse browser.

Encoding problems running jsp web pages on Apache Tomcat

Sorry for my English.
I'm not a web page developer - I use already created jsp (I can not change them by my own), placing them together with different URL parameters - that way I create some complicated web project.
I have been using Apache Tomcat for a long time and had an error - cyrillic (cp1251) symbols doesn't show well in some places (not everywhere!) of project. Developers of jsp said, that it is a bug and they will fix it. Time goes by, but they do not.
Recently, I have imported EAR as project in Eclipse, created Tomcat server there. Before that I read this article:
http://www.vogella.de/articles/EclipseWTP/article.html
and installed all soft, specified in article to be able to work well with Tomcat project in Eclipse.
And I noticed, that when I publish project to Tomcat Server (created in Eclipse - it has it's own server) I had no errors with encoding! I think this is somehow connected to Eclipse & Eclipse Tomcat Server settings.
Question: Can I copy this settings to a real Tomcat Server (not Eclipse) for correct encoding everywhere? And what are this settings?
I also had a similar problem. My war was running on Eclipse Tomcat but when deployed manually on Tomcat, some web service involving currency symbol was facing encoding issues. Eclipse Indigo has some encoding for server.
This can be seen/edited through Run Configrations -> Common Tab. Changing this attribute produced consistent results for manual deploy and Eclipse deploy. I am not sure what this encoding is of, but it may set JVM's encoding.