Archive pour la catégorie 'Java'

Requête WebService en HTTPS avec JMeter

Friday 1 December 2006

Pré-requis :
Suppose avoir à disposition le keystore XXX.p12
Ainsi que le certificat d’autorité correspondant à ce keystore XXX.crt

Configuration

Installer le crt dans le keystore de votre jvm
%JAVA_HOME%\bin\keytool –import –keystore %JAVA_HOME%\jre\lib\security\cacerts

Modifier jmeter.properties afin de le faire pointer sur le bon trustore

#—————————————————————————
# SSL configuration
#—————————————————————————

#Classname of the ssl provider to be used (to enable testing of https urls)
#And the package name where Stream Handlers can be found
#These provided defaults can be uncommented, and they will work if you are using
#Sun’s JSSE implementation.

#ssl.provider=com.sun.net.ssl.internal.ssl.Provider
#ssl.pkgs=com.sun.net.ssl.internal.www.protocol

#The location of the truststore (trusted certificates) and keystore ( if other than the default.
#you can uncomment this and change the path to the correct location.
#javax.net.ssl.trustStore=/path/to/cacerts
#javax.net.ssl.keyStore=/usr/java/jdk1.5.0_02/jre/lib/security/cacerts
<strong>javax.net.ssl.trustStore=E:/Java/jdk1.5.0_09/jre/lib/security/cacerts</strong>  #The password to your keystore #javax.net.ssl.keyStorePassword=changeit  #Flag for whether to output debug messages to System.err #To enable it, set the value to "all"  Note, for it to work with #JSSE, it needs to be done from the Java command (i.e. -Djavax.net.debug=all) #javax.net.debug=all

Lancer Jmeter.bat

Dans le menu Options>Gestionnaire SSL importer le fichier XXX.PKCS12, rentrer votre mot de passe.

Pour pouvoir faire des requêtes WebServices installer Javamail, c’est à dire placer mail.jar et activation.jar dans le répertoire lib/ de JMeter

Vous pouvez enfin commencer à créer vos requêtes WebService ou SOAP/XML-RPC

Nota : en SOAP/XML-RPC avec weblogic, il se peut que vous obteniez cette stacktrace qui signale problème de parsing de fichier xml dans ce cas faire le teste en mode WebServices

<strong>Failure while unmarshalling message: error: Illegal XML character: 0×0</strong>
com.bea.xbean.piccolo.io.IllegalCharException: Illegal XML character: 0×0
at com.bea.xbean.piccolo.xml.XMLReaderReader.read(XMLReaderReader.java:169)
at com.bea.xbean.piccolo.xml.PiccoloLexer.yy_refill(PiccoloLexer.java:3474)
at com.bea.xbean.piccolo.xml.PiccoloLexer.yylex(PiccoloLexer.java:3958)
at com.bea.xbean.piccolo.xml.Piccolo.yylex(Piccolo.java:1290)
at com.bea.xbean.piccolo.xml.Piccolo.yyparse(Piccolo.java:1400)
at com.bea.xbean.piccolo.xml.Piccolo.parse(Piccolo.java:714)
at com.bea.xbean.store.Locale$SaxLoader.load(Locale.java:3435)
at com.bea.xbean.store.Locale.parseToXmlObject(Locale.java:1323)
at com.bea.xbean.store.Locale.parseToXmlObject(Locale.java:1310)
at com.bea.xbean.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:360)
at com.bea.xml.XmlObject$Factory.parse(XmlObject.java:733)
at com.bea.wli.sb.context.SOAPMessageImpl.parseCheckEnvelope(SOAPMessageImpl.java:806)
at com.bea.wli.sb.context.SOAPMessageImpl.unpack(SOAPMessageImpl.java:561)
at com.bea.wli.sb.context.SOAPMessageImpl.getBody(SOAPMessageImpl.java:185)
at com.bea.wli.sb.context.BodyVariable.getTypedValue(BodyVariable.java:33)
at com.bea.wli.sb.context.BodyVariable.getTypedValue(BodyVariable.java:19)
at com.bea.wli.sb.context.SystemVariable.getValue(SystemVariable.java:46)
at com.bea.wli.sb.context.MessageContextImpl.getProperty(MessageContextImpl.java:198)
at com.bea.wli.sb.stages.expressions.xquery.XQueryExprExecutor.getVariables(XQueryExprExecutor.java:128)
at com.bea.wli.sb.stages.expressions.xquery.XQueryExprExecutor.execute(XQueryExprExecutor.java:75)
at com.bea.wli.sb.stages.expressions.xquery.XQueryExprExecutor.executeJavaObject(XQueryExprExecutor.java:90)
at stages.logging.runtime.ReportRuntimeStep.processMessage(ReportRuntimeStep.java:92)
at com.bea.wli.sb.stages.StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:310)
at com.bea.wli.sb.pipeline.PipelineStage.processMessage(PipelineStage.java:100)
at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:601)
at com.bea.wli.sb.pipeline.Pipeline.processMessage(Pipeline.java:73)
at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:601)
at com.bea.wli.sb.pipeline.PipelineNode.doRequest(PipelineNode.java:47)
at com.bea.wli.sb.pipeline.Node.processMessage(Node.java:57)
at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:601)
at com.bea.wli.sb.pipeline.Router.processMessage(Router.java:141)
at com.bea.wli.sb.pipeline.MessageProcessor.processRequest(MessageProcessor.java:129)
at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:661)
at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:660)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at com.bea.wli.sb.pipeline.RouterManager.processMessage(RouterManager.java:658)
at com.bea.wli.sb.pipeline.RouterManager.processMessage(RouterManager.java:634)
at com.bea.wli.sb.transports.TransportManagerImpl.receiveMessage(TransportManagerImpl.java:256)
at com.bea.wli.sb.transports.TransportManagerImpl.receiveMessage(TransportManagerImpl.java:213)
at com.bea.wli.sb.transports.http.HttpTransportServlet.service(HttpTransportServlet.java:161)
at weblogic.servlet.FutureResponseServlet.service(FutureResponseServlet.java:24)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1311)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)

Cryptage SSL

Monday 6 November 2006

Voici un article très intéressant et très compréhensible sur le SSL, ici

JVM Options

Friday 11 August 2006

Options utiles JVM pour weblogic :

-hotspot
-Xms512m
-Xmx512m
-Dweblogic.ProductionModeEnabled=
-Dweblogic.webservice.verbose=true

Properties

Sunday 2 July 2006

Voici un petit bout de code qui permet de simuler un ActionMessage à la struts avec passage d’arguments en paramètres lors de la récupération de valeurs dans un fichier properties.

Le principe est de charger le properties avec un ResourceBundle et de remplacer les ‘{0}’ ‘{1}’ , etc…

L’astuce était de trouver le code unicode des crochets ‘{’, ‘}’

Ainsi {0} correspond à \\u007B0\\u007D en unicode

Voici le code en question :
(more…)


WordPress database error: [Table 'foubert.wp_ss_stats' doesn't exist]
INSERT INTO wp_ss_stats (remote_ip,country,language,domain,referer,resource,user_agent,platform,browser,version,dt) VALUES ('54.166.203.76','Indeterminable','empty','','','/wordpress/?cat=4','CCBot/2.0 (http://commoncrawl.org/faq/)','Indeterminable','Crawler/Search Engine','Indeterminable',1508744547)