Exception i applet.
Jeg har skrevet en metode, som sender en soap-besked over til localhost, men hvis jeg kører den i en applet, så kommer der en ExceptionInInitializererror. Metoden vrker fint i en application. Nogen der ved hvad der kan være galt?Koden er her:
import javax.xml.soap.*;
import java.net.*;
import javax.mail.internet.*;
public class KlientParser
{
public void send_dokument() throws Exception
{
String uri = "http://localhost:8081" ;
URL endpoint = new URL(uri);
SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
SOAPConnection connection = scf.createConnection();
MessageFactory mf = MessageFactory.newInstance();
// Create a message from the message factory.
SOAPMessage msg = mf.createMessage();
SOAPPart soapPart=msg.getSOAPPart();
SOAPEnvelope envelope = soapPart.getEnvelope();
SOAPBody body = envelope.getBody();
body.addChildElement(envelope.createName("GetReply" , "jaxm",
"http://sun.com/jaxm/someuri/"))
.addChildElement("name").addTextNode("sampletest");
msg.saveChanges();
System.err.println("Sending message to URL: "+ endpoint);
SOAPMessage reply = connection.call(msg, endpoint);
connection.close();
}
}