Howto prepare RMI objects before clients request
Hi, here is what I intend to do on the server side.
Server Roles:
- provide authentication.
- have a queue of data ready to deliver to clients requests. (to build this queue the server must get information from the DB, do some filtering and priority)
- Keep record of logged clients (this will affect the queue as well)
- on clients responses (do some processing and insert data to DB
my worries are how should I prepare this queue before clients start requesting. Here is my approach
Use some flag mechanism to prevent delivery until objects are ready.
Execute an application (queue controller) on same rmi server (or other) that actually prepares this queue objects, once prepared set flags ready for delivery.
The queue controller would need to act as a daemon or service and keep an eye on the queue, acting on it if necessary.
How does this sound?
any suggestions
Thanks
Don't export the server until the queue is ready. Don't extend UnicastRemoteObject: instead, call UnicastRemoteObject.exportObject(remote, port) after you have made the queue ready for service.
Similar Messages
-
Pause before client requests. help plz!
hey i have a program that creates a bunch of clients. these clients send http requests to a server and log the responses. currently i have it so each client sends 5 requests, one after the other. the problem is, right now there is a pause between each request. so if i make like 1000 clients, they all send the first requests, and wait until all the clients have sent the first request, then theres a long pause, and then they all start sending the second request. same with secodn to third etc. my code isn't written this way however. it is written so that when a client finishes a first request, it should automatically start the second request. anyone have any idea why this is happening? i can post code if you want but its a little confusing cause i pull the requests from a file and store in array lists and junk like that, so you can't see everything in just the run() method.
just wondering if anyone has any suggestions???Hi
Actually it is not at all possible for a solution to the problem like this without having a look at the code [entire code i mean]
So if it is not so secret that you can post the code that would be helpful to you and others to help.
Or if you want u can mail me at [email protected]
Take care and smile always -
You must register your tables using JDDI before you request them
Hey Guys....
I'm trying to query a custom table created on a SQL Server 2005 database, the same RDBMS for the SAP Web AS. I'm using a different database from the sytem's standard.
I created a Datasource for it. I can get the connection, but when I execute a query I get the following message.
Please note that I used everything SAP recommends for JDBC connector. I have done this previously for an oracle database but this time this approach (MS SQL) is not working...
I don't understand what it means for registering the tables using JDDI.
Could you please show me some light?
java.rmi.RemoteException: com.sap.engine.services.dbpool.exceptions.BaseRemoteException: SQL statement(s) cannot be executed over DataSource "ZPORTAL". If you are using an Open SQL DataSource, you must register your tables using JDDI before you request them. Reason: java.sql.SQLException: [NWMss][SQLServer JDBC Driver][SQLServer]Invalid object name 'BC_DDDBTABLERT'. [id = Unknown]
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.executeFromAppThread(DataSourceManagerImpl.java:1201)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.executeInitStatements(DataSourceManagerImpl.java:532)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.pj.jmx.introspect.DefaultMBeanInvoker.invoke(DefaultMBeanInvoker.java:58)
at com.sap.pj.jmx.mbeaninfo.AdditionalInfoProviderMBean.invoke(AdditionalInfoProviderMBean.java:289)
at com.sap.pj.jmx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:944)
at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.invoke(MBeanServerWrapperInterceptor.java:288)
at com.sap.engine.services.jmx.CompletionInterceptor.invoke(CompletionInterceptor.java:409)
at com.sap.pj.jmx.server.interceptor.BasicMBeanServerInterceptor.invoke(BasicMBeanServerInterceptor.java:277)
at com.sap.jmx.provider.ProviderInterceptor.invoke(ProviderInterceptor.java:258)
at com.sap.engine.services.jmx.RedirectInterceptor.invoke(RedirectInterceptor.java:340)
at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.invoke(MBeanServerInterceptorChain.java:330)
at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.invoke(MBeanServerSecurityWrapper.java:287)
at com.sap.engine.services.jmx.MBeanServerInvoker.invokeMbs(MBeanServerInvoker.java:131)
at com.sap.engine.services.jmx.ClusterInterceptor.invokeMbs(ClusterInterceptor.java:212)
at com.sap.engine.services.jmx.ClusterInterceptor.invoke(ClusterInterceptor.java:766)
at com.sap.engine.services.jmx.MBeanServerInterceptorInvoker.invokeMbs(MBeanServerInterceptorInvoker.java:102)
at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImpl.invokeMbs(P4ConnectorServerImpl.java:61)
at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImplp4_Skel.dispatch(P4ConnectorServerImplp4_Skel.java:64)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:319)
at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:200)
at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
Caused by: java.sql.SQLException: [NWMss][SQLServer JDBC Driver][SQLServer]Invalid object name 'BC_DDDBTABLERT'.
at com.sap.dictionary.database.catalog.XmlCatalogReader.getTable(XmlCatalogReader.java:98)
at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:126)
at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:89)
at com.sap.sql.sqlparser.CheckColAndTabVisitor.checkTabs(CheckColAndTabVisitor.java:247)
at com.sap.sql.sqlparser.CheckColAndTabVisitor.performCatalogChecks(CheckColAndTabVisitor.java:170)
at com.sap.sql.sqlparser.CommonSQLStatement.checkSemantics(CommonSQLStatement.java:184)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:42)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:126)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:109)
at com.sap.sql.jdbc.common.CommonStatementImpl.execute(CommonStatementImpl.java:217)
at com.sap.engine.services.dbpool.wrappers.StatementWrapper.execute(StatementWrapper.java:167)
at com.sap.engine.services.dbpool.deploy.DBInitializer.run(DBInitializer.java:69)
... 4 moreI changed the SQL Engine parameter to "Vendor SQL" under Additional tab of my datasource configuration
-
Unable to retreive RMI object bound to JNDI
Hi
I am trying to retrieve an rmi object that appears to have been sucessfully
deployed to the weblogic server. Upon startup the nt command console shows
the message below and the class name appears in the Distributed objects/rmi
area in the Weblogic console.
Invoking main-style startup Guid xxxxxx.GuidImpl
However if I try to write a test client using either one of the following
calls I get a NameNotFoundException.
I have tried both the name Guid (which is what is in the startup entry) and
the fully qualified name. They all have the same results.
Sample calls:
Naming.lookup("Guid");
or
getInitialContext();
jndiContext.lookup("Guid");
In my weblogic properties files I have the following entry:
weblogic.system.startupClass.Guid=xxx.GuidImpl
in the main of GuidImpl class I have the following entry:
Naming.bind("xxx.Guid");
any ideas as to what might be wrong?
ThanksHi, all:
Currently I evaluate BEA Weblogic 6.1 server. I've read the "Programming
WebLogic JNDI" section of the documentation for Weblogic server 6.1.
However, I couldn't find the answer for my question. What problem I have
now is that
(1): How I can create a object in the Java VM when the Weblogic server
startup? Note:
This class need to read a property files and
store all of properties information into its instance for the
client program to lookup it later.
(2): How can the previous created object to be bound in the Weblogic
JDNI server and the bounded
object can be shown up in the JDNI tree in the Weblogic server's
console?
(3): How do I code my servlet to lookup that object I
just created in the step1? What configuration settings need to be
done before Weblogic server is started?
Because I am stopped by this problem, if anyone can give me the example
code or some explanation of the solution ASAP,
it would be very appreciated....Thanks in advance.......
Merry Christmas
Long -
Questions on scripts, tables & transfer objects between clients.
1. In script, how to use the same print program for two different layouts? with procedure.!
2. Why cant sapscripts be client independent.?
3. Want to maintain a table in dev server and if i update the data, it should simultanously update in Quality and Production servers. How? please explain in details.
4. How to transfer object between clients.? explain.
Points will be promptly rewarded for HELPFULL answers.!Hi!
3. With SE01, you can create a transport request for all table entries.
SE01 - Create button - Workbench request - Give description and save
Select the created request and click on Display object list.
Click on Display - Change button
Insert line button
ProgID: R3TR
Object: TABU
Object name: Z_YOUR_TABLE
Double click on the table name
Insert line
Key: *
Save everything
Release the transport in SE10 transaction and transport with STMS transaction.
Regards
Tamá -
Dynamically assign value to bind variable in a view object before pageload
I found that it is extreamely hard to find an example to assign the bind variable in View object at runtime using a data attribute defined in Human task activity. Most of the available samples use a Literal value to do the assignment. In my case, I want to dynamically display the content by assigning the data attribute in Human task to the bind variable in view object before a pageload.
I do not want to bind the view object to some command component to click a button or link in order to make it work (Unnecessary components in my page).
The issue is how to access the data attribute in Human task in the java code of client interface in AppModule? or is there a way that I can access the data attribute in Groovy script expression of the bind variable? or if I can access the process data object defined in my BPM process to do the assignment at runtime?
Really need help on the issue, and I cannot believe that it is so hard to accomplish.
Thank you very much,chk this
Passing default value to bind variable on page load.
http://adfcodebits.blogspot.com/2010/03/bit-2-setting-bind-variable-value.html -
How to use RMI objects in a servlet
Hi,
I have just run the example RMI program in the java tutorial in my linux pc. Also I have another method to just echo a string back. It works fine when calling from command line.
Now I want to write a servlet that get a string when POSTed and call the RMI objects echo method and display the returned string.
I use Tomcat-5.0 which is installed in /usr/local. I moved the remote object interface jar to the common/lib folder and import the interface in my Servlet. I use the following statements inside the servlet to get the RMI object reference.
Registry registry = LocateRegistry.getRegistry("localhost");
Rser comp = (Rser) registry.lookup("rmiser");When i use this in my servlet the tomcat stops working.
Also I don't know how to specify the code base and security policy which I use in command prompt when calling RMI object.
Pls suggest me what to do and also specify any resources that explain this task step by step.
Thanks.restarted the system and caught the following exception while calling the servlet.
Apr 30, 2009 12:24:15 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3861 ms
java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1034)
at java.net.Socket.connect(Socket.java:513)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:180)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at RequestParamExample1.doGet(RequestParamExample1.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at filters.ExampleFilter.doFilter(ExampleFilter.java:101)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:619)
Apr 30, 2009 12:25:19 PM org.apache.coyote.tomcat5.CoyoteAdapter service
SEVERE: An exception or error occurred in the container during the request processing
java.security.AccessControlException: access denied (java.lang.RuntimePermission setContextClassLoader)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.Thread.setContextClassLoader(Thread.java:1351)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:619)
Exception in thread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" java.security.AccessControlException: access denied (java.lang.RuntimePermission setContextClassLoader)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.Thread.setContextClassLoader(Thread.java:1351)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1623)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1608)
at java.lang.Thread.run(Thread.java:619)
Hope u can find it now.
the line
at RequestParamExample1.doGet(RequestParamExample1.java:94)
is the file I am editing and using to call RMI.
Edited by: itsraja on Apr 30, 2009 12:06 AM -
RMI & Web Start Client (ClassNotFound)
Hi,
I've been using RMI with a client application and it works find but now I have tried to run the same application via web start I'm getting RMI issues. I've fixed all sorts of other issues but Im stuck on the RMI one. I get a ClassNotFound exception when Register.lookup() is called.
The code in the client is :
Registry registry = LocateRegistry.getRegistry("localhost", 1234);
// lookup the factory
universe = (IMyFactory) registry.lookup("rmi:///MyFactory");
The exception is thrown on the lookup. It can't find IMyFactory_stub. If I put the following line in after the Register creation :
register.list()
and dump the contents it has one entry
rmi:///MyFactory
I take it this implies that the web start client has talked to the server to get hold of the classes that have been bound. This appears to match exactly what I am looking up. So its not getting the interface file ! Im know RMI expert to why would this be the case with Web Start but not standalone ?
The MyFactory class is contained in a jar file declared in the jnlp file and available to the client. The IMyFactory and MyFactory_stub classes are in a jar file available to the server. MyFactory implements IMyFactory which is a Remote.
Oh also the jnlp file has all permisions set.
As I say it works fine as a stand alone client.
Any idea's what this could be ? Some setting unique to web start, different format for the url required (I tried using Naming.lookup() but this failed also).
The app seems to hang for a few seconds before the exceptions is thrown. If I give it a url to the wrong box it blows up str8 away.
The exception is :
java.rmi.UnmarshalException: error unmarshalling return; nested
exception is:
java.lang.ClassNotFoundException: com.me.MyFactory_Stub
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at com.me.getMyServer(getMyServer.java:116)
at com.me.main(agentsupport.java:6825)
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.continueLaunch(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.me.MyFactory_Stub
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
... 21 more
Thanks for any help, I'm out of idea's and totally stuck.
SteveHi Kal,
since we're currently evaluating the software and haven't acquired a license, we cannot contact support.
I only need to know if this is a solved bug or not. Does it have to do with the classloading process (I cannot think of anything else)?
Thank you again very very much!
Cheers,
Paul. -
Trouble in storing and retrieving RMI object in Weblogic 7 JNDI tree.
I have created a simple server (BankImpl), implementing a RMI interface
called Bank. A stub class (BankImpl_Stub.class) is generated from BankImpl
class using
"rmic -v1.2". Then I bind an instance of the BankImpl class to the JNDI tree
in Weblogic
server 7 under the name of "PeopleBank".
After the binding, I can see the stub class in the JNDI tree, but with a
different name: BankImpl_WLStub.class). when a
client program is trying to lookup the stub associated with "PeopleBank", it
failed with a puzzling message:
java.io.NotSerializableException: BankImpl_WLStub
Why a stub of a RMI object is not serializable? Does Weblogic needs a
different rmic to generate RMI stubs?
Thanks,
LianI have created a simple server (BankImpl), implementing a RMI interface
called Bank. A stub class (BankImpl_Stub.class) is generated from BankImpl
class using
"rmic -v1.2". Then I bind an instance of the BankImpl class to the JNDI tree
in Weblogic
server 7 under the name of "PeopleBank".
After the binding, I can see the stub class in the JNDI tree, but with a
different name: BankImpl_WLStub.class). when a
client program is trying to lookup the stub associated with "PeopleBank", it
failed with a puzzling message:
java.io.NotSerializableException: BankImpl_WLStub
Why a stub of a RMI object is not serializable? Does Weblogic needs a
different rmic to generate RMI stubs?
Thanks,
Lian -
Last use of RMI object instance
I have an RMI object with instance variables. As clients of this
remote object method make calls on it, these instance variables
are used and modified. My question is; Is there a way where I can
check when the last call from the client where made using a certain
instance?
Do I have to have separate timer methods for each instance to track
the time elapsed since last use?
Any answers are appreciated.
/MatsPerhaps you could post something describing what you are trying to do. (Sounds like you want to keep track of last-used-time on a bunch of data elements?)
-
Possible to use RMI to upload client side image files?
Is it possible to use RMI to upload client side image files? My intent is to allow remote clients to upload a number of small image files (jpg & gif) to a central server DBMS, by modifying a "Customer" object (eg adding a new Image object to a vector of Images?) Is this possible? Any suggestions greatly appreciated :))
Is it possible to use RMI to upload client side image
files? One possibility is to implement a serializable image object that you can upload to the server as any other object. When your server receives this serialized image object, just generate a new gif/jpg from it.
But if your client-program is an applet, the situation is different: how can applet read image-file from users harddrive?
krera -
How can I have my servlet accept 100 concurrent client requests?
My servlet extends HttpServlet so it is multithreaded. Then I have written a java
client which starts 100 concurrent threads that try to contact the servlet.
There are always lots of threads which are refused by the Weblogic Server 6.0.
They get a 'Connection refused' exception. Sometimes there are 50 refused connections,
sometimes there are 0 refused connections (not very often), sometimes there are
80 refused connections (usually).
I have checked the 'Servlet' documentation and the 'J2EE Design Considerations
for Weblogic Server' which recommends not to exceede the execute thread count
number of 15. I have not changed that value, I do not even know if it still exists
in Weblogic 6.0 as the document refers to the 5.0 version.
Does anybody know how to solve this problem? How can I have the client requests
waiting rather than being refused? Of course the main goal is to serve all the
client requests, not to refuse.
This is the code that the client thread uses to contact the servlet:
URL url = new URL("http://localhost:7001/examplesWebApp/myServlet");
URLConnection conn = url.openConnection();
conn.setDoInput(true);
conn.setDoOutput(true);
DataOutputStream os = new DataOutputStream(conn.getOutputStream());
os.writeBytes()
os.writeBytes()
Thanks for your time,
David
The key is
KKEY_LOCALMACHINE\SYSTEM\CurrentControlSet\Services\TCPIP\Parameters
There you may need add a value "MaxUserPort" as REG_DWORD (5000 is default), also
change "TcpTimedWaitDelay" to small number (30 is minimum). You may have trouble
to find them. Just add them.
You can also use Microsoft Web Application Stress Tool to test your Weblogic applications.
As a free test tool, it is really powerful, although not so flexible.
I guess you write your own test tool with java.net.URLConnection. I am not sure
about the power of this class. In my case, I wrote my stress test tools with Java
Socket. I can test application on Weblogic 6 with 1000 threads with my own tool
and Microsoft tool, depending on memory and CPU of the machines I use. I run my
tests on both Windows 2000 professional and Solaris.
Check your CPU and memory usage with task manager.
On the other hand, you should check log message on Weblogic 6. Try to turn on
HTTP debug by add the following in your config.xml in tag <Server>.
<ServerDebug DebugHttp="true" DebugURLResolution="true"
JDBCConn="true" JDBCSQL="true" ListenThreadDebug="true" Name="myserver"/>
"David Ruana" <[email protected]> wrote:
>
>Xiang, I really appreciate your help. I changed my Weblogic server configuration
>from the console but I still experience the same problems.
>
>I start my 100 threads, and from about the 20th onward all them get the
>'Connection
>refused' exception in the URLConnection::getOutputStream() function,
>always after
>a successful URLConnection::openConnetion().
>
>My system is Windows 2000 Professional (Spanish version). I tried to
>check the
>open client socket descriptor limit but I was not able to find the TCPIP/MAXUSERPORT
>in the registry. Do you know how is this entry called in Windows 2000?
>
>At this point I am not sure whether my problems are related to the Weblogic
>server
>or to the operative system. I will keep trying... I would appreciate
>any other
>suggestion.
>
>Thank you very much.
>
>
>
>"Xiang Rao" <[email protected]> wrote:
>>
>>It is better to use Weblogic 6 console to configure Weblogic server.
>>In the console,
>>there is tab Servers->myServer->Congiguration->Tuning, you can find
>execute
>>length
>>and backlog.
>>
>>If you use Windows as test client, note Windows have a 5000 open client
>>socket
>>descriptors limit. You need change Windows Registry (TCPIP/MAXUSERPORT)
>>to change
>>this parameter.
>>
>>On the other hand, during test, you should monitor your test via Weblogic
>>console
>>(myServer->Monitoring->Performance), here you can see the change of
>wait
>>queue.
>>If the queue keeps increaing, you are in trouble.
>>
>>Since you know how to use MBean, try to write customized (servlet, for
>>example)
>>to collect the following data: opened socket number, open socket number,
>>opened
>>session number and open session number. The two "open" numbers will
>give
>>you some
>>clue. Also record your CPU and memory usage.
>>
>>BTW, what is the output you get from your test in terms of number of
>>requests
>>per second, response time and number of bytes downloaded/uplodaed per
>>second?
>>Are your test client and Weblogic running on the same machine?
>>
>>
>>
>>"David Ruana" <[email protected]> wrote:
>>>
>>>By the way, this is a piece of the config.xml file where you can see
>>>my Server
>>>configuration. It is the configuration which is installed in the examplesServer
>>>in the free evaluation of Weblogic 6.0. I only modified the AcceptBacklog
>>>value,
>>>and added the ThreadPoolSize="15" line which was missing (I copied
>from
>>>the petstoreServer).
>>>
>>> <Server AcceptBacklog="1000" AdministrationPort="0" ClusterWeight="1"
>>> ConsoleInputEnabled="false" DGCIdlePeriodsUntilTimeout="2"
>>> DefaultProtocol="t3" DefaultSecureProtocol="t3s"
>>> HttpdEnabled="true" JavaCompiler="C:\bea\jdk130/bin/javac"
>>> ListenPort="7001" Name="examplesServer" NativeIOEnabled="true"
>>> ThreadPoolSize="15"
>>> SocketReaderTimeoutMaxMillis="10"
>>> TransactionLogFilePrefix="config/examples/logs/"
>>> TunnelingClientPingSecs="45" TunnelingClientTimeoutSecs="40"
>>>XMLRegistry="examplesXMLRegistry">
>>> <ServerDebug Name="examplesServer"/>
>>> <WebServer DefaultWebApp="DefaultWebApp_examplesServer"
>>> LogFileName="./config/examples/logs/access.log"
>>> LoggingEnabled="true" Name="examplesServer"/>
>>> <Log FileName="./config/examples/logs/weblogic.log" Name="examplesServer"/>
>>> <KernelDebug Name="examplesServer"/>
>>> <SSL Enabled="true" ListenPort="7002" Name="examplesServer"
>>> PeerValidationEnforced="0"
>>> ServerCertificateChainFileName="./config/examples/ca.pem"
>>> ServerCertificateFileName="./config/examples/democert.pem"
>>> ServerKeyFileName="./config/examples/demokey.pem" TrustedCAFileName="./config/examples/ca.pem"/>
>>> </Server>
>>>
>>>
>>>
>>>
>>>
>>>"Xiang Rao" <[email protected]> wrote:
>>>>
>>>>You only need to change Weblogic HTTP configuration. Give the server
>>>>a big socket
>>>>Backlog number. Since you test with 100 threads, you can think 1000
>>>to
>>>>5000, i.e.,
>>>>1000 to 5000 requests will be in queue before got served. Aslo, you
>>>might
>>>>need
>>>>to change your OS TCP/IP settings (both test clients and servers),
>>such
>>>>as maximum
>>>>number of sockets and timeout value(so closed sockets will release
>>socket
>>>>descriptors
>>>>immediately).
>>>>
>>>>On the other hand, the number of executive threads can be much larger
>>>>than 15
>>>>(50-200 is a normal number), depending on the features of your application.
>>>>You
>>>>can try your stress test tools to find a reasonable number by analyzing
>>>>the relationships
>>>>among (throughtput, response time, number of executive threads, etc).
>>>>
>>>>
>>>>"David Ruana" <[email protected]> wrote:
>>>>>
>>>>>My servlet extends HttpServlet so it is multithreaded. Then I have
>>>written
>>>>>a java
>>>>>client which starts 100 concurrent threads that try to contact the
>>>servlet.
>>>>>
>>>>>There are always lots of threads which are refused by the Weblogic
>>>Server
>>>>>6.0.
>>>>>They get a 'Connection refused' exception. Sometimes there are 50
>>refused
>>>>>connections,
>>>>>sometimes there are 0 refused connections (not very often), sometimes
>>>>>there are
>>>>>80 refused connections (usually).
>>>>>
>>>>>I have checked the 'Servlet' documentation and the 'J2EE Design Considerations
>>>>>for Weblogic Server' which recommends not to exceede the execute
>thread
>>>>>count
>>>>>number of 15. I have not changed that value, I do not even know if
>>>it
>>>>>still exists
>>>>>in Weblogic 6.0 as the document refers to the 5.0 version.
>>>>>
>>>>>Does anybody know how to solve this problem? How can I have the client
>>>>>requests
>>>>>waiting rather than being refused? Of course the main goal is to
>serve
>>>>>all the
>>>>>client requests, not to refuse.
>>>>>
>>>>>This is the code that the client thread uses to contact the servlet:
>>>>>
>>>>>URL url = new URL("http://localhost:7001/examplesWebApp/myServlet");
>>>>>URLConnection conn = url.openConnection();
>>>>>conn.setDoInput(true);
>>>>>conn.setDoOutput(true);
>>>>>
>>>>>DataOutputStream os = new DataOutputStream(conn.getOutputStream());
>>>>>os.writeBytes()
>>>>>os.writeBytes()
>>>>>...
>>>>>
>>>>>Thanks for your time,
>>>>>David
>>>>>
>>>>
>>>
>>
>
-
Controllers not re-directing client requests to ISE
Please find attached a simple BYOD/ISE document I uploaded to kick start my new Wireless setup. Its all configured on my ISE sever and Controller as per doc.
My setup:
3600 AP's
Internal 5508 Controller
DMZ 5508 Controller (acts as a DHCP server for wireless clients)
Controllers have established connectivity (mobility acnhors), as a client I can connect fine to my new SSID get a DHCP IP address back from DMZ WLC and at the moment can connect out to the Internet fine (using no WLAN Security as a test). So this part is working.
I have now followed the document configured ISE, enabled AAA on the Internal WLC only and used the AAA override setting on WLAN as in the attached document.
I connect to SSID expecting to be redirected to my ISE Guest Portal, nothing happens other than connecting to Internet WebPages.
My question is, if I have followed this document correctly why is the Internal WLC not redirecting client requests to ISE, is this because my mobility anchors need to be re-configured, perhaps the AAA/ISE config needs to be applied to my DMZ WLC not internal WLC?
I would prefer the Internal WLC to redirect the login to ISE, doesn't make sense to traverse through the DMZ Firewall onto DMZ WLC back into the Internal Network again to the ISE to authenticate.
Or am I missing something additionally to this document to make sure clients are directed to the ISE Guest portal login.After you configure web authentication, if the feature does not work as expected, complete these troubleshooting steps:
Check if the client gets an IP address. If not, users can uncheck DHCP Required on the WLAN and give the wireless client a static IP address. This assumes association with the access point. Refer to the IP addressing issues section of Troubleshooting Client Issues in the Cisco Unified Wireless Network for troubleshooting DHCP related issues.
On WLC versions earlier than 3.2.150.10, you must manually enter https://1.1.1.1/login.html in order to navigate to the web authentication window.
The next step in the process is DNS resolution of the URL in the web browser. When a WLAN client connects to a WLAN configured for web authentication, the client obtains an IP address from the DHCP server. The user opens a web browser and enters a website address. The client then performs the DNS resolution to obtain the IP address of the website. Now, when the client tries to reach the website, the WLC intercepts the HTTP Get session of the client and redirects the user to the web authentication login page.
Therefore, ensure that the client is able to perform DNS resolution for the redirection to work. On Windows, choose Start > Run, enter CMD in order to open a command window, and do a “nslookup www.cisco.com" and see if the IP address comes back.
On Macs/Linux: open a terminal window and do a “nslookup www.cisco.com" and see if the IP address comes back.
If you believe the client is not getting DNS resolution, you can either:
Enter either the IP address of the URL (for example, http://www.cisco.com is http://198.133.219.25)
Try to directly reach the controller's webauth page with https:///login.html. Typically this is http://1.1.1.1/login.html.
Does entering this URL bring up the web page? If yes, it is most likely a DNS problem. It might also be a certificate problem. The controller, by default, uses a self-signed certificate and most web browsers warn against using them.
For web authentication using customized web page, ensure that the HTML code for the customized web page is appropriate.
You can download a sample Web Authentication script from Cisco Software Downloads. For example, for the 4400 controllers, choose Products > Wireless > Wireless LAN Controller > Standalone Controllers > Cisco 4400 Series Wireless LAN Controllers > Cisco 4404 Wireless LAN Controller > Software on Chassis > Wireless Lan Controller Web Authentication Bundle-1.0.1 and download the webauth_bundle.zip file.
These parameters are added to the URL when the user's Internet browser is redirected to the customized login page:
ap_mac—The MAC address of the access point to which the wireless user is associated.
switch_url—The URL of the controller to which the user credentials should be posted.
redirect—The URL to which the user is redirected after authentication is successful.
statusCode—The status code returned from the controller's web authentication server.
wlan—The WLAN SSID to which the wireless user is associated.
These are the available status codes:
Status Code 1: "You are already logged in. No further action is required on your part."
Status Code 2: "You are not configured to authenticate against web portal. No further action is required on your part."
Status Code 3: "The username specified cannot be used at this time. Perhaps the username is already logged into the system?"
Status Code 4: "You have been excluded."
Status Code 5: "The User Name and Password combination you have entered is invalid. Please try again."
All the files and pictures that need to appear on the Customized web page should be bundled into a .tar file before uploading to the WLC. Ensure that one of the files included in the tar bundle is login.html. You receive this error message if you do not include the login.html file:
Refer to the Guidelines for Customized Web Authentication section of Wireless LAN Controller Web Authentication Configuration Example for more information on how to create a customized web authentication window.
Note: Files that are large and files that have long names will result in an extraction error. It is recommended that pictures are in .jpg format.
Internet Explorer 6.0 SP1 or later is the browser recommended for the use of web authentication. Other browsers may or may not work.
Ensure that the Scripting option is not blocked on the client browser as the customized web page on the WLC is basically an HTML script. On IE 6.0, this is disabled by default for security purposes.
Note: The Pop Up blocker needs to be disabled on the browser if you have configured any Pop Up messages for the user.
Note: If you browse to an https site, redirection does not work. Refer to Cisco bug ID CSCar04580 (registered customers only) for more information.
If you have a host name configured for the virtual interface of the WLC, make sure that the DNS resolution is available for the host name of the virtual interface.
Note: Navigate to the Controller > Interfaces menu from the WLC GUI in order to assign a DNS hostname to the virtual interface.
Sometimes the firewall installed on the client computer blocks the web authentication login page. Disable the firewall before you try to access the login page. The firewall can be enabled again once the web authentication is completed.
Topology/solution firewall can be placed between the client and web-auth server, which depends on the network. As for each network design/solution implemented, the end user should make sure these ports are allowed on the network firewall.
Protocol Port
HTTP/HTTPS Traffic
TCP port 80/443
CAPWAP Data/Control Traffic
UDP port 5247/5246
LWAPP Data/Control Traffic (before rel 5.0)
UDP port 12222/12223
EOIP packets
IP protocol 97
Mobility
UDP port 16666 (non secured) UDP port 16667 (secured IPSEC tunnel)
For web authentication to occur, the client should first associate to the appropriate WLAN on the WLC. Navigate to the Monitor > Clients menu on the WLC GUI in order to see if the client is associated to the WLC. Check if the client has a valid IP address.
Disable the Proxy Settings on the client browser until web authentication is completed.
The default web authentication method is PAP. Ensure that PAP authentication is allowed on the RADIUS server for this to work. In order to check the status of client authentication, check the debugs and log messages from the RADIUS server. You can use the debug aaa all command on the WLC to view the debugs from the RADIUS server.
Update the hardware driver on the computer to the latest code from manufacturer's website.
Verify settings in the supplicant (program on laptop).
When you use the Windows Zero Config supplicant built into Windows:
Verify user has latest patches installed.
Run debugs on supplicant.
On the client, turn on the EAPOL (WPA+WPA2) and RASTLS logs from a command window, Start > Run > CMD:
netsh ras set tracing eapol enable
netsh ras set tracing rastls enable
In order to disable the logs, run the same command but replace enable with disable. For XP, all logs will be located in C:\Windows\tracing.
If you still have no login web page, collect and analyze this output from a single client:
debug client
debug dhcp message enable
debug aaa all enable
debug dot1x aaa enable
debug mobility handoff enable
If the issue is not resolved after you complete these steps, collect these debugs and use the TAC Service Request Tool (registered customers only) in order to open a Service Request.
debug pm ssh-appgw enable
debug pm ssh-tcp enable
debug pm rules enable
debug emweb server enable
debug pm ssh-engine enable packet -
Client dependent objects and client independent objects
Hi Experts,
Is there a way to find which objects are client dependent and which are client independent? Recently, I changed a small GUI settings in testing client and the changes were happened in production also automatically without a transport request, how can it be possible?
How can I identify similar other objects changing whom it impacts other client w/o a transport request?
Kindly share your views on it.
Thanks a lot..
Regards
SaurabhJust small correction to Rahul answer - tables with field defined as data element MANDT are client dependent.
Usualy that field will not be shown in SE16 and SE16N transactions but you will find it's definition in table definition in SE11 - ABAP Dictionary Maintenance transaction, content of this field is visible when clicking on icon
Br,
Mario -
I need to run multiple external programs concurrently using RMI objects.
have a web based solutiion which uses a backend machine for some processing. I have a RMI based Java proram running on the backend machine and the web server talks with this backend machine through RMI. Now, on this backend machine, I need to call some external program using Process s = Runtime.getRuntime().exec(....). Since this is a web application, multiple clients will connect at the same time and I need to run this external program for multiple clients at the same time.
Here is what I do. I have a separate RMI object bound to registry for each client that connects to the web server. This RMI object implements runnable interface, since I can't extend this class from Thread (it already extends from UnicastRemoteObject). So each time I call upon a method from this object, only one process gets started and other objects need to wait till this process finishes.
I need to start multiple processes at the sametime so that other clients don't have to wait for this thread to finish.
Please let me know if anybody has any other solution than installing an application server on this backend machine.
Here is my code.
public class iLinkOnlineSession extends UnicastRemoteObject implements Session, Serializable, Runnable
public iLinkOnlineSession(String sessName, String sessId, String rootLogs, String rootWrks) throws RemoteException
setSessionId(sessId);
setName(sessName);
ROOT_LOGS = rootLogs;
ROOT_WORKSPACE = rootWrks;
searchKeys_ = new Vector();
searchObjects_ = new Hashtable();
Thread s = new Thread(this);
s.start();
public void run()
System.out.println("running");
public String checkLogin(String user, String passwd)
String msg = "";
String cmd = "iLinkOnlineLogin";
cmd += " param "+ user + " param " + passwd;
System.out.println("cmd: " + cmd);
try
Runtime run = Runtime.getRuntime();
Process proc = run.exec(cmd); // Call to the external program.
InputStream in = proc.getInputStream();
Reader inp = new InputStreamReader(in);
BufferedReader rd = new BufferedReader(inp);
String line = rd.readLine();
while(line != null)
System.out.println(line);
msg += line;
line = rd.readLine();
int res = proc.waitFor();
}catch(Exception e)
e.printStackTrace();
System.out.println("Msg: " + msg);
return msg;
public String searchObject(String user, String passwd, String param1, String paramVal1, String param2, String paramVal2, String param3, String paramVal3, String relLev, String mfgLoc)
String cmd = "iLinkOnlineSearch";
cmd += " param " + user + " param " + passwd + " param " + getSessionId() + " param " + logFile_ + " param " + param1 + " param " + paramVal1 +
" param " + param2 + " param " + paramVal2 + " param " + param3 + " param " + paramVal3 + " param "
+ relLev + " param " + mfgLoc;
System.out.println("cmd: " + cmd);
try
Runtime run = Runtime.getRuntime();
Process proc = run.exec(cmd); // External program.
InputStream in = proc.getInputStream();
Reader inp = new InputStreamReader(in);
BufferedReader rd = new BufferedReader(inp);
FileWriter out = new FileWriter(resultFile_);
System.out.println("Filename: "+resultFile_);
BufferedWriter wout = new BufferedWriter(out);
String line = rd.readLine();
while(line != null)
System.out.println(line);
wout.write(line);
wout.newLine();
wout.flush();
line = rd.readLine();
int res = proc.waitFor();
wout.close();
if(res == 0)
boolean ret = createResultTable();
if(ret == true)
return GlobalConstants.SUCCESS_MSG;
else
return GlobalConstants.ERROR_MSG;
}catch(Exception e)
e.printStackTrace();
System.out.println("getting results");
return GlobalConstants.ERROR_MSG;
}I guess I don't get it.
RMI servers are inherently multi-threaded, so why are you running separate servers for every client?
Maybe you are looking for
-
My issue is that I can't find a way to have the camera switched off when the app is open and so this means if I want the app open all day to receive calls then the camera is going to be on the whole time. Even if it didn't potentially drain the batte
-
Time Machine won't do incremental backups after I restored my computer
I am using a macbook (2010 version) and operating Lion. I had a problem with my Macbook where it wouldn't log on, even in safe mode, so I restored it using Timemachine. Now that everything is back up and running well I want to keep backing up. But
-
DISPLAY ANY VALUE OF FIELD OR VALUE WITH ALERT MESSAGE
COULD I KNOW THAT HOW CAN WE DISPLAY A VALUE OF A FIELD OR A BIND VARIABLE WITH MESSAGE OF AN ALERT IN FORMS. AN ALERT WICH HAS ALL THREE BUTTON
-
How do I get rid of my neighbors network from interfering with mine
I live in a duplex and suddenly I am picking up my neighbors network as a possible network to use. How can I eliminate his network from showing up? It's slowing my network down. There is a locked lock next to his name in network preferences. Thanks.
-
NEW web browser, Digia @Web
A mobile browser with touch interface based on Qt and WebKit. Browser UI features: Full finger touch UI Accelerated panning Automatic full screen browsing via auto-hiding controls Multiple browser windows Page rotation for portrait and landscape brow