Exporting Wicket to a Web Server - eclipse

I'm serious when I say have been all over the internet and on google for past few hours trying to find an answer to this question. Ok, I have already coded and compiled a working wicket in Eclipse. It runs in Eclipse just fine but I now need to export this to my webserver. How do I do this!? It's such a simple concept and yet no one has talked about it. I know I need tomcat, but they don't say how to export the files. If a JAR file works. If I need to configure Tomcat is some way. How to get this to work with an already running web apache server. My guess is that tomcat has to be running to execute the java portion of the wicket and then you can just point a link to your index.html. But I have no idea. Enlighten me please with a step-by-step tutorial? I'm a slight beginner with Eclipse and started using Tomcat and Wicket only 2 days ago.

Its preferable to pack your project into a war file distribution.
An easy approach to do that, is to use Apache Maven for building it.
For Maven there are plenty of plugins available, one of them is a "war" plugin, which helps you creating your war / web archive.
The war file you have simply to put into the webapp of a fresh downloaded tomcat.

There's a couple ways but one way is you can compile to a .war file and deploy from the admin console in tomcat. See here for the tomcat documentation.

In Eclipse, right click your web application project, select Export -> War File and follow the wizard.
When you have your .war file ready you can then upload it to a Tomcat or Glassfish installation.

Related

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.

Teaching Eclipse To Deploy an Ant Generated WAR File With JBoss Tools

I've been asked to migrate an older Ant-based web application. I'm building and trying to deploy using Eclipse Luna with JBoss Tools 3.0.1.Final. JBoss instance is EAP 6.3.0 (AS 7.1).
The build tool, like I said, is Ant. And when I run ant package, a valid WAR file is created at /target/foo.war
For some reason I'm having a heck of a time trying to explain to Eclipse and JBoss server that the foo.war file is what I want to deploy.
To this end I've:
Right-clicked on the project root and opened the Properties dialog.
Declared custom Ant builder for the project by going to Builders and adding an Ant builder and disabling the default Java builder.
Now Project -> Clean removes the target/ folder; Project -> Build results in a /target/foo.war file.
So far so good. At this point, I think all I need to do is declare that foo.war file as the Web Deployment Assembly? If I go to Web Deployment Assembly and click Add, then add the target/foo.war file, it tries to add it as a project library (i.e. WEB-INF/lib/foo.war). So clearly that's wrong.
I've also gone to the Server view, and tried numerous settings in the Deployment tab. The closest I've come to what I'm looking for is the Default Settings, but I haven't had any luck there, either.
(When I start JBoss via the JBoss Tools in Eclipse, then pull up the management console on port 9990, I can upload and deploy the WAR that way with no issues.)
I'm sure there's something completely obvious I'm missing. Could anyone help an IntelliJ user out? I have seen https://stackoverflow.com/a/4261178/3223711, but it seems to be missing the "last mile" in that the problem is not generating the WAR but in getting JBoss to actually pick it up and use it.
Thanks!
Since you are not actually not configuring the project to be a war project by Eclipse knowledge you need to tell JBoss Tools that you wish to deploy the specific war file.
To do this right click on the target/foo.war and select 'Mark as Deployable' - this tell JBoss Tools this foo.war can be deployed meaning you can now drag it to a server or add it via Add/Remove on the server.

Running Maven project on glassfish server

I want to run web based Maven project on glassfish server. I am totally new on maven. However, i have successfully build the maven project and glassfish server is up and running also. Moreover, there is WAR file also in target folder but i am confused what is the next step to run that project on glassfish ?
Any help will be highly appreciated.
You have different options to solve this task:
If you are new to Eclipse I suggest to change to NetBeans. It comes with integrated support for application server deployments. You just add your maven (or nearly any other type of project like WAR, EJB and EAR) project and your desired application server instance (Glassfish) and you are ready: Right-click your project and choose Deploy and it'll get deployed to your server. NetBeans also supports hot-deployment.
You can deploy your WAR file manually in GLASSFISH_ROOT/glassfish/domains/domain1/autodeploy and it'll get deployed if your server is running. But this is not very efficient during development.
If you want to stay with Eclipse you can use the maven-glassfish-plugin or this maven plugin to do the deployment for you. I'm not sure which one is better but this topic is also discussed in this question and this question.

Liferay portlet development on JBoss AS 6

I am trying to create a new Portlet project (basically a portlet for Liferay) in Eclipse (Helios with Liferay SDK installed). I use JBoss AS 6.10.final and Liferay 6.05.
The problem is that everytime I try to create new portlet, it asks me for Runtime Enviroment. I want this enviroment to be JBoss AS, but Eclipse only suggests different Tomcat distributions. I dont have Tomcat bundle installed and I am not going to since it will run on JBoss AS.
Liferay is already installed on JBoss and running (when I start the JBoss AS, I can access the liferay portal page - it has all jars and wars on correct places in AS).
I havent found any tutorial how to make this work. Could someone perhaps provide some step by step guide or direct me to any existing one? Thank you!
PS: I hope that my question is not too confusing, if so, I will try to edit it and make myself clearer...
I have finally figured it out:
I changed the build.username.properties file
app.server.portal.dir=c:\\Programs\\jboss-6.1.0.Final-ESB-4.12\\server\\default\\deploy\\liferay-portal-6.0.5.war
app.server.lib.global.dir=c:\\Programs\\jboss-6.1.0.Final-ESB-4.12\\common\\lib
app.server.deploy.dir=c:\\Programs\\jboss-6.1.0.Final-ESB-4.12\\server\\default\\deploy
app.server.type=jboss
app.server.dir=c:\\Programs\\jboss-6.1.0.Final-ESB-4.12
so it points to the directory with liferay war files. Then I had to check in Eclipse that I do not want this file to be overwritten again and it works just fine. I can deploy all projects to JBoss using Liferay SDK!

Integrating JBOSS and Eclipse

I have JBOSS server. I used to make web applications using just notepad++. I used to create the necessary folders like web-inf and files like web.xml. For larger projects doing all this and manually compiling has become cumbersome. I want to use eclipse for that. I saw this tutorial - http://www.eclipse.org/webtools/community/tutorials/BuildJ2EEWebApp/BuildJ2EEWebApp.html . But I don't understand how to make a server. I already have a server. What I want to do is write JSPs and Servlets in eclipse and the build should automatically be deployed in jboss server.
How to to this?
Install JBoss Tools
After that follow the instructions from here to get started and deploy apps to JBoss Server.
To automatically deploy apps after the build you could use a build tool such as ANT or Maven.
I wrote a tutorial for this some time ago: Setting up web development environments with Eclipse
It shows how to setup JBoss within Eclipse (in addition, it also shows how to setup Tomcat and Weblogic), and also shows how to build a simple sample Servlet to verify the proper installation.
If you already use JBoss on the server side, then have a look at the client side as well: http://www.jboss.org/developer
(I haven't tried it myself, but...)
Just open eclipse then go to:
"Help-> Check For Updates" It will check for eclipse updates and installs new availables.
Now "Help -> Eclipse Market Place" Search for "Jboss tools" from search result select one(as your eclipse version) and install it. It will add adapter for new jboss versions.
Now add new server from server view select Jboss version then next add your Home directory of jboss. Then finish.
Step 1 is optional but it sometime it helps.