|
Before trying to configure JProxy Tunnel try to use the default settings supplied
with the package. JProxy Tunnel is preconfigured to accept most of tested Application Servers
without even making any configuration changes.
The JProxy Tunnel distribution consists of two independant parts:
JProxy Tunnel Server - proxy.ear
JProxy Tunnel Client - proxyclient.jar
Both JProxy Tunnel client and server may be configured independently.
Configuring JProxy Tunnel Server
The JProxy Tunnel server is a J2EE application - proxy.ear, which contains
a Web-module proxyservlet.war.
This Web-module contains one servlet - TunnelServlet.
There are two ways to configure JProxy Tunnel server.
1. By setting <init-param> in
web.xml located in
WEB-INF directory.
The file is a deployment descriptor of proxyservlet.war.
The parameters will be read just after first client access of
JProxy Server.
2. By customizing proxy.properties
located in WEB-INF/classes/com/jproxy/proxy
directory. The parameters from proxy.properties are loaded just after deployment of
proxyservlet.war during classes resolving of the web application.
This method of passing parametes to the JProxy Server is utilized because
of not all Servlet Engines supports J2EE deployment standard,
also same method is used to configure JProxy Client. To change
the file just unzip proxyservlet.war. Modify parameters in proxy.properties.
and zip the file back in the war file.
A property value in in web.xml overrides the value of the same property in proxy.properties.
Experience shows that most often JProxy Tunnel Server configuration is changed for:
Web-Context
JNDI Initial Context Factory class
Provider URL
Configuring JProxy Tunnel Client
JProxy Tunnel client may be configured by modifying the values in the proxy.properties file.
But in this case the proxy.properties file is located in proxyclient.jar in
com/jproxy/proxy directory.
To change the file just unzip proxyservlet.war, then unzip proxyclient.jar.
Modify desired properties' values in proxy.properties. Lastly, put modified proxy.properties back into
proxyclient.jar and in turn proxyclient.jar nack into proxyservlet.war.
The proxy.properties file contains client and server properties. Here is a list of properties:
com.jproxy.proxy.version
|
This is a client/server property. Its value is JProxy Tunnel Version.
|
|
com.jproxy.proxy.tunnel.url
|
This is a client property. The default value is http://localhost/proxyservlet/servlet/proxyservlet
A tunneling URL. The property is used to construct complete URL to access servlet.
This property is default template for tunneling URL.
During runtime JProxy Tunnel constructs tunnel URL by merging fields in following priority:
Context.PROVIDER_URL("java.naming.provider.url"); com.jproxy.proxy.tunnel.url; ServletTunnel.DEFAULT_TUNNEL_URL.
So for instance: if you set just IP in your env.put("java.naming.provider.url", "10.10.10.10");
JProxy Tunnel will construct URL in following order.
Check what fields missing in "java.naming.provider.url". In this example it is protocol, port and path.
Then it will try to obtain missing fields from proxy.properties "com.jproxy.proxy.tunnel.url".
Then if there are still some fields are missing it takes them from
ServletTunnel.DEFAULT_TUNNEL_URL = http://localhost/proxyservlet/servlet/proxyservlet.
So you may set "com.jproxy.proxy.tunnel.url" to "https://localhost" or even just "http://".
Examples: http://myserver.com/proxyservlet/servlet/proxyservlet, https://myserver.com:8080/proxyservlet/servlet/proxyservlet,
myserver.com:8080
|
|
com.jproxy.proxy.initial
|
This is a client property. The default value is whatever the system sets as default.
Naming Context Factory Class for EJB Server. Usually you do not need to specify the property,
because JProxy Server usually works in same JVM as Naming Service. The default value will be
taken form System properties Context.INITIAL_CONTEXT_FACTORY. If JProxy Server and Application Server
are running on different machines then the property has to be set. Here are some known
Naming Context Factory classes for different servers:
JBoss: org.jnp.interfaces.NamingContextFactory
BEA WebLogic: weblogic.jndi.WLInitialContextFactory
Orion: com.evermind.server.ApplicationClientInitialContextFactory, com.jproxy.proxy.providers.OrionNamingContextFactory
Sun Ref.Impl.Server: com.sun.jndi.rmi.registry.RegistryContextFactory
|
|
com.jproxy.proxy.provider.url
|
This is a client property. The default value is whatever the system sets as default.
Naming Service URL for an EJB Server. Usually you do not need to specify the property,
because JProxy Server usually works on same host as Naming Service. Here is some known URL
patterns for different servers:
JBoss: localhost
BEA WebLogic: t3://localhost:7001
Orion: ormi://localhost
Sun Ref.Impl.Server: rmi://localhost:1099
|
|
com.jproxy.proxy.max.failover.attempts
|
This is a client property. The default value is 3 (three). This sets the maximim number of failover invocation attepmts
|
|
com.jproxy.proxy.socket.timeout (commercial version only)
|
This is a client property. The default value is 0 (zero).
This sets the socket timeout (milliseconds: 1/1000 sec).
0 means the client time out will never happen
|
|
com.jproxy.proxy.callback.pending.time
|
This is a client property. The default value is 30000 milliseconds (30 seconds).
The max pending time (milliseconds: 1/1000 sec) for client's polling.
The polling gets unblocked if there is a callback to the client.
|
|
com.jproxy.proxy.use.jproxy.ssl.socket.factory
|
This is a client property. The default value equals to false.
A flag enabling JProxy SSLProxySocketFactory. The factory allows
authentication with JProxy Tunnel Servers and timeouts for SSL.
|
|
com.jproxy.proxy.compression.enabled
|
Depricated. See "com.jproxy.proxy.network.perfromance.threshold".
This is a client and server property. The default value equals to false.
A flag enabling JProxy Tunnel compression for data marshalling/unmarshalling.
|
|
com.jproxy.proxy.network.perfromance.threshold (commercial version only)
|
This is a client property.The default value is 1000000.
Network Performance Threshold (bytes per second). JProxy Client measures network
performance for each call. If detected performance is higher than specified threshold then data compression is disabled. A data compression is enabled otherwise. Server always
uses compression if client request uses compression. To explicytly disable
compression specify threshold as 0. To explicytly enable compression set this thresold to ahigh value:
for instance 1000000000. This property depreciates com.jproxy.proxy.compression.enabled property
|
|
com.jproxy.proxy.compiler.class.path
|
This is a server property. The default value equals to ".".
A classpath for compiler used by stubgen for compiling stubs during dynamic
stub generation (for JDKs earlier than 1.3). The parameter does not have
to be set if all necessary libraries are placed in directory specified
in com.jproxy.proxy.lib.class.path parameter. The parameter is used
to enable JProxy Client for web browsers that do not have
Sun Java Plug-in 1.3 installed such as MS Internet Explorer
that has its own Microsoft JVM.
|
|
com.jproxy.proxy.compiler.options
|
This is a server property. The default value equals to "".
An options for javac compiler used by stubgen for compiling stubs during dynamic
stub generation (for JDKs earlier than 1.3). The parameter is used
to enable JProxy Client for web browsers that do not have
Sun Java Plug-in 1.3 installed such as MS Internet Explorer
that has its own Microsoft JVM.
|
|
com.jproxy.proxy.lib.class.path
|
This is a server property. The default value equals to ".".
A classpath for libraries for compiler used by stubgen for dynamic stub
generation (for JDKs earlier than 1.3) The current value is
/tomcat/webapps/appletsms. The value is set only to enable online examples of the site.
The parameter is used to enable JProxy Tunnel client for web browsers that do not have
Sun Java Plug-in 1.3 installed such as MS Internet Explorer that has its own Microsoft JVM.
|
|
com.jproxy.proxy.stubgen.class.path
|
This is a server property. The default value equals to "/stubs".
A classpath for proxies generated by dynamic stub generator (for JDKs earlier
than 1.3). The stub generator uses the path to place generated stubs. The stubs must
be accessible for JProxy Tunnel client during class downloading from code base specified
in CODEBASE attribute in APPLET tag. The current value is /tomcat/webapps/appletsms.
The value set only to enable online examples of the site. The parameter is used to enable
JProxy Tunnel client for web browsers that do not have Sun Java Plug-in 1.3 installed
such as MS Internet Explorer that has its own Microsoft JVM.
|
|
com.jproxy.proxy.tunnel.class
|
This is a client and server property. The default value is "com.jproxy.proxy.servlet.ServletTunnel"
A class name of tunnel class for synchronous communication implementing com.jproxy.proxy.Tunnel.
This property could be used to specify your own client-side implementation of tunneling.
|
|
com.jproxy.proxy.callback.tunnel.class
|
This is a client and server property. The default value is "com.jproxy.proxy.callback.CallbackTunnel"
A class name of tunnel class for asynchronous communication implementing com.jproxy.proxy.Tunnel.
This property could be used to specify your own client-side implementation of tunneling
for asynchronous calls or callbacks.
|
|
com.jproxy.proxy.log.level
|
This is a client and server property. The default value is "INFORMATION"
A verbosity level of loggin: one of following: NONE,FATAL,ERROR,WARNING,INFORMATION,DEBUG
or abbreviation: N,F,E,W,I,D.
|
|
com.jproxy.proxy.log.class
|
This is a client and server property. The default value is "System.out"
A class used that handles logging information. It must inherit from PrintStream.
If the property not specifyed then System.out is used.
|
|
com.jproxy.proxy.object.ttl
|
This is a client and server property. The default value is "60000" (1 minute).
Object's Time-To-Live (mills=1/1000 s) for remote objects for the JProxy Tunnel server.
If remote object never gets called during the TTL range it will be automatically
garbage collected. Set this value to 0 to disable.
|
|
com.jproxy.proxy.object.destroy.enabled
|
This is a client and server property. The default value is "false".
A flag enabling automatic object destruction by JProxy Garbage Collector (GC).
If it is set to "false" then GC will still work to clean local resources
but it will not destroy remote objects.
|
|
com.jproxy.proxy.remote.classes
|
This is a client and server property. The default value is "java.rmi.Remote,
javax.jms.ConnectionFactory,javax.jms.Connection, javax.jms.Session,javax.jms.MessageProducer,
javax.jms.MessageConsumer, javax.jms.Message,javax.jms.Destination,org.omg.CORBA.Object,
com.jproxy.proxy.callback.CallbackServer". A list of classes implementation of which reside on the server.
When a client requests an instance of one of the enumerated classes JProxy Tunnel
will automatically create a server stub for that class, let client make a call to this class
as if the implementation of this class was locally available.
|
|
com.jproxy.proxy.datastack.enabled
|
This is a client/server property. The default value is "false".
A flag enabling remote call optimization. During this optimization, all calls that return void are aggregated and
sent as one request to the server to save bandwidth.
|
|
com.jproxy.proxy.server.response.min
|
This is a server property. The default value is "0".
A minimum length of server response.
|
|
com.jproxy.proxy.tunnel.invocation.interceptor
|
This is a client/server property. The default value is "null".
Specifies the class handler for InvocationInterceptor. If specifyed the interceptor is called
on the JProxy server before each remote call.
For JAAS (JBoss) the property must be set to: com.jproxy.proxy.providers.JaasInvocationInterceptor.
Also for JBoss set property com.jproxy.proxy.jaas.configuration.name = client-login
For Orion Server for EJB security: com.jproxy.proxy.providers.OrionInvocationInterceptor
|
|
com.jproxy.proxy.jaas.configuration.name
|
This is a server property. The default value is "others".
A JAAS Configuration name. Default value is "other".
For JBoss the value must be set to "client-login".
|
|
com.jproxy.proxy.native.exceptions.enabled
|
This is a client property. The default value is false. If set to true, then all server exceptions are passed to the client side as is.
In this case client must have access to the classes of serialized server exceptions. If set to false, then JProxy Server
analizes the exception being thrown and acts as follows:
|
If the class of the exception being thrown is the same as declared in the throw clause of an interface's method declaration
this exception is passed to the client as is.
|
|
If the class of the exception being thrown is inherited from a non-standard J2SE/J2EE exception class declared in
the throw clause of an interface's method declaration, then this exception is passed to the client as is.
|
|
If the class of the exception being thrown is inherited from a standard J2SE/J2EE exception class declared in
the throw clause of an interface's method declaration, but the thrown exception class by itself is a non-standard J2SE/J2EE
exception class, then the standard J2SE/J2EE exception declared in the throw clause of an interface's method
declaration is passed to the client.
|
|
If the class of the exception being thrown nor its parent class is declared in the throw clause of an interface's method
declaration then RuntimeException with the thrown exception's message is passed to the client.
|
Standard J2SE/J2EE exceptions are those defined in packages that start with:
java, org.omg, org.xml,
com.sun, sun and org.w3c
|
|
|
|