on 05-16-2006 2:38 PM
Hi,
i have a problem to establish one HTTPs connection.
The project return this exception on the instruction <b>httpConn.connect();</b>:
java.lang.NullPointerException
at org.w3c.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at com.connection.HttpsConnection.main(HttpsConnection.java:92)
This is my code:
KeyStore keystoreCAs;
KeyStore keystoreMyKeys;
try {
IAIK.addAsJDK14Provider(true);
File fileKSCA = new File(fileNameKsCA);
File fileKSKey = new File(fileNameKsKey);
char[] ksPwdCA = pwdCa.toCharArray();
keystoreCAs = KeyStore.getInstance("IAIKKeyStore");
keystoreCAs.load(new FileInputStream(fileKSCA), ksPwdCA);
// Create factory
SecureConnectionFactory factory = new SecureConnectionFactory(keytoreCAs);
// Create the HTTPS connection
HttpURLConnection httpConn = factory.createURLConnection(url);
httpConn.setRequestMethod("POST");
httpConn.setDoInput(true);
httpConn.setDoOutput(true);
httpConn.connect();
readResult(httpConn);
} catch (KeyStoreException e) {
System.out.println(e.getLocalizedMessage());
} catch (NoSuchAlgorithmException e) {
System.out.println(e.getLocalizedMessage());
} catch (CertificateException e) {
System.out.println(e.getLocalizedMessage());
} catch (FileNotFoundException e) {
System.out.println(e.getLocalizedMessage());
} catch (IOException e) {
System.out.println(e.getLocalizedMessage());
}
Someone can help me?
Thanks,
Fabio
Grazie mille ragazzi, davvero molto gentili
non come quelli di infocamenre che cto cercando di contattare da settimane ma non mi rispondono mai!!
La mail è Formix@tin.it nuova documentazione è sempre ben accetta!!
grazie ancora a tutti!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ciao, ho anche io un problemino con il timestamping dell'infocamere, in particolar modo non capisco che cosa devo passare di preciso come parametro fHASH nella POST per ricevere il timestamping.
gli passo già tutti gli altri parametri e me li accetta, ma quello proprio non lo digerisce!!
c'è un particolare tipo di hashing che bisogna fare o di un numero particolare di bit, oppure vanno bene tutti??
io gli passo una stringa contenente il testo dell'hashing el mio file.p7m in 3Des a 128bit, ma nulla!!
inoltre una volta passato quel valore, cosa mi ritorna di preciso il loro server?? e come lo prendo quel parametro??
grazie mille
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ciao Egisto,
nel parametro FHASH devi passare l'HASH del file P7M.
questo è il codice per generare l'HASH da un oggetto di tipo
byte[]
Se hai qualche problema apri un altro POST perché il problema che hai non riguarda la classe SecureConnectionFactory.
Ciao
Fabio
Message was edited by: Massimo Compagnoni
Hi Massimo,
It seems the factory is not able to give valid connection or something like that.
Post the complete exception stack trace. If you could post the complete code then i will get a full picture of the error.
Best regards,
Guru.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guru,
this is the stack trace:
[code]#
#1.5#000F203C722C00450000000300004999000413FA10B25905#1147864650985#com.sap.engine.services.ejb#sap.com/TSRMarcaTemporaleEAP#com.sap.engine.services.ejb#J2EE_GUEST#2####bb39e680e59611dabbe6000f203c722c#SAPEngine_Application_Thread[impl:3]_12##0#0#Error##Java###
[EXCEPTION]
#1#com.sap.engine.services.ejb.exceptions.BaseRemoteException: Exception in method getTSR.
at it.sap.infotn.techedge.TSRMarcaTemporaleObjectImpl0.getTSR(TSRMarcaTemporaleObjectImpl0.java:135)
at it.sap.infotn.techedge.TSRMarcaTemporale_Stub.getTSR(TSRMarcaTemporale_Stub.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187)
at $Proxy99.getTSR(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:146)
at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:68)
at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
at SoapServlet.doPost(SoapServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:385)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:340)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:318)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:821)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:239)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
Caused by: java.lang.NullPointerException
at org.w3c.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at it.sap.infotn.techedge.TSRMarcaTemporaleBean.connectToService(TSRMarcaTemporaleBean.java:265)
at it.sap.infotn.techedge.TSRMarcaTemporaleBean.getTSR(TSRMarcaTemporaleBean.java:99)
at it.sap.infotn.techedge.TSRMarcaTemporaleObjectImpl0.getTSR(TSRMarcaTemporaleObjectImpl0.java:119)
... 32 more[/code]
The connection is valid because i call a Servlet for the Digital Signature (https://www.carm.infocamere.it/carm.dts/ServletDTS?fUSER=xxx&fPSW=xxx&fTIPO=HASH-MARCA&fHASH=xxx) with 4 parameters: User(fUser), Password(fPSW), Type Service(fTIPO) and the hash of file signed .P7M (fHASH).
User and password aren't mine so i can't give them to you, but I am sure that the link is working.
Thanks,
Massimo
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.