Question : JSP suspends to run

Hi,
This question follows my post
http://www.experts-exchange.com/Software/Server_Software/Application_Servers/Java/Apache_Tomcat/Q_24014613.html#a23264529

This code is open source. It works without any problem with I ran it alone. I just did minor modification. Previously the "

was on the earlier page. Now I moved it to the current page.

I found that the code stopped at "caller.setAPIProfile(profile);". I can not find where is wrong.

Any clues to fix this problem?

Thanks a lot.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
<%@ page import="paypal.sdk.profiles.APIProfile" %>
<%@ page import="paypal.sdk.profiles.ProfileFactory" %>
<%@ page import="org.apache.commons.fileupload.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page language="java" %>
 
<%@ include file='constants.jsp' %>
 

 
<%	
	try {
		
				
		APIProfile profile = null;
									
			profile = ProfileFactory.createSignatureAPIProfile();
 
			profile.setAPIUsername(DEFAULT_USER_NAME);
			profile.setAPIPassword(DEFAULT_PASSWORD);
			
			profile.setSignature(DEFAULT_SIGNATURE);
			profile.setEnvironment(testEnv);
			session.setAttribute("environment", testEnv);
			
		
						
		System.out.println("arrive here 33333333");
		caller.setAPIProfile(profile);
 
                                System.out.println("arrive here 4444444");
    		session.setAttribute("caller", caller);
                                ...........

Answer : JSP suspends to run

Where is testEnv being created?  

Do you need to add testEnv to the session? If you want it on the session then, check the session for it and create it if its not there then add it if you had to create it.

Line 33 doesn't need to be called, it is already on the session.

That said on to your problem.  Can you debug this with an IDE?  If so is call NULL before you use it?  If you need to do the following just before the callet.setAPIProfile(...)

if(caller == null){
    System.out.println("caller is null");
}else{
   System.out.println("caller is  NOT null");
}
Random Solutions  
 
programming4us programming4us