The moose likes Sockets and Internet Protocols and the fly likes Calling Struts from standalone Java application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Calling Struts from standalone Java application" Watch "Calling Struts from standalone Java application" New topic

Calling Struts from standalone Java application

Vijay Chandran
Ranch Hand

Joined: Jan 07, 2007
Posts: 186

Dear friends,

I am trying to call a Struts Action class from my standalone Java application. I am getting this Exception when i am trying to connect with the web server. Kindly provide me some help regarding this. I am using Sun One Web Server 6.1

>>>>> Exception caught in Utility :: getURLData:EXCEPTION::ioe=
ion: Server returned HTTP response code: 401 for URL:
/https-SAMBA_LoginServer/ with url= http://192.168.10
7.80:8888/https-SAMBA_LoginServer/ Server returned HTTP response code: 401 for URL: http://192
at utilities.Utility.getURLData(
at gui.LoginFrame.after_btLogin(
at gui.LoginFrame.actionPerformed(
at javax.swing.AbstractButton.fireActionPerformed(
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.jav
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
at javax.swing.DefaultButtonModel.setPressed(
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
at java.awt.Component.processMouseEvent(
at javax.swing.JComponent.processMouseEvent(
at java.awt.Component.processEvent(
at java.awt.Container.processEvent(
at java.awt.Component.dispatchEventImpl(
at java.awt.Container.dispatchEventImpl(
at java.awt.Component.dispatchEvent(
at java.awt.LightweightDispatcher.retargetMouseEvent(
at java.awt.LightweightDispatcher.processMouseEvent(

at java.awt.LightweightDispatcher.dispatchEvent(
at java.awt.Container.dispatchEventImpl(
at java.awt.Window.dispatchEventImpl(
at java.awt.Component.dispatchEvent(
at java.awt.EventQueue.dispatchEvent(
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
at java.awt.EventDispatchThread.pumpEvents(

at java.awt.EventDispatchThread.pumpEvents(


Thanks & Regards,
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

The HTTP error code 401 means the request requires user authentication.

[How To Ask Questions On JavaRanch]
srinivas kande

Joined: Nov 02, 2008
Posts: 1
can anyone give me a sample code to call a url or .do of a web application from a stand alone java program
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

Welcome to the JavaRanch.
There's a number of examples of how to access a URL here.
I agree. Here's the link:
subject: Calling Struts from standalone Java application
jQuery in Action, 3rd edition