How to create Multiple instances of This SingleTon class
import java.io.*;
import java.util.Properties;
import java.net.URLEncoder;
public class ddd
// declaring variables
static private ddd _instance;
String connectIP;
int connectPort;
String systemID;
String password;
String systemType;
// Constructor with arguments
private ddd()
globalInit();
// method returning the ddd instance.
public static synchronized ddd getInstance()
if (_instance == null)
_instance = new ddd();
return _instance;
// Global initialisations
public void globalInit()
systemID ="XXXXX" ;
password ="XXXXX";
systemType ="Null";
public static void main(String[] args)
ddd sb;
sb = ddd.getInstance();
System.out.println(ddd.getInstance());
Don't cross-post:
http://forum.java.sun.com/thread.jsp?thread=547911&forum=54&message=2669925
http://forum.java.sun.com/thread.jsp?thread=547912&forum=31&message=2669928
Sorry, I can't help but think that this is one of the more foolish questions I've read in a while.
The pattern Singleton means "I only want one of these in a single JVM". If you want multiple instances, or even a restricted number of instances, then rewrite the class (something like this):
public class LimitedEdition
public static final int MAX_EDITIONS = 3;
private static int numEditions;
public static void main(String [] args)
try
if (args.length > 0)
int numEditions = Integer.valueOf(args[0]).intValue();
for (int j = 0; j < numEditions; ++j)
LimitedEdition limited = new LimitedEdition();
System.out.println(limited);
catch (Exception e)
e.printStackTrace();
public LimitedEdition() throws InstantiationException
if (numEditions < MAX_EDITIONS)
++numEditions;
else
throw new InstantiationException("Only " + MAX_EDITIONS + " instances allowed");
public String toString()
return "[ instance # " + numEditions + "]";
Similar Messages
-
How to create multiple instance on same database
Hi ,
I would like to know how to create multiple instance on same database . I know that some people use database configuration assistant to do this but i could not figure out how they did it.
Any how if some one can help me with this and can give me links of this it would be great help for me.
Thank you for reading my problem and helping me !
Amil
please if possible mail me on [email protected]How to create multiple instance?????Do you mean multiple instances on the same database, or multiple databases on the same machine ?
I m new to this field....
Willin to learn a lot about oracle....Then it wouldn't be bad reading a bit of Database Concepts -
How to create multiple instance of Jboss with different port number
Hi all
Please tell me steps to create multiple instance of Jboss with diffrent port number.
I tried with this steps, but it does not work for me.
In conf/jboss-service you will find the binding manager.
<mbean code="org.jboss.services.binding.ServiceBindingManager"
name="jboss.system:service=ServiceBindingManager">
<attribute name="ServerName">ports-01</attribute>
<attribute name="StoreURL">../docs/examples/binding-manager/sample-bindings.xml</attribute>
<attribute name="StoreFactoryClassName">
org.jboss.services.binding.XMLServicesStoreFactory
</attribute>
</mbean>Please help me on this.
Thanks in advanceIt is the name of the website for JBoss. That seems rather obvious to me, and you would have found out for yourself if you had tried it.
Your question is not a Java question and doesn't belong in these forums. It is a JBoss question and you should ask there, or more probably have a look at the JBoss documentation first. -
How to create an instance of a protected class outside the enclosing packag
Hi all,
I have a piece of code like this:
package test;
public class A {
protected class B { }
How to create an instance of B outside the package test ? Could you please give me an example ?
Thanks
Ha ChauThank WirajR for your reply, but in your solution,
you have to create an instance of B inside class A
and pass it outside. I would like to know whetherwe
can create an instance of class B outside thepackage
test. That means I want the instance creation
expression of B appears outside the package test.Can
we do that?
If you want to use a class this way then it shouldn't
be marked protected. I can't see why you don't
just declare it public if that's what it is.
Wouldn't be much point to haveing a protected
modifier if it had no effect, would there?I think there is use for it if you use an interface to filter out the parts you want to give public access to, and keep the part you want to keep protected, protected -
How to create multiple instances within same AS
Ramesh,
I have a unique problem. I might have to create B2B instances for 4 owners. As in BPEL, I can have separate domains for the 4 clients in the same instance; what is the equivalent in B2B?
I have a limited number of CPUs and need to install the instances on the same box and hence trying to be creative yet secure here.
Could you please provide some pointers.
Thanks
ShamikHello Shamik,
Please elaborate your use case. Is this just caters to user management or to really have different domain like bpel for four different users. Please see, b2b do not have the notion of BPEL domain, you might have to install multiple instances of B2B pointing to the same MR.
Rgds,Ramesh -
How to create multiple instances of jboss on same server ?
Hi Friends,
I want to create two servers ( two instances of same server ) running on defferent ports , except default server in jboss.
I do not have any idea, will you please help me?
My server is jboss-4.0.0
e.g. "web" or "business" servers in
/jboss/server/web and
/jboss/server/businessHi Kcounsell,
Thank for your suggestion.
I have put bindingservice-plugin.jar in each server's lib directory.
But still i am getting the exception, because it is not getting the path of "bindings.xml" . I have given the hard coded path here.
Please look into the exception bellow.
How should i mention the path?
OR any other mistake is there?
Regards,
Prashant.
C:\jboss-4.0.0\bin>run -c business
===============================================================================
JBoss Bootstrap Environment
JBOSS_HOME: C:\jboss-4.0.0\bin\\..
JAVA: C:\j2sdk1.4.2_06\bin\java
JAVA_OPTS: -Dprogram.name=run.bat -Xms128m -Xmx512m
CLASSPATH: C:\j2sdk1.4.2_06\lib\tools.jar;C:\jboss-4.0.0\bin\\run.jar
===============================================================================
12:18:20,730 INFO [Server] Starting JBoss (MX MicroKernel)...
12:18:20,730 INFO [Server] Release ID: JBoss [Zion] 4.0.0 (build: CVSTag=JBoss_4_0_0 date=200409200418)
12:18:20,746 INFO [Server] Home Dir: C:\jboss-4.0.0
12:18:20,746 INFO [Server] Home URL: file:/C:/jboss-4.0.0/
12:18:20,746 INFO [Server] Library URL: file:/C:/jboss-4.0.0/lib/
12:18:20,762 INFO [Server] Patch URL: null
12:18:20,762 INFO [Server] Server Name: business
12:18:20,762 INFO [Server] Server Home Dir: C:\jboss-4.0.0\server\business
12:18:20,762 INFO [Server] Server Home URL: file:/C:/jboss-4.0.0/server/business/
12:18:20,777 INFO [Server] Server Data Dir: C:\jboss-4.0.0\server\business\data
12:18:20,777 INFO [Server] Server Temp Dir: C:\jboss-4.0.0\server\business\tmp
12:18:20,777 INFO [Server] Server Config URL: file:/C:/jboss-4.0.0/server/business/conf/
12:18:20,793 INFO [Server] Server Library URL: file:/C:/jboss-4.0.0/server/business/lib/
12:18:20,793 INFO [Server] Root Deployment Filename: jboss-service.xml
12:18:20,793 INFO [Server] Starting General Purpose Architecture (GPA)...
12:18:21,200 INFO [ServerInfo] Java version: 1.4.2_06,Sun Microsystems Inc.
12:18:21,200 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.4.2_06-b03,Sun Microsystems Inc.
12:18:21,200 INFO [ServerInfo] OS-System: Windows XP 5.1,x86
12:18:21,607 INFO [Server] Core system initialized
12:18:24,345 INFO [ServiceBindingManager] Initializing store
12:18:24,345 INFO [ServiceBindingManager] Using StoreURL: file:/C:/binding/bindings.xml
12:18:24,361 WARN [ServiceConfigurator] Failed to apply service binding override
java.io.FileNotFoundException: C:\binding\bindings.xml
at org.jboss.net.protocol.file.FileURLConnection.connect(FileURLConnection.java:71)
at org.jboss.net.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:80)
at java.net.URL.openStream(URL.java:913)
at org.jboss.services.binding.XMLServicesStore.load(XMLServicesStore.java:99)
at org.jboss.services.binding.ServiceBindingManager.initStore(ServiceBindingManager.java:197)
at org.jboss.services.binding.ServiceBindingManager.applyServiceConfig(ServiceBindingManager.java:160)
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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:446)
at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:160)
at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:114)
at org.jboss.system.ServiceController.install(ServiceController.java:200)
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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy4.install(Unknown Source)
at org.jboss.deployment.SARDeployer.create(SARDeployer.java:208)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:889)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:745)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:693)
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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:396)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:293)
at org.jboss.Main.boot(Main.java:151)
at org.jboss.Main$1.run(Main.java:405)
at java.lang.Thread.run(Thread.java:534)
12:18:25,127 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
12:18:25,237 INFO [WebService] Using RMI server codebase: http://synpune0109:8083/
12:18:25,362 ERROR [NamingService] Starting failed jboss:service=Naming
java.rmi.server.ExportException: Port already in use: 1098; nested exception is:
java.net.BindException: Address already in use: JVM_Bind
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:243)
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:178)
at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:382)
at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:116)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:145)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:129)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:275)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:206)
at org.jnp.server.Main.initJnpInvoker(Main.java:286)
at org.jnp.server.Main.start(Main.java:253)
at org.jboss.naming.NamingService.startService(NamingService.java:209)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:416)
at org.jboss.system.ServiceController.start(ServiceController.java:438)
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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:693)
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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:396)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:293)
at org.jboss.Main.boot(Main.java:151)
at org.jboss.Main$1.run(Main.java:405)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
at java.net.ServerSocket.bind(ServerSocket.java:318)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at org.jboss.net.sockets.DefaultSocketFactory.createServerSocket(DefaultSocketFactory.java:79)
at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:615)
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:231)
... 59 more
12:18:25,659 WARN [ServiceController] Problem starting service jboss:service=Naming
java.rmi.server.ExportException: Port already in use: 1098; nested exception is:
java.net.BindException: Address already in use: JVM_Bind
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:243)
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:178)
at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:382)
at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:116)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:145)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:129)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:275)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:206)
at org.jnp.server.Main.initJnpInvoker(Main.java:286)
at org.jnp.server.Main.start(Main.java:253)
at org.jboss.naming.NamingService.startService(NamingService.java:209)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:416)
at org.jboss.system.ServiceController.start(ServiceController.java:438)
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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:693)
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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:396)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:293)
at org.jboss.Main.boot(Main.java:151)
at org.jboss.Main$1.run(Main.java:405)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
at java.net.ServerSocket.bind(ServerSocket.java:318)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at org.jboss.net.sockets.DefaultSocketFactory.createServerSocket(DefaultSocketFactory.java:79)
at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:615)
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:231)
... 59 more
12:18:25,972 ERROR [WebService] Starting failed jboss:service=WebService
java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
at java.net.ServerSocket.bind(ServerSocket.java:318)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at org.jboss.web.WebServer.start(WebServer.java:169)
at org.jboss.web.WebService.startService(WebService.java:296)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:416)
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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:693)
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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:396)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:293)
at org.jboss.Main.boot(Main.java:151)
at org.jboss.Main$1.run(Main.java:405)
at java.lang.Thread.run(Thread.java:534)
12:18:26,207 WARN [ServiceController] Problem starting service jboss:service=WebService
java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
at java.net.ServerSocket.bind(ServerSocket.java:318)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at org.jboss.web.WebServer.start(WebServer.java:169)
at org.jboss.web.WebService.startService(WebService.java:296)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:416)
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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:693)
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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:396)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:293)
at org.jboss.Main.boot(Main.java:151)
at org.jboss.Main$1.run(Main.java:405)
at java.lang.Thread.run(Thread.java:534)
12:18:26,582 ERROR [JRMPInvoker] Starting failed jboss:service=invoker,type=jrmp
java.rmi.server.ExportException: Port already in use: 4444; nested exception is:
java.net.BindException: Address already in use: JVM_Bind
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:243)
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:178)
at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:382)
at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:116)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:145)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:129)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:275)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:206)
at org.jboss.invocation.jrmp.server.JRMPInvoker.exportCI(JRMPInvoker.java:413)
at org.jboss.invocation.jrmp.server.JRMPInvoker.startService(JRMPInvoker.java:335)
at org.jboss.invocation.jrmp.server.JRMPInvoker$1.startService(JRMPInvoker.java:140)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
at org.jboss.invocation.jrmp.server.JRMPInvoker.jbossInternalLifecycle(JRMPInvoker.java:601)
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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:416)
at org.jboss.system.ServiceController.start(ServiceController.java:438)
at org.jboss.system.ServiceController.start(ServiceController.java:438)
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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:693)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAcce -
How to create more instances for this text game. Help please!
Hey guys, so far this code works great, but I'm trying to add more questions and answers to this and I'm having trouble doing that. I've tried using different methods and just going from method to another, but I can't seem to get it to work right. Should I be able to do it with different methods or is there another way I should be doing this?? I also want to add a score to this game as well. Adding points for each correct guess and I searched online trying to find a point to start, but couldn't quite get a hold on it. This is just something that would be cool to add, but isn't necessary if you don't think you can help me out. Thanks for checking this out and for the help!!
public class TextShuffleGame
private CinReader reader;
public TextShuffleGame ()
reader = new CinReader();
public void go ()
System.out.println("");
System.out.println("Welcome to Text Shuffle.");
int tries = 0;
boolean correctGuess = false;
while (correctGuess == false && tries < 5)
System.out.println("What 6-letter word is made up from the letters \"dunops\"?");
String guess3 = reader.readString();
String answer3 = "pounds";
if (guess3.equalsIgnoreCase(answer3))
System.out.println("Hooray! You are correct!");
correctGuess = true;
else
System.out.println("Sorry, Try again!");
tries++;
public static void main(String[] args)
TextShuffleGame thisClass3 = new TextShuffleGame();
thisClass3.go();
}If I understand you correctly, you want to add more words to the program. If so, then create an array or some other Collection to store a bunch of words. Then you need to randomly select a word from the list. Create another method to randomly shuffle the letters and display that instead of hardcoding it. Then when a user types a guess you compare it to the word in the list, once again instead of hardcoding it.
-
How to create multiple instances in Jboss
I have two server folders one for commerce and one for CA in JBoss. Commerce is up and running at 8080. I want to run CA at different port. what are the files I need to change to achieve this.
Any help will be appreciated.Hi 970719,
We can achieve this in two ways:
Approach-1:
Run CIM process and use custom port bindings. This approach is more convenient and suggestible.
Approach-2:
By changing the port bindings in jboss for the specified server.
1. Goto <server folder>\conf\bindingservice.beans\META-INF\bindings-jboss-beans.xml
2. Change the below line
<parameter>${jboss.service.binding.set:ports-01}</parameter>
where
ports-01 is 8180
ports-02 is 8280
ports-03 is 8380
Restart Jboss and you can use the port which you have specified.
--Venkat -
How to open multiple instances in this scenario...
private sub Add()
Try
creationPackage = SBO_Application.CreateObject( _
SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)
'creationPackage.UniqueID = "Form503"
'creationPackage.FormType = "Form503"
'creationPackage.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Fixed
oxmldoc.Load(spath & "\" & "Screen3.srf")
creationPackage.XmlData = oxmldoc.InnerXml
'add the form to the sbo application
oForm = SBO_Application.Forms.AddEx(creationPackage)
oForm.Items.Item("7").Specific.DataBind.SetBound(True, "@VIDS_MGT", "Code")
oForm.Items.Item("8").Specific.DataBind.SetBound(True, "@VIDS_MGT", "Name")
oForm.Items.Item("9").Specific.DataBind.SetBound(True, "@VIDS_MGT", "U_ShelfNumber")
oForm.Items.Item("10").Specific.DataBind.SetBound(True, "@VIDS_MGT", "U_SpaceNumber")
oForm.DataBrowser.BrowseBy = "7"
oForm.Visible = True
Catch ex As Exception
End Try
end subthanx for ur reply....
i tried this code..but not working..plz help me in writing the code
dim formcount as integer = 1
Try
creationPackage = SBO_Application.CreateObject( _
SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)
creationPackage.UniqueID += formcount.ToString
'creationPackage.FormType = "Form503"
'creationPackage.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Fixed
oxmldoc.Load(spath & "\" & "Screen3.srf")
creationPackage.XmlData = oxmldoc.InnerXml
If (oForm.UniqueID = formcount) Then
''''what should i write here...
End If
oForm = SBO_Application.Forms.AddEx(creationPackage)
oForm.Items.Item("7").Specific.DataBind.SetBound(True, "@VIDS_MGT", "Code")
oForm.Items.Item("8").Specific.DataBind.SetBound(True, "@VIDS_MGT", "Name")
oForm.Items.Item("9").Specific.DataBind.SetBound(True, "@VIDS_MGT", "U_ShelfNumber")
oForm.Items.Item("10").Specific.DataBind.SetBound(True, "@VIDS_MGT", "U_SpaceNumber")
oForm.DataBrowser.BrowseBy = "7"
oForm.Visible = True
Catch ex As Exception
End Try -
Hi, All:
I am trying to migrate a application coded by VC++ to TestStand+CVI. This application opens multiple serial com ports and send commands to test targets, and get responses from these targets. The VC++ application creates multiple thread, and every thread create an activeX server instance which is responsible for opening serial port,sending test commands ,and getting response. It works fine as every thread has itsown activeX instance, so data and commands can be handled in the right serial port successfully.
Yet when I works on TestStand, I got problems. I choose parallel model as the process model. I create a activeX object reference with AxtiveX/COM Adapter, and store the reference in a sequence local varialbe. If there is only 1 testsocket, It is OK. But if there are multiple test sockets, and communication between the application and test targets will be directly to the last test target. I try to popup a message within a execution to indicate the value of the activeX object reference, and all of them are identical. But this is not the behavior I want.
So, is it possible to force TestStand to create independent instances of an activeX server? How can I make it work?
ThanksThanks for your comment, Dan.
Yet I do get problems as none of us know how to program an activeX server so that it can be forced to be a single-instance or multiple-instance.
As I mentioned earlier, there is existing application which is written by VC++ can create multiple instances of this activeX server, all I have to do is to create multiple threads, and initiate an instance of this server to contrl multiple test targets.
My colleague said he creates the server with VC++ ATL, and cofigure it to be dual-interface and STA. And in the VC++ application side(client side), I use smart-pointer in threads to create an instance of the server:
IMySerialServer pIMySerialServer;
HRESULT hr = pIMySerialServer.CreateInstance("UUTCmd.MySerialServer");
if(FAILED(hr))
AfxMessageBox("Fail to create instance.");
And then I got multple instances of the activeX server. Every thread can have itsown com port, can send/receive commands indepently. I have no idea how can I make it work on TestStand. Would you show me some reference documents or sample codes?
Thank you
Cipher -
How to create multiple AD instances
Hello Everyone,
I have a requirement to create different resource object for different type of accounts (as recon rule is different for them) under same AD resource. For that i exported the resource object ( AD User--removing dependency), process (AD User) and process form (UD_ADUSER). In resource object i replaced "AD User" with "AD User1" and tried to import it but it gives me error on updating 'RRL' and 'SDC' tables. Same happens for process (Change AD User to AD User1, UD_ADUSER to UD_ADUSER1, Lookup.AD.Configuration to Lookup.AD1.Configuration) and process form (change UD_ADUSER to UD_ADUSER1, AD User to AD User1, tdUD_ADUSER to tcUD_ADUSER1[data object]).
I checked that RRL and SDC tables contains the recon rules and column metadata respectively but i am not able to find out why it is Showing me the error on updating these tables. Does anybody achieved this and what is the best and easiest way to create the multiple instances?
I am just trying to create multiple instances manually here :)Thanks Evolution...i actually missed out this lookup....
Now provisioning is working fine for other resource object also...
I have one more doubts regarding child table...i am using the same child table UD_ADUSRC for this resource object also and when i assigned any group membership thru this child table (in AD User1) it gives me DOBJ.insert failed error. I have checked the tasks (+Add user to group, Remove user from group, update user to group+) and all are referring the correct attrs (as in AD User). There is mapping defined in Resource Object and Process definition for Reconciliation also but recon any user with group membership is also giving me error...
can't we use one child form in two process forms ? any other configuration which i should check?
I am using the same look up for Reconciliation mapping attrs for both the resource objects (AD User and AD User1).... -
How to reference multiple instances of the same Java object from PL/SQL?
Dear all,
I'm experimenting with calling Java from PL/SQL.
My simple attempts work, which is calling public static [java] methods through PL/SQL wrappers from SQL (and PL/SQL). (See my example code below).
However it is the limitation of the public static methods that puzzels me.
I would like to do the following:
- from PL/SQL (in essence it needs to become a forms app) create one or more objects in the java realm
- from PL/SQL alter properties of a java object
- from PL/SQL call methods on a java object
However I fail to see how I can create multiple instances of an object and reference one particular object in the java realm through public static methods.
My current solution is the singleton pattern: of said java object I have only 1 copy, so I do not need to know a reference to it.
I can just assume that there will only ever be 1 of said object.
But I should be able to make more then 1 instance of an object.
To make it more specific:
- suppose I have the object car in the java realm
- from PL/SQL I want to create a car in the java realm
- from PL/SQL I need to give it license plates
- I need to start the engine of a scpecific car
However if I want more then 1 car then I need to be able to refrence them. How is this done?
Somehow I need to be able to execute the following in PL/SQL:
DECLARE
vMyCar_Porsche CAR;
vMyCar_Fiat CAR;
BEGIN
vMyCar_Porsche = new CAR();
vMyCar_Fiat = new CAR();
vMyCar_Porsche.setLicensePlates('FAST');
vMyCar_Porsche.startEngine();
vMyCar_Fiat.killEngine();
END;
Thanks in advance.
Best Regards,
Ruben
My current example code is the following:
JAVA:
===
CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED CODAROUL."RMG/BO/RMG_OBJECT" as package RMG.BO;
public class RMG_OBJECT {
private static RMG_OBJECT instance = new RMGOBJECT();
private String rmgObjectNaam;
private RMG_OBJECT(){
this.rmgObjectNaam = "NonDetermined";
public static String GET_RMGOBJECT_NAAM () {
String toestand = null;
if (_instance == null) {toestand = "DOES NOT EXIST";} else { toestand = "EXISTS";};
System.out.println("instance : " + toestand);
System.out.println("object name is : " + _instance.rmgObjectNaam);
return _instance.rmgObjectNaam;
public static Integer SET_RMGOBJECT_NAAM (String IN)
try
_instance.rmgObjectNaam = IN;
return 1;
catch (Exception e)//catch
System.out.println("Other Exception: " + e.toString());
e.printStackTrace();
return 5;
} //catch
PL/SQL Wrapper:
==========
CREATE OR REPLACE FUNCTION CODAROUL.SET_RMGOBJECT_NAAM(NAAM IN VARCHAR2) return NUMBER AS
LANGUAGE JAVA NAME 'RMG.BO.RMG_OBJECT.SET_RMGOBJECT_NAAM (java.lang.String) return java.lang.Integer';
Calling from SQL:
==========
CALL dbms_java.set_output(2000);
select CODAROUL.GET_RMGOBJECT_NAAM() from dual;
Edited by: RubenS_BE on Apr 6, 2012 5:35 AM
Edited by: 925945 on Apr 6, 2012 5:41 AMYou can do this by manually creating a new iterator binding in your binding tab.
So instead of dragging the VO directly to the page, go to the binding tab, add a new executable iterator binding, and point to that one from your ELs in the page itself. -
In a SQL query whihc has join, How to reduce Multiple instance of a table
in a SQL query which has join, How to reduce Multiple instance of a table
Here is an example: I am using Oracle 9i
is there a way to reduce no.of Person instances from the following query? or can I optimize this query further?
TABLES:
mail_table
mail_id, from_person_id, to_person_id, cc_person_id, subject, body
person_table
person_id, name, email
QUERY:
SELECT p_from.name from, p_to.name to, p_cc.name cc, subject
FROM mail, person p_from, person p_to, person p_cc
WHERE from_person_id = p_from.person_id
AND to_person_id = p_to.person_id
AND cc_person_id = p_cc.person_id
Thnanks in advance,
Babu.SQL> select * from mail;
ID F T CC
1 1 2 3
SQL> select * from person;
PID NAME
1 a
2 b
3 c
--Query with only ne Instance of PERSON Table
SQL> select m.id,max(decode(m.f,p.pid,p.name)) frm_name,
2 max(decode(m.t,p.pid,p.name)) to_name,
3 max(decode(m.cc,p.pid,p.name)) cc_name
4 from mail m,person p
5 where m.f = p.pid
6 or m.t = p.pid
7 or m.cc = p.pid
8 group by m.id;
ID FRM_NAME TO_NAME CC_NAME
1 a b c
--Expalin plan for "One instance" Query
SQL> explain plan for
2 select m.id,max(decode(m.f,p.pid,p.name)) frm_name,
3 max(decode(m.t,p.pid,p.name)) to_name,
4 max(decode(m.cc,p.pid,p.name)) cc_name
5 from mail m,person p
6 where m.f = p.pid
7 or m.t = p.pid
8 or m.cc = p.pid
9 group by m.id;
Explained.
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 902563036
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 3 | 216 | 7 (15)| 00:00:01 |
| 1 | HASH GROUP BY | | 3 | 216 | 7 (15)| 00:00:01 |
| 2 | NESTED LOOPS | | 3 | 216 | 6 (0)| 00:00:01 |
| 3 | TABLE ACCESS FULL| MAIL | 1 | 52 | 3 (0)| 00:00:01 |
|* 4 | TABLE ACCESS FULL| PERSON | 3 | 60 | 3 (0)| 00:00:01 |
PLAN_TABLE_OUTPUT
Predicate Information (identified by operation id):
4 - filter("M"."F"="P"."PID" OR "M"."T"="P"."PID" OR
"M"."CC"="P"."PID")
Note
- dynamic sampling used for this statement
--Explain plan for "Normal" query
SQL> explain plan for
2 select m.id,pf.name fname,pt.name tname,pcc.name ccname
3 from mail m,person pf,person pt,person pcc
4 where m.f = pf.pid
5 and m.t = pt.pid
6 and m.cc = pcc.pid;
Explained.
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 4145845855
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 112 | 14 (15)| 00:00:01 |
|* 1 | HASH JOIN | | 1 | 112 | 14 (15)| 00:00:01 |
|* 2 | HASH JOIN | | 1 | 92 | 10 (10)| 00:00:01 |
|* 3 | HASH JOIN | | 1 | 72 | 7 (15)| 00:00:01 |
| 4 | TABLE ACCESS FULL| MAIL | 1 | 52 | 3 (0)| 00:00:01 |
| 5 | TABLE ACCESS FULL| PERSON | 3 | 60 | 3 (0)| 00:00:01 |
PLAN_TABLE_OUTPUT
| 6 | TABLE ACCESS FULL | PERSON | 3 | 60 | 3 (0)| 00:00:01 |
| 7 | TABLE ACCESS FULL | PERSON | 3 | 60 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - access("M"."CC"="PCC"."PID")
2 - access("M"."T"="PT"."PID")
3 - access("M"."F"="PF"."PID")
PLAN_TABLE_OUTPUT
Note
- dynamic sampling used for this statement
25 rows selected.
Message was edited by:
jeneesh
No indexes created... -
Creating multiple instances of a class in LabVIEW object-oriented programming
How do you create multiple instances of a class in a loop? Or am I thinking about this all wrong?
For instance, I read in a file containing this information:
Person Name #1
Person Age #1
Hobby #1
Hobby #2
Hobby #3
Person Name #2
Person Age #2
Hobby #1
Hobby #2
Hobby #3
Person Name #3
Person Age #3
Hobby #1
Hobby #2
Hobby #3
If I define a Person class with name, age, and an array of strings (for the hobbies), how can I create several new Person instances in a loop while reading through the text file?
FYI, new to LabVIEW OOP but familiar with Java OOP. Thank you!First of all, let's get your terminology correct. You are not creating multiple instances of a class. You are creating Objects of the class.
Use autoindexing to create an array of your class type.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
Multiple instances of a Singleton-Object by updaterule ?
Hi folks,
I'm trying to load > 1 Mio. records from an ODS into another InfoProvider. Every record gets some keyfigures out of a very very expensive table-join.
I tried creating this join in an ABAP-Singleton-Object to reduce uploading-time.
This object holds a private-static attribute 'instance' as a reference to a instance of the object and a public-static 'getInstance()'-method, which returns the 'instance'-value. This method is standard-Singleton-like designed.
Then I created a process-chain with:
- an ABAP-process, which calls the 'getInstance()'-method
of this Singleton.
At the first pass this method calls the constructor and
after that a private method, which creates the join and
holds the result in an internal table.
So the constructor is empty.
- after that the data should be transfered (by an Info-
Package) from the ODS to the other InfoProvider. In some
fields of the update-rule and in the startroutine of
the rule the 'getInstance()'-method of the Singleton is
been called and by this reference to the only (so I
thought) instance some other methods should return a
calculated value out of the join.
So theory .... the startroutine is been called for multiple datapackages (no problem) --- but for every package in the startroutine the 'getInstance()'-method calls the constructor, so I get multiple instances of a Singleton.
The time-gap between the package-calls is > 10 secs., so the static-attribute should been set immediately in the first pass of the 'getInstance()', since the constructor is empty.
Any ideas ???
Bye Ralf-/-
Maybe you are looking for
-
Extract data with reports scripts
<p>Hi,</p><p> </p><p>I try to extract data from a database with the following code.It seems that some information desapeared... Does it come from thecommands in the reports?</p><p>{DECIMAL 3</p><p>SUPMISSINGROWS</p><p>SUPBRACKET</p><p>SUPCOMMAS</p><p
-
Changing the ImageData attribute of a list viewnode..
Hi, I am trying to change the Image Data attribute of a list view node after a user clicks on it. But it just doesnot get reflected in the listview. UpdateFieldFromData()/UpdateWindow() donot do the job either. I could ofcourse clone the node, change
-
??? Links: PDF File Links to Files On CD
Ok I have a CD that automatically opens a PDF page On the PDF page I want 3 links and or buttons to will open files located on a CD How do I create the links/buttons to open the files located on the CD? (I can create a button and link it to a file on
-
Best approach for post-update (Oracle Forms equivalent) operations?
Hi Having scanned all the available literature / blogs / forum posts I can find, I'm not sure of the correct way to proceed here, can anybody advise? I am planning to build a custom OAF page to update rows in a seeded Apps table. After any update via
-
I have my music on an external hard drive. I purchase songs at work - w/ internet access. I can't play them at home because I have no license on that computer. Can i get one without having access to the internet?