William Farrugia

Greenhorn
+ Follow
since Apr 30, 2011
Merit badge: grant badges
For More
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 William Farrugia

Thanks for your reply Paul.

You are right, but how do you explain the applic works on the development machine? Besides I double checked and the characters are A-Za-z0-9... so there shouldn't be any problems. The database is set to UTF in my.cnf....

not sure if this is my case http://bugs.mysql.com/bug.php?id=29636
12 years ago
Hello,

I'm running Tomcat 5 and using OpenJDK Runtime Environment (IcedTea6 1.7.10) (rhel-1.21.b17.el5-x86_64) OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode) on CentOS and recently came across one weird problem that I suspect is a JDK bug.

When I read from a mysql database, a field called randomid that is made up of a series of random characters (lower case letters, uppercase letters and numbers) such as SRM1iq1 or FRG6rx2 or XGC6gs7

I get

SEVERE: Servlet.service() for servlet jsp threw exception
java.io.CharConversionException
at gnu.gcj.convert.Input_iconv.read(libgcj.so.7rh)
at java.lang.String.init(libgcj.so.7rh)
at java.lang.String.<init>(libgcj.so.7rh)
at com.mysql.jdbc.SingleByteCharsetConverter.<init>(SingleByteCharsetConverter.java:153)
at com.mysql.jdbc.SingleByteCharsetConverter.initCharset(SingleByteCharsetConverter.java:108)
at com.mysql.jdbc.SingleByteCharsetConverter.getInstance(SingleByteCharsetConverter.java:86)
at com.mysql.jdbc.ConnectionImpl.getCharsetConverter(ConnectionImpl.java:2767)
at com.mysql.jdbc.ResultSetRow.getString(ResultSetRow.java:754)
at com.mysql.jdbc.ByteArrayRow.getString(ByteArrayRow.java:67)
at com.mysql.jdbc.ResultSetImpl.getStringInternal(ResultSetImpl.java:5557)
at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5434)
at org.apache.jsp.main_jsp._jspService(main_jsp.java:1160)
at org.apache.jasper.runtime.HttpJspBase.service(jasper5-runtime-5.5.23.jar.so)
at javax.servlet.http.HttpServlet.service(tomcat5-servlet-2.4-api-5.5.23.jar.so)
at org.apache.jasper.servlet.JspServletWrapper.service(jasper5-compiler-5.5.23.jar.so)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(jasper5-compiler-5.5.23.jar.so)
at org.apache.jasper.servlet.JspServlet.service(jasper5-compiler-5.5.23.jar.so)
at javax.servlet.http.HttpServlet.service(tomcat5-servlet-2.4-api-5.5.23.jar.so)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(catalina-5.5.23.jar.so)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(catalina-5.5.23.jar.so)
at org.apache.catalina.core.StandardWrapperValve.invoke(catalina-5.5.23.jar.so)
at org.apache.catalina.core.StandardContextValve.invoke(catalina-5.5.23.jar.so)
at org.apache.catalina.core.StandardHostValve.invoke(catalina-5.5.23.jar.so)
at org.apache.catalina.valves.ErrorReportValve.invoke(catalina-5.5.23.jar.so)
at org.apache.catalina.core.StandardEngineValve.invoke(catalina-5.5.23.jar.so)
at org.apache.catalina.connector.CoyoteAdapter.service(catalina-5.5.23.jar.so)
at org.apache.coyote.http11.Http11Processor.process(tomcat-http-5.5.23.jar.so)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(tomcat-http-5.5.23.jar.so)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(tomcat-util-5.5.23.jar.so)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(tomcat-util-5.5.23.jar.so)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(tomcat-util-5.5.23.jar.so)
at java.lang.Thread.run(libgcj.so.7rh)

Works perfectly on the development machine that is running Tomcat5 and a different version of JDK 6. The easy way out would be changing the JDK, but being a live running server, I'd rather think of something else.

Any ideas of how to maybe go around this problem (besides changing the random id?)

Thanks a bunch

Will
12 years ago

Ulf Dittmer wrote:It wasn't supposed to; that was just an additional problem I noticed with the code that needed to be addressed.



Sorry I misunderstood then

I had some 8080 to port 80 redirections that were mistakenly added to the output chain on IP tables. I commented out



and it works.

Thanks and regards

William
12 years ago
Hello!

Thanks for your replied. I tried adding UTF-8 but didn't solve the problem. It still works on my platform but it doesn't on the server. However you did put me in the right direction. Convinced the policies were OK, I tried switching off IPTables on the server, and guess what... it worked!

So now I will try and fix the iptables instead.

Thanks a lot for your help

William
12 years ago
Hi,

I'm having some problems when trying to grab RSS feed from a website and display it from a servlet. My servlet runs perfectly on my development machine at home, but fails with this error on the server (CentOS)



My code is as follows:


The website I'm trying to access is http://www.timesofmalta.com/rss

At home I'm running Tomcat 6.0 and on the server Tomcat 5.

At first I suspected the problem might be policy related. (Happened to me on a different server in the past) so I tried to grant access



But that just didn't work.

Any help appreciated

William
12 years ago
It's a payment gateway. They require that I post hashed XML to a web service, and the response is a secure form (with text fields for the credit card, cvv etc) that I should be able to place in an iFrame. When I output the response body as a String (from the PostMethod) I get the form properly but it doesn't submit cause the action is set to a web service that obviously doesn't exist on my server.

Should I maybe use the regular HTML form instead and just generate the XML from a JSP?

Re your question yes, I would like the response to popup in an iFrame. Sorry for the mess but I think I should probably change payment gateway provider :/
12 years ago
Hello and thanks for your reply.

Well posting from a form by



and doing it via PostMethod


yields a different result. By PostMethod the response is sort of captured and I can output it with out.print, but instead I would like to open the response page on the source server rather than printing it out from my servlet. I know it's kinda strange sorry.






12 years ago
Hi,

Is there a way to avoid capturing a post reply response body?



The only output i get is if i do


But it need the output to be on https://www.somehost.com/Pay and not as output of my own servlet.

Any help appreciated.

William.
12 years ago