eclipse howto start a application client on java ee glassfish appl srv - eclipse

i have installed the glassfish eclipse tools bundle...
i can start a project like dynamic web & a ear project and deploy them on the glassfish... it works perfect & under the localhost url i will get an hello world
but how i do this if i want to make an application client. please help...
at the moment i simply created an "app client project in eclipse" & added it to the same ear,
but i have no idea how to start this...
help - any tutorial how to start?!!

Not the only only answer to this question but the appclient approach mentioned in Jeff's answer is a viable approach, but I was able to execute a client using this mechanism in eclipse and I wanted to share that approach.
This approach will let you execute a java application with a main method acting as a client.
What you want to do is setup an External Tools Configuration.
Create a new Program type of external tool configuration.
Set location to point to the path of the appclient, for me
(using embedded glassfish eclipse plugin) it was [PATH TO ECLIPSE]\plugins\oracle.eclipse.runtime.glassfish_3.1.1.0\glassfish3\glassfish\bin\appclient.bat
Set working directory to your output/build directory e.g.
${project_loc}/target/classes
Set arguments to ${java_type_name}
Select the class in your project with a main method that you wish to run as the client app and then select your external tool from the run external tools menu.

There are two ways to do it. I'm afraid I can't be very specific, but I can point you in the right direction. (I'm just learning myself)
You can enable Web Start for the application client EAR in GlassFish. You can do this either in the deployment descriptor (so it's enabled every time you deploy) or you can go into the GlassFish admin console, navigate to the Application, and check the checkbox to enable it. I have made a little progress on this approach.
You can run it manually from the command line using, I believe, the "appclient" command. I have not been able to get this working yet.
Good luck, and if you learn more, I'd appreciate it if you let me know since I'm in the same boat as you.
Jeff

Related

Entreprise-Application deployed succesfully but it is not running

I am trying to develop my first web-application based on java-EE. This application should be deployed on WildFly application server. For That purpose, I made my inspiration from https://bitbucket.org/lassitercg/example/src.
I made some modifications on my Code.
I am developing this application using IntelliJ-Community. The Application was successfully deployed.
whenever I try to access the application using the following URL localhost:8080/startweb, I get the http status code 404. The code can be found unter this link https://github.com/amitakCsNew/startweb
Since I using Intellij Community edition, I am forced to deploy the application then set the breakpoint in the Controller of the application. The application seems to be succesfully deployed, but I am not jumping to the first breakpoint.
any Idea how I can solve this problem ?
Your webapp layout is wrong. Please refer to the standard Maven directories layout.
You need to move webapp directory to src/main. Then update pom.xml file reference to web.xml, then move META-INF from resources into webapp then fix your syntax errors in index.xhtml (the same h namespace is associated with 2 different URLs), then fix/implement your database, then add faces servlet in web.xml, add faces-config.xml, then your web app should be available at http://localhost:8080/startweb/.
Once you resolve all the problems and the controller code finally executes, you will be able to debug it from the IDE using Remote debug configuration.
If you are new to all of this, I'd suggest starting with something more simple, like a single JSP page and a single Java servlet.
Post the new questions if you have issues describing what you did to solve the problem and what exactly didn't work. The current question is too broad and your sample project has too many issues to cover in the single answer.

How to deploy angular2 on tomcat?

First I'd like to describe my set up:
I have a web service, let's call it "Cars", written in Java, that I've tested in eclipse with tomcat v6, working local (it was a requirement, so that once it works locally I can switch to do it with a "real" tomcat server so others can access). It works, it access the database, it offers an answer for certain URIs and so on.
I have coded in Plunker an angular 2 application, "WebCar", and I now want to run that on my computer, with a Tomcat server (unless there is a better way of doing it, I've been told to do it with Tomcat. Since I do not know any better option, that's why I talk about tomcat all of the time). With eclipse, I have already managed to get the app running, using palantir plugin for typescript https://marketplace.eclipse.org/content/typescript , and then running the project with a server-launch.js which contains require('lite-server'); , this allows me to see the same I saw on plunker, so, it works, but before I upload anything to the business servers I wanted to check everything works (hence the set up, which may not be necessary but it's what I come up with).
I now want to go one step further and use, if possible, tomcat v6 to run my angular 2 app, instead of simply using that lite server, so that I can test that it works, and then uploading it to a "real", remote server.
I would like to know what options are there, what would be a better option, and anything that is required to make an angular 2 deployment properly. So far I've found this
https://stackoverflow.com/a/34408495/6028947 " You only have to deploy
.js files, since anyway browser won;t" which I don't fully get,
http://jspm.io/ which is for SystemJS (I have an older version of
Angular 2 and use config.js)
https://stackoverflow.com/a/37568235/6028947 which talks about
angular-cli or webpack, which makes a bundle but if I got that
running, I still don't know what to do with it to upload to Tomcat
and then connect it to my web service.
So maybe the question should be (I don't know for sure): Once you get your angular 2 code bundled, what's next?
Btw there are a few other questions on stackOverflow, similar to this, but as far as I've seen, without any answer at all or with answers only obliquely related to this (and of course, nothing resembling a guide or step by step required)
Thanks to #nuzz for this ..
I'm running a little script to build the project and then copy it to tomcat. I'm telling angular what the base directory is that it will run under in tomcat.
#!/bin/sh
ng build --base-href /angular/ --prod
mkdir -p /home/xxx/apache-tomcat-8.0.37/webapps/angular
cp -R /home/xxx/angular-clitest/dist/* /home/xxx/apache-tomcat-8.0.37/webapps/angular/
Once thats run, start tomcat and you can access it at: http://localhost:8080/angular

Create GAE eclipse project

I have installed Eclipse Java EE Luna Release (4.4.0) and App Engine SDK 1.9.10
I have created a new Google - Web Application Project and selected the Generate Project Sample Code option. I changed nothing about the project.
The generated project successfully deploys and runs locally. However when I deploy this to AppSpot I get an error message "Remote Procedure Call - Failure" when clicking on the "Send" button on the sample form.
Are there other steps I need to perform in order for the generated project to be successfully deployed to AppSpot?
My goal is to have a starting application that deploys so I can start learning to use Objectify and GWT to build applications. If there is a better way to go about this please suggest it.
Kind regards
Sean
I think seem to remember that sample code for the GWT builds a RPC-based HelloWorld or greeting example. In the auto-generated sample interface you type a name, a RPC call is made to server side and you get "Hello"+yourName or similar as a callback.
Check this link:
http://www.gwtproject.org/doc/latest/tutorial/appengine.html
This is a more advanced app, StockWatcher, from the GWT tutorials which is also RPC based and adapted for the GAE. You could start here: http://www.gwtproject.org/doc/latest/tutorial/gettingstarted.html to build this app (is really easy) and follow to the link above to deploy StockWatcher on the GAE, or check directly the steps on the first link and try to deploy the GWT "Greetings" example.
If you have already tried this or you do and there's still a problem, please provide the full stack trace, or the code you think might be causing the problem, so we have a better insight of the problem.

Netbeans Web Service Client not found

I've always used eclipse before, but I'm using Netbeans for the first time because of it's integration with Web Service clients.
However, after following multiple tutorials, the way to add a web service client is to:
https://netbeans.org/kb/docs/websvc/flower_swing.html
Make a new project
Right click on your project, New->Other->Other->Web Service Client
However, I do not have the web service client option available, not sure what I am doing wrong.
Please mention the net beans version you have. You should use newer version of the IDE to use latest features.
For other developers who will face this problem like me, I will leave my answer here.
I'm currently using Apache NetBeans IDE 11.0 and it's in Web Services -> Web Service Client. If you still cannot find it, just use filter feature. I found it with filter.

How can I run the example project of Google App Engine + GWT in Eclipse?

Ive installed the Google Plugin for Eclipse and created a demo project using App Engine and GWT. Now I want to launch and see it. But after compile nothing else happens. Shouldn't there be an integrated browser that shows the app?
You need to right click on the project name and hit run > web application. Compiling it is for deployment, and most likely not what your looking for from running. The key differences here are hosted mode handles the cross-compilation for you, while compiling is meant for deployment of the javascript to your web server.
As far as I know, you just point your browser (any browser) to http://localhost:8080. Is that not working for you?
I get it running externally on the command line with
dev_appserver .
or to upload to the google site
appcfg update .
for python they're .py files and for java their .cmd calls
wish I could mix and match my languages/GAE environments
You can right click your project and goto Run as > Web Application.
You can see that a local Jetty Server.
You can manually type the address http://localhost:8888 or you can access through cmd