• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: InvocationTargetException on new WORequest
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: InvocationTargetException on new WORequest


  • Subject: Re: InvocationTargetException on new WORequest
  • From: "Eric E. van Leeuwen" <email@hidden>
  • Date: Mon, 2 Jun 2008 11:52:45 -0700

Application:
Error: java.lang.reflect.InvocationTargetException
Reason: com.webobjects.appserver.WORequest.<init>(Ljava/lang/ String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Lcom/ webobjects/foundation/NSData;Ljava/util/Map;)V
Stack trace: File Line# Method Package
DirectAction.java 132 validate com.apple.audioprojectdatabase
DirectAction.java 37 defaultAction com.apple.audioprojectdatabase
NativeMethodAccessorImpl.java NA invoke0 sun.reflect
NativeMethodAccessorImpl.java 39 invoke sun.reflect
DelegatingMethodAccessorImpl.java 25 invoke sun.reflect
Method.java 585 invoke java.lang.reflect
WODirectAction.java 128 performActionNamed com.webobjects.appserver
WOActionRequestHandler.java 240 _handleRequest com.webobjects.appserver._private
WOActionRequestHandler.java 142 handleRequest com.webobjects.appserver._private
WOApplication.java 1306 dispatchRequest com.webobjects.appserver
WOWorkerThread.java 173 runOnce com.webobjects.appserver._private
WOWorkerThread.java 254 run com.webobjects.appserver._private
Thread.java 613 run java.lang



Line 132 of DirectionAction.java == outgoingRequest = new WORequest("GET", URL, "HTTP/1.1", null, null, null);


Thanks again!

Eric

On Jun 2, 2008, at 11:10 AM, Chuck Hill wrote:

Can we see the stack trace and exact exception message?


On Jun 2, 2008, at 11:01 AM, Eric E. van Leeuwen wrote:

All,

I've been searching the archives (as well as the web in general) for a while now and can't find exactly what I'm looking for. I have a DirectAction defaultAction() that check's to see if a specific cookie is present and depending either performs the login() or validate() method. The login() method works without a problem. The validate() not so much. What seems to be happening is, I'm getting a InvocationTargetException on creation of a new WORequest object. The following is a code snippet:

protected WOActionResults validate(String cookie) {
String protocol;
String host;
String port;
String appId;
String appAdminPassword;
String func;
String ip;
String path_v;

boolean successfulLogin = false;
String responseString = null;
Integer loggedInPersonID = null;

if (((Application )WOApplication .application()).audioProjectDBServerType().equals("DEV")){
...
}else if (((Application )WOApplication .application()).audioProjectDBServerType().equals("LIVE")){
...
}else{
...
}

if (ip == null)
ip = "";

String URL= protocol + host + path_v + cookie
+ "&appId=" + appId + "&appAdminPassword=" + appAdminPassword + "&ip=" + ip
+ func;
NSLog.out.appendln("URL: " + URL);

NSLog.out.appendln("Creating WOHTTPConnection Object:\nnew WOHTTPConnection(" + host + ", " + new Integer(port).intValue() + ")");
WOHTTPConnection connection = new WOHTTPConnection(host, new Integer(port).intValue());
WORequest outgoingRequest;
try {
outgoingRequest = new WORequest("GET", URL, "HTTP/1.1", null, null, null);
} catch (Exception e) {
NSLog.out.appendln(e.getMessage());
NSLog.out.appendln(e.getCause());
NSLog.out.appendln(e.getStackTrace().toString());
return null;
}

connection.setReceiveTimeout(5000);

NSLog.out.appendln("sending request to connection object: \nsendRequest(" + outgoingRequest.toString() + ")");
boolean connectionSucceeded = connection.sendRequest(outgoingRequest);
NSLog.out.appendln("Reading response for previous request sent\n");
WOResponse response = connection.readResponse();

if (response != null) {
...
}
else
System.out.println ("Can not access site");

if (successfulLogin) {
if (((Session)session()).setCurrentEmployee(loggedInPersonID)){
...
} else {
NSLog.out.appendln("Reason: " + responseString);
return login();
}
} else {
NSLog.out.appendln("Reason:\n" + responseString);
return login();
}
}


Notice in the try statement is the new WORequest() method. This is where my InvocationTargetException is being generated. I know this because I get a Log message of "Creating WOHTTPConnection Object: \nnew WOHTTPConnection(" + host + ", " + new Integer(port).intValue() + ")", which is the last message out to the Log before the creation of the new WORequest, but nothing else. I also know the WOHTTPConnection generation is working because I've tried the log message before and after the new WOHTTPConnection statement. My biggest problem is, it works fine on my development machine. It's when I try and deploy on a development server that things go wrong. Anyone have any insight they can shed on this?

Environment Specs:
	Development machine:
		MacPro booted via firewire to a MacBookPro
		OS X 10.5.3 (9D34)
		Eclipse SDK (3.3.2 build id: M20080221-1800)
		WOLips plugin (3.3.5047)
		Java (1.5.0_13 build 1.5.0_13-119)
		WebObjects (5.4)

	Development Deployment Server:
		1.8Ghz PowerPC G5
		OS X 10.4.11 (8S169)
		Java (1.5.0_13 build 1.5.0_13-121)
		WebObjects (5.3.3)

Thanks in advance,

Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: InvocationTargetException on new WORequest
      • From: Mike Schrag <email@hidden>
    • Re: InvocationTargetException on new WORequest
      • From: Chuck Hill <email@hidden>
References: 
 >InvocationTargetException on new WORequest (From: "Eric E. van Leeuwen" <email@hidden>)
 >Re: InvocationTargetException on new WORequest (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: InvocationTargetException on new WORequest
  • Next by Date: Re: InvocationTargetException on new WORequest
  • Previous by thread: Re: InvocationTargetException on new WORequest
  • Next by thread: Re: InvocationTargetException on new WORequest
  • Index(es):
    • Date
    • Thread