First, where is your agent running from? Notes ? then that's a great location or On the Server? If on the server, you should make sure the libraries are there too.
One great test is to put the libraries in the Agent's code.
Open your Database in Designer
Expand the Database > Code > Agents
Open your Agent
Click on Archive
Click Import > Archive
Click Browse (Find the folder with the referenced jars)
Select the Jars you want
Click Finish
Click Save (let it compile)
Close and test
If that works, it's down to path issues
---- Updated ----
I added com.ibm.sbt.core / com.ibm.commons.xml com.ibm.commons.runtime com.ibm.commons httpcore httpclient commons-logging jars to the agent as an archive
I used your code, and changed the workspace compatibility to Java1.5
I then changed the Security to Level 3. ... you should try the same, and if it fails, you should look into conflicting java classes.
import lotus.domino.AgentBase;
import lotus.domino.AgentContext;
import lotus.domino.Session;
import org.apache.http.client.HttpClient;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.BasicResponseHandler;
import org.apache.http.impl.client.DefaultHttpClient;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
lotus.domino.Log log = session.createLog("SampleAgentSBT");
log.openAgentLog();
HttpClient httpclient = new DefaultHttpClient();
try {
HttpGet httpget = new HttpGet("http://www.google.com/");
log.logAction("executing request " + httpget.getURI());
// Create a response handler
ResponseHandler<String> responseHandler = new BasicResponseHandler();
String responseBody = httpclient.execute(httpget,
responseHandler);
log.logAction("----------------------------------------");
log.logAction(responseBody);
log.logAction("----------------------------------------");
} finally {
// When HttpClient instance is no longer needed,
// shut down the connection manager to ensure
// immediate deallocation of all system resources
httpclient.getConnectionManager().shutdown();
}
log.close();
} catch (Exception e) {
e.printStackTrace();
} finally {
}
}
}