Between 8:00 - 9:00 am ET on 10/25 we need to take our site down to make updates. We recommend logging out before 8:00am ET and not using your account during this time. Thank you for your patience while we make these important updates.

Java sample app : Working sample or not?

Participant

Java sample app : Working sample or not?

Does the sample code work or not?
I tried to launch the sample app locally, and ended up getting "HTTP Status 500" error message

The launch shows up the index.jsp. :http://localhost:8085/JavaSample/
On entering valid api-key,login and password - I get AbderaClient class not found error !

Tomcat Log attached:
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.(MultiThreadedHttpConnectionManager.java:70)
org.apache.abdera.protocol.client.AbderaClient.(AbderaClient.java:106)
org.apache.abdera.protocol.client.AbderaClient.(AbderaClient.java:125)
com.constantcontact.webservices.sample.ListServlet.doPost(ListServlet.java:66)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
5 REPLIES 5
Occasional Participant

 


I got past this problem by downloading the apache commons logging jars into the tomcat bin directory.



C:\apache-tomcat-6.0.20\lib\commons-logging-1.1.1.jar

C:\apache-tomcat-6.0.20\lib\commons-logging-api-1.1.1.jar



I hit some other issues after that but I'll save those for another reply.



diane

Occasional Participant

Is the URI in the Constants.java file correct: "http://api.f1.constantcontact.com" ?  I always get a ConnectException for a connection timed out.


It does return something if I change the URI to: "https://api.constantcontact.com".


 


By the way in the finally blocks in ListServlet.java and ListViewServlert.java you need to check if resp is null before calling release(). Otherwise the null pointer exception hides the real problem.


 


Thanks,


diane

Moderator

That URI is not correct.  I will look at the Java example and see why that URI is still in there and have this example updated soon.  Your second URI< https://api.constantcontact.com, is the correct URI.


 


Thanks for reporting this!

Dave Berard
Senior Product Manager, Constant Contact
Occasional Participant

 


Dave,


 


Thanks. I would also suggest you fix the other two minor glitches. Add a note to the README.txt that says the commons logging jars (or jar) are required to be in the tomcat\lib directory. Adding the check for the null resp reference in the finally blocks before calling release() is an easy,  low risk change as well.


 


It's very frustrating when samples don't work as expected. It took me longer to get this going than it should.


 


Thanks again,


 


diane ramsey

Moderator

Hi Diane,




Thanks for the feedback.  I've brought it back to the developer of the Java application and we will hopefully have this updated shortly.  We do apologize for the frustration, we agree that the sample code we provide should be simple and work correctly without heavy modification.


 


 

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

View API documentation, code samples, get your API key.

Visit Page