How to call a servlet on Glassfish server in Eclipse - eclipse

I am trying to call a servlet form my android application in eclipse. I have to use the Glassfish application server(the servlet is in a different Mavan project). I had a few questions:
How to start a glassfish server in Eclipse?
What URL do I pass in the HttpPost() method?
Thank you.

There is the Servers view in which you can add you GF instance. However, this is not mandatory and you can run it from the command line (asadmin).
If your GF runs locally, the URL will start with
http :// localhost/webappName/servletPath
localhost or 127.0.0.1
I'd advise you to get a training as the more you'll progress, the more questions you'll have.

Related

Aws backend code debugging

I deployed my backend code(used framework is drop-wizard) in the form of jar file on AWS(Amazon Web service) server. I want to know is it possible to debug that jar file(jar file deployed on the AWS server) using eclipse on my local pc?? If yes than please display the way of how to do it??
Looking for a good response
Thanks
First, you need to start your application with remote debugging
enabled. With dropwizard, you are typically starting the application
on a server with:
java -jar myapp-0.0.1-SNAPSHOT.jar
Change this to:
java -Xdebug -agentlib:jdwp=transport=dt_socket,address=9999,server=y,suspend=n -jar myapp-0.0.1-SNAPSHOT.jar
This sets up Java to listen for remote debugging sessions on port
9999. Make sure you choose a port that's not blocked by firewalls or
your AWS security configuration.
Next, you have to configure Eclipse to connect to the remote
application for debugging. In Eclipse, right click on the project and
select Debug, Debug Configuration. Create a new configuration of
Remote Java Application. Set the host to your AWS server and the port
to 9999, as above.
Now you should be able to set a breakpoint in your code and start a
debug session on the remote server.

Debug Struts Action Classes

My application runs on a remote server.
I use tomcat to deploy the web based part of my application.
The flow is Action classes calls the remote classes using RMI.
I am using Eclipse and When I browse a page, am able to debug the remote java classess, But I need to debug Action classes also as it also contains more logic.
How will I do it, Please help, Thanks in advance.
Regards,
Sridevi
Either launch Tomcat in debug mode from Eclipse, or launch tomcat with remote debug options, and attach a remote debug session from Eclipse to this tomcat server (in a similar way as you're probably doing for the remote RMI server).
See http://wiki.apache.org/tomcat/HowTo#How_do_I_debug_a_Tomcat_application.3F for how to start tomcat in remote debug mode:
set JPDA_ADDRESS=1044
set JPDA_TRANSPORT=dt_socket
catalina jpda start

how to run my sip servlet in netbeans

I am new in SIP server development. I read a lot about sipservlet and sailfin like
SIP servlets, chatserver
If I write that code in netbeans I cannot right click on the sip servlet and click run as it told me it doesnot contain main method or it is not in web.xml.
I am confused:
1- Why I need sailfin to run my sip application
2- Can I run my sipservlet in netbeans like httpservlet
3- How I can register my servlet with any ip.
Thanks
Sailfin has been killed by Oracle, please checkout Mobicents instead http://dzone.com/links/mobicents_sip_servlets_200final_with_support_for.html

404 error when trying to run PHP application on Glassfish 3.1.1 through Netbeans

While there are some similar posts about this issue, none seem to fit my problem exactly, so I would like to ask if anyone knows what I am doing wrong.
I am trying to run a PHP web application that I created in Netbeans. I am using Glassfish 3.1.1 as the web server. Whenever I run the application through Netbeans (by selecting the project, right clicking to get the context menu, then selecting "Run"), my browser opens to what I believe to be the correct url, but all I get is a 404 error page stating the following:
type: Status report
message:
description:The requested resource () is not available.
Am I missing some crucial configuration step?
I have checked my hosts file and it contains the entry:
127.0.0.1 localhost
Is there something else I need to do?
I have PHP 5.3.8 installed and all php commands run from the command line.
Would it be something in the php.ini file that needs to be configured?
I am stumped. Any help would be greatly appreciated.
ANSWERED
Please accept the comment below from Jonathan Spooner as the correct answer.
Just install Quercus within GlassFish 3.x and you can run PHP and Java.
As I stated in the comments, GlassFish and Apache Tomcat are Java application servers. In order to serve PHP pages you'll need to install a web server such as Apache HTTP web server. You'll also need to configure Apache to serve PHP files.
Something that you might look into is WAMP (Windows/Apache/MySql/PHP). This offers a simple way to get up and running quickly with little to no configuration.

gwt response at run as web application

In my gwt application,i am using php code for back end process...i can get response from that php file when i deploy on iis server...
but i can't get response from that php file when i running from the eclipse...
(i.e)
can get response from this url "http://localhost/sample/index.php"
can't get response from this url "http://localhost:8888/sample/index.php" it returns my php code...
It's probably possible to run PHP on Jetty, too: See these instructions - not sure, if they still work with Jetty 6, and I really haven't tried it.
But I would recommend to simply run a separate PHP server (maybe deployed from a separate Eclipse project). See this GWT FAQ entry: How do I use my own server in hosted mode instead of GWT's built-in Jetty instance
You could use the gwt -noserver option
"The -noserver option instructs hosted mode to not start the embedded Jetty instance. In its place, you would run the J2EE container of your choice and simply use that in place of the embedded Jetty instance."
I don't know if this would solve your problem