OK,
For some time I have been running servoy behind IIS6. Why? Because the server only has a single IP and IIS needs to run on port 80/443 for some other applications - so I use ISAPI_redirect.dll to collect ‘servoy’ requests on port 80/443 and forward them on to servoy on 8080/8443. It also means I dont have to open/use anything escept standard ports 80/443. Most corporate environments I work with wont allow any other ports to be used.
Works just fine. (I can share the config if anyone is interested.
I am now setting up a new environment using IIS7 on Windows 2008 R2 x64. I did manage to get ISAP_redirect.dll to work (eventually) but it is grindingly slow. Various posts elsewhere indicate that this is no longer the best way to go for IIS7. So I have installed and setup ARR & URLRewrite to do the same thing - which is supposed to have better performance on IS7.
so whilst the rewrite is quite happily sending the initial request to the correct port (8080 on localhost on server) after that it fails…now I know this is not specifically a servoy thing; its more the interaction of servoy with IIS7 + ARR + URLrewrite…but has anyone else tried this and got it working??
I really need to be able to support servoy running on 80/443 - and ISAPI_redirect.dll now seems to be the ‘old’ way of doing it.
Ok
If anyone cares - I have got a little further.
a) Under IIS7 install ARR.
b) Setup a server farm
c) Add a server to the farm -
name: localhost
advanced settiings ports 8080/8443
d) You will be prompted to create server rewrite rules - accept and ARR should make the correct rules for you.
So now ARR redirects anything in on port 80 to 8080 on localhost - which is great as that means the SC starts up…BUT…then it fails with the ‘cant find dataservice’ error.
If I turn on java console for the client I see:
25/04/2010 5:22:46 PM com.sebster.tunnel.impl.rb b
INFO: jcifs library found; NTLM support enabled
Reading certificates from 125290 http://dev.cesoft.com.au:80/plugins/pdf … 14-135.jar | C:\Documents and Settings\alb\application data\Sun\Java\Deployment\cache\6.0\46\5556a1ee-21307273-1.35.0-.idx
25/04/2010 5:22:46 PM com.sebster.tunnel.impl.rb b
INFO: bouncy castle library found; SPNEGO support enabled
25/04/2010 5:22:46 PM com.sebster.tunnel.impl.rb b
INFO: using direct connection
com.sebster.tunnel.http.client.HttpException: 500 Internal Server Error
at com.sebster.tunnel.impl.rb.a(rb.java:15)
at com.sebster.tunnel.http.client.HttpTunnelClient.connect(HttpTunnelClient.java:5)
at com.sebster.tunnel.http.client.AuthenticatingHttpTunnelClient.connect(AuthenticatingHttpTunnelClient.java:9)
at com.sebster.tunnel.impl.s.connect(s.java:6)
at com.sebster.tunnel.DelegatingTunnelClient.connect(DelegatingTunnelClient.java:1)
at com.sebster.tunnel.impl.ac.(ac.java:5)
at com.sebster.tunnel.multiplexer.rmi.ClientMultiplexedRmiSocketFactoryProvider$1.(ClientMultiplexedRmiSocketFactoryProvider.java:1)
at com.sebster.tunnel.multiplexer.rmi.ClientMultiplexedRmiSocketFactoryProvider.(ClientMultiplexedRmiSocketFactoryProvider.java:1)
at com.sebster.tunnel.multiplexer.rmi.ClientMultiplexedRmiSocketFactoryProvider.(ClientMultiplexedRmiSocketFactoryProvider.java:15)
at com.servoy.j2db.server.rmi.tunnel.ClientTunnelRMISocketFactoryFactory$RmiSocketFactoryProvider.(ClientTunnelRMISocketFactoryFactory.java:273)
at com.servoy.j2db.server.rmi.tunnel.ClientTunnelRMISocketFactoryFactory$RmiSocketFactoryProvider.(ClientTunnelRMISocketFactoryFactory.java:271)
at com.servoy.j2db.server.rmi.tunnel.ClientTunnelRMISocketFactoryFactory.createFactoryProvider(ClientTunnelRMISocketFactoryFactory.java:220)
at com.servoy.j2db.server.rmi.tunnel.ClientTunnelRMISocketFactoryFactory.(ClientTunnelRMISocketFactoryFactory.java:209)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.servoy.j2db.J2DBClient.Zf(J2DBClient.java:17)
at com.servoy.j2db.J2DBClient.startupApplication(J2DBClient.java:113)
at com.servoy.j2db.Zyd.run(Zyd.java:4)
at com.servoy.j2db.J2DBClient.mainImpl(J2DBClient.java:458)
at com.servoy.j2db.J2DBClient.main(J2DBClient.java:1176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
So there is an internal server error (500) when the SC tries to contact the data service.
Interestingly IIS7 also records that there is an ‘Internal server error -500’ from the upstream server (eg Tomcat) at this point.
Any ideas…perhaps I am the only one dumb enough to eb trying to get this to work.
still going…now it seems that the servoy (tomcat) server is sending back a 500 (internal server error) in response to the request it is getting forwarded through form IIS7 (ARR). problem is I can work out why. If I check the localhost log for the tomcat server I see;
202.148.159.84 - - [25/Apr/2010:19:05:17 +1000] “GET /servoy-client/servoy-client.jnlp HTTP/1.1” 200 5741
202.148.159.84 - - [25/Apr/2010:19:05:19 +1000] “GET /servoy-client/servoy-client.jnlp HTTP/1.1” 200 5741
202.148.159.84 - - [25/Apr/2010:19:05:19 +1000] “GET /servoy-client/servoy-client.jnlp HTTP/1.1” 200 5741
202.148.159.84 - - [25/Apr/2010:19:05:19 +1000] “GET /servoy-client/servoy-client.jnlp HTTP/1.1” 200 5741
202.148.159.84 - - [25/Apr/2010:19:05:21 +1000] “GET /lib/splashclient.gif HTTP/1.1” 304 -
202.148.159.84 - - [25/Apr/2010:19:05:23 +1000] “GET /servoy.properties HTTP/1.1” 200 4894
202.148.159.84 - - [25/Apr/2010:19:05:23 +1000] “POST /tunnel HTTP/1.1” 500 1000
202.148.159.84 - - [25/Apr/2010:19:05:23 +1000] “GET /servoy_messages?lastmodified=-1&language=en_AU HTTP/1.1” 200 34
202.148.159.84 - - [25/Apr/2010:19:05:24 +1000] “POST /tunnel HTTP/1.1” 500 1000
before it fails.
How can I tell what is INSIDE the /tunnel requests? Is there any way to log that somewhere - otherwise its pretty hard to work out why tomcat is choking…
I don’t know about your error, but when I look into /servoy/application_server/server/webapps/ROOT/WEB-INF/web.xml file, I can see that the /tunnel path is mapped (or should be, maybe there is something wrong here in your case) to the http-tunnel-servlet (com.sebster.tunnel.http.server.servlet.HttpTunnelServlet) with an init-param of “com.servoy.j2db.server.rmi.tunnel.ServerTunnelRMISocketFactoryFactory” which is the value you have to put in the servoy-admin network parameters for the “SocketFactory.rmiServerFactory”.
Does you web.xml contain this mapping and did you put the relevant reference in SocketFactory.rmiServerFactory?
Maybe you could also set the tracing to on in the servoy-admin ‘Server Log’ page, you might get more output there.
With Apache I know that you need to create a connector to use AJP protocol and use mod_jk in Apache to enable direct communication between Apache and Tomcat.
Might be the case with IIS and isapi_redirect?
I would experiment with different settings, adding a new node with a port different than the one used for HTTP/1.1
thanks for the replies.
Yep I do have those tunnel settings - both in the web.xml and th servoy.properties file.
I should also clarify that the http tunnel works prefectly if I access tomcat directly on 8080.
it’s only when I try to use the ARR+Urlwrite in IIS to intercept 80-> 8080 that I get problems.
So I know the issue is the IIS rewrite…but the web client works perfectly …so ordinary html rewrite from 80->8080 is ok.
Its just the smart client that bombs.
I also can see that the reason it bombs is because tomcat responds with a 500 - Internal server Error.
The issue is where/how can I get more detail as to why tomcat is thorwing that error?
Doesnt seem to be anything more in the logs/
Al.
BTW here’s the java console when it fails on the client:
Reading certificates from 6496 http://dev.cesoft.com.au:80/plugins/serialize.jar | C:\Documents and Settings\alb\application data\Sun\Java\Deployment\cache\6.0\18\a702bd2-368858f5-1270639428624-.idx
Installing tunnel in http mode to http://dev.cesoft.com.au:80/
26/04/2010 7:33:27 PM com.sebster.tunnel.impl.rb b
INFO: jcifs library found; NTLM support enabled
26/04/2010 7:33:27 PM com.sebster.tunnel.impl.rb b
INFO: bouncy castle library found; SPNEGO support enabled
26/04/2010 7:33:27 PM com.sebster.tunnel.impl.rb b
INFO: using direct connection
com.sebster.tunnel.http.client.HttpException: 500 Internal Server Error
at com.sebster.tunnel.impl.rb.a(rb.java:15)
at com.sebster.tunnel.http.client.HttpTunnelClient.connect(HttpTunnelClient.java:5)
at com.sebster.tunnel.http.client.AuthenticatingHttpTunnelClient.connect(AuthenticatingHttpTunnelClient.java:9)
…
When using a redirect, you need to specifically add a line in the servoy.properties which says where clients can find the jnlp file, because normally Servoy just looks at where it’s hosted and returns that URL. So If you’re redirecting, Servoy doesn’t know this and thinks it’s on port 8080, when in fact you’re accessing it via a redirect. The property to use (you can set in the admin pages) is servoy.jnlpCodebaseOverride. Just set it to the base url of your Servoy the way clients have to access it, i.e. https://my.server.com or http://my.server.com or https://my.server.com:8080 depending on your situation. This URL must point to the host that’s doing the forwarding for you, not the real host where Servoy is.
When using the tunnel with ISS make sure you set the “chunked” property for the tunnel to on. Specifically, try adding the following two options to your servoy.properties:
One more thing, to test that the tunnel servlet is available via the ISS server, test the http(s)://my.server.com/tunnel url. It should show a message (and not give a 500) indicating it’s up and running.
Finally, when you see 500 errors, check the Servoy log, the errors should be logged in there with stack traces, which will give me more info if they persist.
Ok thanks for the suggestions.
I checked browsing to http://server.com/tunnel and it works just fine (no 500 error).
I set the root server name (http://server.com) in servoy.properties and the two chunking parameters - but unfortunately that didnt fix it.
The Sc downloads then tries to run. It fails with ‘caanot find dataservice’. In the Java console I see:
01/05/2010 4:33:08 PM com.sebster.tunnel.impl.rb b
INFO: using direct connection
com.sebster.tunnel.http.client.HttpException: 500 Internal Server Error
at com.sebster.tunnel.impl.rb.a(rb.java:15)
So still getting that 500 Internal Server Error back from tomcat
…and all I see in the servoy server log when the client fails is:
2010-05-01 16:44 http-8080-1 INFO com.servoy.j2db.util.Debug Loading messages from server: null table: null
2010-05-01 16:44 http-8080-1 INFO com.servoy.j2db.util.Debug Loading messages on server for a client, modified change: -1, language: en_AU, solution: null
Thanks Sebastiaan
I think I’ve almost got it. I played around with the various ‘proxy’ settings that are available in ARR in IIS7.
Specifically I:
a) Enabled ‘Reverse rewrite host in response headers’
b) Disabled ‘Include TCP Port from Client IP’ in custom headers
After those changes it started working…albeit very slowly. The SC downloads AND connects to the dataservice AND opens the default solution all on the redirected URL. great.
Interestingly I did insert the system properties you suggested:
but they made it break again. Are you sure that the properties should be set to false? Surely that would turn chunking off?
What is chuning anyway and how does it interact with IIS?
The “chunked” property MUST be true via ISS (otherwise it breaks), but the closeRequestOnFlush doesn’t matter functionality wise, but turning it off will speed up the data rate significantly.
Also, on the IIS7+ARR server you need ‘Include TCP Port from Client IP’ OFF in the proxy settings.
From my testing it seems that ‘Reverse rewrite host in response headers’ doesnt matter.
I also set the ‘Response Buffer Threshold’ in ARR proxy to 0 - to get ARR to start streaming the response from tomcat back immediately rather than buffer it. This seemed to increase performance about 20% ? (no measurements- just counting under my breath!)
So I seem to have a working servoy on ports 80/443 behind IIS7 + ARR.
If you could send me the networktnl.jar of your distribution I can check out what went wrong initially. (You can email it it to my svanerk |at| servoy.com email address).
Theoretically, if there is no buffering between tomcat and the client, you can set closeRequestOnFlush to false; this will greatly improve performance. The problem is that if anything buffers, this option is required to be true. Things that may buffer:
the proxy (but you turned it to 0 now, so you could try setting it to false again)
a virus-scanner on the client (specifically a “web-shield” part of the virus scanner)
Hi Sebastiaan,
Good news.
It seems that you are correct…after setting the ‘Response Buffer Threshold’ in ARR proxy to 0 to stop ARR waiting to buffer I can now set: