Creating instances in Java Papi

Hi all,
Actually,I am a newbie to aqualogic bpm.I have written a papi code in java to get process instances directly from studio workspace.Now, I want to crate process instances in java papi code itself and then getting those instances.I don't know how to do that.Can anybody help please?

Hi Dan,
That's pretty good but it is exposing all methods and that's a WSDL file.. Here is some PAPI-WS code that somebody on some other thread put up.. But it does not work properly.. Do you know what files to import to the JAVA project to make it to work?
import java.net.MalformedURLException;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import com.bea.albpm.PapiWebService.OperationException;
public class CreateInstances {
public static void main(String[] args) throws MalformedURLException, ServiceException, OperationException, RemoteException {
java.net.URL url = null;
org.apache.axis.EngineConfiguration config = null;
com.bea.albpm.PapiWebService.PapiWebServicePortBindingStub binding = null;
com.bea.albpm.PapiWebService.InstanceInfoBean value = null;
//String processId = "/Proceso1";
//String processId = "/ActividadesExternas";
String processId = "/PAPIWS";
String argumentsSetName = "BeginIn";
//Binding
//url = new java.net.URL("http", "localhost", 8686, "/papiws/PapiWebServiceEndpoint");
url = new java.net.URL("http", "localhost", 8585, "/papiws/PapiWebServiceEndpoint");
config = new org.apache.axis.configuration.FileProvider("client_deploy.wsdd");
binding = (com.bea.albpm.PapiWebService.PapiWebServicePortBindingStub) new com.bea.albpm.PapiWebService.PapiWebService_ServiceLocator(config).getPapiWebServicePort(url);
binding.setTimeout(60000);
//Arguments
com.bea.albpm.PapiWebService.ArgumentsBeanArgumentsEntry argumentsBeanArgumentsEntry[] = new com.bea.albpm.PapiWebService.ArgumentsBeanArgumentsEntry[1];
argumentsBeanArgumentsEntry[0] = new com.bea.albpm.PapiWebService.ArgumentsBeanArgumentsEntry();
argumentsBeanArgumentsEntry[0].setKey("entradaArg");
argumentsBeanArgumentsEntry[0].setValue("Instancia creada de forma externa mediante PAPI-WS 2.0");
com.bea.albpm.PapiWebService.ArgumentsBean argumentsBean = new com.bea.albpm.PapiWebService.ArgumentsBean(argumentsBeanArgumentsEntry);
com.bea.albpm.PapiWebService.holders.ArgumentsBeanHolder argumentsBeanHolder = new com.bea.albpm.PapiWebService.holders.ArgumentsBeanHolder(argumentsBean);
//Create instance
value = binding.processCreateInstance(processId, argumentsSetName, argumentsBeanHolder);
System.out.println("Created instance -> InstanceInfo.id = " + value.getId());
Edited by: user8752903 on Oct 28, 2009 8:49 AM

Similar Messages

  • Find sub-instances in Java/PAPI or in FBL in 5.7

    If I have an instance (let's call it "A/1/0") in process A with a subprocess B with a split-N creating 4 more instances, for a total of 6 instances.
    How can I abort (cancel, kill, whatever we want to call it) "A/1/0" AND all of it's corresponding instances in sub-processes and below.
    ...Running 5.7 MP3.
    Thanks,
    Todd

    Hi Todd,
    I think you have to make 2 steps.
    1- Find out which is the child instanceID
    2- Abort the instance and its child (as a result the child copies (created in the splitN will be aborted too)
    How to do it
    1- The instance has a variable called "children" which has the association between the activity and the instance created.
    Eg.
    childrenInstanceId = this.children\["MySubflowActivity"\];
    It seems to be that the children variable is not accessible from PAPI. So, you can create a read-only global activity with instance access that returns (as an output argument) the child instanceID.
    2- That's the simple one, just call the instancesAbort PAPI method.
    Hope this helps,
    Ariel A.
    Edited by: Ariel A. on Mar 5, 2009 12:22 PM

  • Using PAPI to create instance on Enterpise

    Hi.
    I have deployed my process on Enterprise edition with weblogic and oracle.
    I need to know all the libraries required for writing PAPI program to create instance.
    Also anything i should take care of while writing the java program to create instance using PAPI.
    Like. do i need to have weblogic.jar in the classpath. or any other jars.
    Regards
    Right Chord

    Thanks,
    Maybe I didn't explain exactly what I was expecting with the standby database, these steps are what I did, to resolve the issue
    ENABLE THE STANDBY DATABASE TO STARTUP FROM SPFILE
    Step 1: create a newly spfile from the current pfile
    SQL> CREATE SPFILE='C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\SPFILEORCL.ORA' FROM PFILE='C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\INITORCL.ORA';
    Step 2: Rename the INITORCL.ORA TO SAVE_DATE_INITORCL.ORA
    Example: the C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\INITORCL.ORA became
    C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\SAVE_24072007_INITORCL.ORA
    Step 3: delete the former sid created
    C:\ORADIM -delete -sid orcl
    Instance deleted.
    Step 3: Change the Oracle service to start when the OS start
    C:\ ORADIM -new -sid ORCL -SRVC OracleServiceORCL -STARTMODE auto -SRVCSTART system -SPFILE
    Instance created.
    Now When I shutdown the whole system and start it up, the standby database startup. the only thing is that the standby database startup a read-only mode, defautl with oracle 10g this is fine for me, because the MRP is stopped but the log shipping is not stopped.
    So eventhough the system admin shutdown the database server at OS level without letting me know, tha standby should continue receiving archived log files.
    I'll just need to monitore the lop apply process and start it to apply archived log files received
    Thanks

  • How to create and instance of Java Object from an XML Document.

    Hi,
    How can we use a XML Document to create an instance of Java Object and do vice versa ie from the Java Object creating the XML Document.
    XML Document is available in the form of a String Object.
    Are there helper class available to achieve this.
    I need to do this in a Servlet.
    Regards
    Pramod.

    JAXB is part of JavaSE while Xmlbeans claims full schema support and full infoset fidelity.
    If the standard APIs do all that you need well then use them.

  • Error creating instances in Business Process Workspace

    i have the following error:
    oracle.bpm.web.exception.WapiOperationException: Error creating instance for target process Serv_M/Proj_V!76.0*/EV.
    Caused by: BPM-70204
    Exception
    exception.70204.type: error
    exception.70204.severity: 2
    exception.70204.name: Error creating process instance.
    exception.70204.description: Error creating instance for target process Serv_M/Proj_V!76.0*/EV.
    exception.70204.fix: Verify server log to find the problem cause.
    at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:205)
    at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:345)
    at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
    at oracle.bpm.services.instancemanagement.ejb.InstanceManagementServiceBean_sqa2w0_IInstanceManagementServiceRemoteImpl_1036_WLStub.createProcessInstanceTask(Unknown Source)
    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:597)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:85)
    at $Proxy413.createProcessInstanceTask(Unknown Source)
    at oracle.bpm.papi.ora.util.ApplicationExecution11G.beginExecution(ApplicationExecution11G.java:50)
    ... 101 more
    Caused by: ORABPEL-02023
    Cannot activate block.
    failure to activate the block "EV" for the instance "30037"; exception reported is: .
    This error contained the exceptions thrown by the underlying routing system.
    Contact Oracle Support Services. Provide the error message, the composite source and the exception trace in the log files (with logging level set to debug mode).
    Help me please!
    Regards

    Hi Chris
    If you are trying to create a LOV and use that as a parameter, then you need to create LOV as Dynamic Cascading values. Once created then you can use that LOV in the Crystal Reports.    
    This is the best way to get dynamic cascading prompts in Crystal reports.
    Please refer to Business View Admin guide for more information.
    Hope this helps!!
    Regards
    Sourashree

  • Trying to access methods from a .class file by creating instance of class

    Hey all,
    I'm hoping you can help. I've been given a file "Input.class" with methods such as readInt(), readString(), etc. I have tried creating instances of this class to make use of it, but I receive the error "cannot find symbol : class Input".
    If you could help at all, I would greatly appreciate it.
    Here's my code. The first is the base program, the second is the driver.
    import java.util.*;
    public class CarObject
         private String makeType = "";
         private String modelType = "";
         private int yearOfRelease = 0;
         private double numOfMiles = 0.0;
         public void setFilmTitle(String make)
              makeType = make;
         public void setMediaType(String model)
              modelType = model;
         public void setYearOfRelease(int year)
              yearOfRelease = year;
         public void setNumOfMiles(double miles)
              numOfMiles = miles;
         public String getMakeType()
              return makeType;
         public String getModelType()
              return modelType;
         public int getYearOfRelease()
              return yearOfRelease;
         public double getNumOfMiles()
              return numOfMiles;
    The program is used by a rental car company and the object takes on desired attributes.
    import java.util.*;
    public class TestCarObject
         static Scanner keyboard = new Scanner(System.in);
         public static void main(String[] args)
              System.out.println("Please answer the following questions regarding your rental car order.");
              Input carinput = new Input();
              String makeType = carinput.readString("Enter your desired make of car: ");          
              String modelType = carinput.readString("Enter your desired model of car: ");
              int yearOfRelease = carinput.readInt("Enter the oldest acceptable year of release to rent: ");
              double numOfMiles = carinput.readDouble("Enter the highest acceptable number of miles: ");
              System.out.println("Make: " + makeType);
              System.out.println("Model: " + makeType);
              System.out.println("Year: " + makeType);
              System.out.println("Mileage: " + makeType);
    }

    No, I don't know the package name....Is there a way
    to import the Input.class by itself without importing
    the entire packge?
    I tried extending the driver program too...It didn't
    work either...
    Message was edited by:
    BoxMan56How do you know you have a class called Input.class ?
    You got a jar file which contains it ? or just a simple .class file ?
    You have to set the classpath in either case.
    But for the former, you should also need to explicitly telling which package containing the class file you looking for (i.e. Input.class)
    e.g. java.util.Vector which is a class called Vector inside java.util package.
    You don't have to import the whole package, but you should tell which package this class belongs to.

  • Error Installing OFM 11.1.1.1 Creating Instance AS

    HI.
    I have a problem installing OFM11g 11.1.1.1 in Windows XP 32 bits.
    The problem is that in the step 12 of 13, when is "Creating instance AS", the installation crash.
    In the log file, the error is:
    opmnctl start: opmn failed to start.
    "C:\Oracle\Middleware\as_1\opmn\bin\opmn.exe" -M: unexpected exit: code 0
    java.lang.Exception: oracle.as.provisioning.exception.ASProvisioningException
         at oracle.as.install.classic.ca.standard.InstanceProvisioningTask.doExecute(InstanceProvisioningTask.java:218)
         at oracle.as.install.classic.ca.standard.StandaloneTool.execute(StandaloneTool.java:50)
         at oracle.as.install.classic.ca.standard.StandardProvisionTaskList.execute(StandardProvisionTaskList.java:61)
         at oracle.as.install.classic.ca.ClassicConfigMain.doExecute(ClassicConfigMain.java:126)
         at oracle.as.install.engine.modules.configuration.client.ConfigAction.execute(ConfigAction.java:335)
         at oracle.as.install.engine.modules.configuration.action.TaskPerformer.run(TaskPerformer.java:87)
         at oracle.as.install.engine.modules.configuration.action.TaskPerformer.startConfigAction(TaskPerformer.java:104)
         at oracle.as.install.engine.modules.configuration.action.ActionRequest.perform(ActionRequest.java:15)
         at oracle.as.install.engine.modules.configuration.action.RequestQueue.perform(RequestQueue.java:63)
         at oracle.as.install.engine.modules.configuration.standard.StandardConfigActionManager.start(StandardConfigActionManager.java:158)
         at oracle.as.install.engine.modules.configuration.boot.ConfigurationExtension.kickstart(ConfigurationExtension.java:81)
         at oracle.as.install.engine.modules.configuration.ConfigurationModule.run(ConfigurationModule.java:82)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: oracle.as.provisioning.exception.ASProvisioningException
         at oracle.as.provisioning.engine.Config.executeConfigWorkflow_WLS(Config.java:876)
         at oracle.as.install.classic.ca.standard.InstanceProvisioningTask.doExecute(InstanceProvisioningTask.java:214)
         ... 12 more
    Caused by: oracle.as.provisioning.engine.CfgWorkflowException
         at oracle.as.provisioning.engine.Engine.processEventResponse(Engine.java:596)
         at oracle.as.provisioning.fmwadmin.ASInstanceProv.createInstance(ASInstanceProv.java:175)
         at oracle.as.provisioning.fmwadmin.ASInstanceProv.createInstanceAndComponents(ASInstanceProv.java:114)
         at oracle.as.provisioning.engine.WorkFlowExecutor._createASInstancesAndComponents(WorkFlowExecutor.java:521)
         at oracle.as.provisioning.engine.WorkFlowExecutor.executeWLSWorkFlow(WorkFlowExecutor.java:437)
         at oracle.as.provisioning.engine.Config.executeConfigWorkflow_WLS(Config.java:870)
         ... 13 more
    Caused by: oracle.as.provisioning.util.ConfigException:
    Error al crear la instancia de AS asinst_1.
    Cause:
    Fallo en la operación interna: Error in starting opmn server
    Operation aborted because of a system call failure or internal error
    Action:
    Consulte los logs para obtener más información.
         at oracle.as.provisioning.util.ConfigException.createConfigException(ConfigException.java:123)
         at oracle.as.provisioning.fmwadmin.ASInstanceProv._createInstance(ASInstanceProv.java:306)
         at oracle.as.provisioning.fmwadmin.ASInstanceProv.createInstance(ASInstanceProv.java:163)
         ... 17 more
    Caused by: oracle.as.management.opmn.optic.OpticException: Error in starting opmn server
    Operation aborted because of a system call failure or internal error
         at oracle.as.management.opmn.optic.OpmnAdmin.executeCommand(OpmnAdmin.java:255)
         at oracle.as.management.opmn.optic.OpmnAdmin.startOpmnServer(OpmnAdmin.java:87)
         at oracle.as.provisioning.fmwadmin.ASInstanceProv._createInstance(ASInstanceProv.java:251)
         ... 18 more
    progress in calculate progress4
    I don´t any idea what is the problem.
    Thanks.

    Hi Adama,
    you can check the install log first (under Program Files\Oracle\Inventory\Logs) ,If log file appears "PermGen space" error ,then you try to change MEM_ARGS to -Xms512m unger \MidXXX\wlserver_10.3\common\bin\CommEnv.cmd
    Good Luck
    Allen

  • Getting the sub Process instance id through PAPI

    Hi Can anyone suggest me how to get the sub process instance id using PAPI?

    I was only able to figure this out as follows... If you have an InstanceInfo variable (called "instance"), then:
    InstanceEvent[] events = new fuego.papi.InstanceEvent[0];
    events = session.getInstanceEvents(instance.getId());
    for (InstanceEvent event : events) {
    if (event.type == 14) {
    System.out.println("child instance ID is: " + event.eventData);
    I ended up creating a recursive function that would drill down to get sub-sub-...-sub-instance IDs as necessary.
    Todd

  • BPM 10g R3 Java PAPI call to submit Approver action

    Hi
    Can anyone help me with the java-papi code(deployed in different weblogic server) to submit the approver (participant to whom instance is assigned) action like Approve, Reject etc.
    Thanks,
    Vivek

    Hi
    Can anyone help me with the java-papi code(deployed in different weblogic server) to submit the approver (participant to whom instance is assigned) action like Approve, Reject etc.
    Thanks,
    Vivek

  • How to create command line java client

    I have a java servlet FileClient.java and am invoking it thru POST method from the html file. How can I create command line java client so that I can execute this class file from windows command prompt.
    e.g. java FileClient <argument>
    TIA

    > .. there's also a "won't work".
    I could post a sample...I know that you can instantiate and call aservlet,
    or even write your own servlet container - butit's
    still a local instance. He can't invoke his remote
    servlet by calling its class on the client like he
    suggested.HttpURLConnection in main.Only if his Servlet has a main method. Which wouldn't really make it a servlet anymore.
    OP said he wants to invoke it from command-line using
    java -cp . TheServletClass
    He said he has a servlet called FileClient. And he can't invoke a servlet directly that way, without building a wrapper that starts it, making it more than a servlet, and it definitely won't execute on the server. That's my whole point. I never wanted to say you can't write a command-line program that invokes a servlet on a remote server. I do it myself after all.
    I guess I should have expressed myself more clearly.

  • OBIEE 11.1.1.7 is Failing at creating instance step on libclntsh.so

    This is OBIEE 11.1.1.7 installtion on AIX6.1...initial reesponse with Oracle is cheikg xlC and Java versions...and I updated to correct versions as per their notes...
    H4A12[obia] /obia_apps > lslpp -l xlC*
    Fileset Level State Description
    Path: /usr/lib/objrepos
    xlC.aix61.rte 11.1.0.4 COMMITTED XL C/C++ Runtime for AIX 6.1
    xlC.cpp 9.0.0.0 COMMITTED C for AIX Preprocessor
    xlC.rte 11.1.0.4 COMMITTED XL C/C++ Runtime
    xlC.sup.aix50.rte 9.0.0.1 COMMITTED XL C/C++ Runtime for AIX 5.2
    H4A12[obia] /obia_apps > java -version
    java version "1.7.0"
    Java(TM) SE Runtime Environment (build pap6470sr4fp1-20130325_01(SR4 FP1))
    IBM J9 VM (build 2.6, JRE 1.7.0 AIX ppc64-64 Compressed References 20130306_140761 (JIT enabled, AOT enabled)
    J9VM - R26_Java726_SR4_FP1_20130306_1011_B140761
    JIT - r11.b03_20130131_32403ifx1
    GC - R26_Java726_SR4_FP1_20130306_1011_B140761_CMPRSS
    J9CL - 20130306_140761)
    JCL - 20130315_01 based on Oracle 7u13-b08
    H4A12[obia] /obia_apps >
    This is from logs:
    Could not load program sawserver:
    Could not load module /obia_apps/midware/Oracle_BI1/bifoundation/web/bin/libsaworacorefacade643r.so.
    Dependent module libclntsh.so could not be loaded.
    Could not load module libclntsh.so.
    System error: No such file or directory
    Could not load module sawserver.
    Dependent module /obia_apps/midware/Oracle_BI1/bifoundation/web/bin/libsaworacorefacade643r.so could not be loaded.
    Could not load module .
    During the install I did get error messages for libclntsh.so and libclntsh.a when doing the enterprise install...but I continue with it and and duirngthe configuration stage it failed at creating instance throwing the above error.
    Any suggestions f=greatly appreciated

    Hi RM
    but $ORACLE_HOME is set by OBIEE11.1.1.7 installation right??...you can see in the $LIBPATH you will see Oracle clint libs
    this is my env...
    H4A12[obia] /obia_apps/oraInventory/logs > set
    AIXTHREAD_COND_DEBUG=OFF
    AIXTHREAD_GUARDPAGES=4
    AIXTHREAD_MNRATIO=1:1
    AIXTHREAD_MUTEX_DEBUG=OFF
    AIXTHREAD_RWLOCK_DEBUG=OFF
    AIXTHREAD_SCOPE=S
    AUTHSTATE=compat
    DISPLAY=10.50.6.157:0
    DISPLAYNAME=H4A12
    EDITOR=/usr/bin/vi
    ERRNO=0
    ESPAGENTDIR=/share2/esp_agent/bin
    FCEDIT=/usr/bin/ed
    HISTCONTROL=ignoredups
    HISTFILE=/home/obiagrp/obia/.sh_hist-ggolkond
    HISTFILESIZE=2000
    HISTSIZE=2000
    HOME=/home/obiagrp/obia
    HOSTNAME=H4A12
    IFS='
    INFA_DOMAINS_FILE=/obia_apps/Informatica/9.0.1/domains.infa
    INFA_HOME=/obia_apps/Informatica/9.0.1
    JAVA_HOME=/usr/java7_64/jre/bin
    LANG=C
    LC_ALL=C
    LC__FASTMSG=true
    LIBPATH=/oracle/app/oracle/product/11.1.jan10/lib:/usr/java7_64/jre/bin:/usr/java7_64/jre/bin/classic:/usr/lib:/lib
    LINENO=1
    LOCPATH=/usr/lib/nls/loc
    LOGFILE=/dev/null
    LOGIN=obia
    LOGNAME=obia
    MAIL=/usr/spool/mail/obia
    MAILCHECK=600
    MAILMSG='[YOU HAVE NEW MAIL]'
    MANPATH='${MANPATH}:/opt/ibm/director/man'
    NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
    NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P15
    ODMDIR=/etc/objrepos
    OLDPWD=/obia_apps/oraInventory
    OPTIND=1
    PATH=/usr/java7_64/jre/bin:/usr/java7_64/jre/bin/bin::/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/home/obiagrp/obia/bin:/usr/bin/X11:/usr/java7_64/bin:/usr/java7_64/jre/bin:/usr/local/bin/xlc:/sbin:.:/usr/local/bin
    PPID=12517554
    PS1='$HOSTNAME[$LOGNAME] $PWD > '
    PS2='> '
    PS3='#? '
    PS4='+ '
    PWD=/obia_apps/oraInventory/logs
    RANDOM=7478
    SAVEHIST=2000
    SECONDS=11916
    SHELL=/usr/bin/ksh
    TERM=xterm
    TERM_DEFAULT=lft
    TMOUT=3600
    TMP=/obia_apps/tmp
    TMPDIR=/obia_apps/tmp
    TZ=EST5EDT
    USER=obia
    _=oraInstall2013-04-25_08-24-30AM.out
    Thanks

  • Acessing objects created by another java program

    ok ill give a higher level view of the problem.....
    i think this is a fundamental problem
    I have 3 java programms which take information and store it. all the type of information is the same so I created a class DataStructure....just to store information. this class i put in a package DataStruts and i call the class in the java programs by " import DataStruts.* ; "
    In the java prog. i create instances of DataStructure like
    eds = new DataStructure();
    in the first java prog i create an instance "eds", in 2nd "ads" and in third "pds".
    now in third prog i want to print all the information so i try to retrieve the data stored in the objects "eds" and "ads" by the previous 2 java programs.
    however the third prog does not recognise the variables eds and ads. i think this is because their instances have been created by the first 2 java programs.
    how do i make these instances of DataStructure available to the last program.??plese let me know.
    thankyou in advance.

    Can someone help me make the connection between the
    statements
    I thought a class's public methods were available
    to any other class that has access to the first
    class.
    and
    They are, but only to code running in the same
    VM.
    The first means that when you're writing a program, if class Foo has a bar() method that's declared public, then the compiler will allow you to call bar() on an in instance of a Foo. That's all it means.
    The second means that if I start two different VMs (two separate Java program's) the publicness that made it legal to call Foo's bar() doesn't automagically give the first program a way to know about or see or call a Foo's bar() in the second one.

  • Coldfusion create instance of class from data element when cosuming a webservice

    I am calling the following wsdl via cfobject https://services-staging.labcorpsolutions.com/webservice/services/LabcorpOTS/wsdl/LabcorpO TS.wsdl
    I am attempting to call the following method registerDonor(java.lang.String, java.lang.String, com.labcorp.ots.ws.data.CreateRegistrationRequest) which references the CreateRegistrationRequest data element.
    I haven't been successful in creating an instance of the CreateRegistrationRequest class and setting values of its members, as well as the Phone class which is also a data element.
    Any assistance would be greatly appreciated in creating instances of methods located in the targetNamespace="http://data.ws.ots.labcorp.com" of the wsdl.
    Thanks

    Thanks for the explanation and example. At first, I didn't understand what you were getting at, but after reading "Using Top-Level Containers" and "How to Use Root Panes" java tutorials it made much more sense. Unfortunately, the books I've read up to this point, did not cover those topics at all. The books simply stated that the first step in creating a Swing gui was to extend the JFrame, or JApplet, or etc.
    Unfortunately, my original problem persists. I continue to get compile-time errors such as:
    TestUserInterface.java:5: cannot find symbol
    symbol: class UserInterface
    location: class projects.web.TestUserInterface
                          UserInterface ui = new UserInterface(); Anyone know why?
    Both the classes are in the same named packaged. Below is my code:
    package projects.web;
    import java.awt.*;
    import javax.swing.*;
    public class UserInterface extends JFrame{
         JPanel menuPanel = new JPanel();
         JPanel contentPanel = new JPanel();
         JPanel selectionPanel = new JPanel();
         JButton save = new JButton("Save");
         JButton addFiles = new JButton("Add");
         public UserInterface(){
         super("File Upload");
         setSize(500, 500);
         menuPanel.add(addFiles);
         selectionPanel.add(save);
         setLayout(new BorderLayout());
         add(menuPanel, BorderLayout.NORTH);
         add(contentPanel, BorderLayout.CENTER);
         add(selectionPanel, BorderLayout.SOUTH);
         } // end constructor
    } // end UserInterface class
    package projects.web;
    public class TestUserInterface{
         public static void main(String[] args){
              UserInterface ui = new UserInterface();
    } // end TestUserInterface class

  • Javax.xml.registry.JAXRException: Failed to create instance of: null

    Friends,
    I don't understand why this error is coming :-
    javax.xml.registry.JAXRException: Failed to create instance of: null
    at javax.xml.registry.ConnectionFactory.newInstance(ConnectionFactory.java:75)
    at JAXRFindBusiness.doQuery(JAXRFindBusiness.java:46)
    at JAXRFindBusiness.main(JAXRFindBusiness.java:28)
    Caused by: java.lang.NullPointerException
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at javax.xml.registry.ConnectionFactory.newInstance(ConnectionFactory.java:70)
    ... 2 more
    Please help
    Thanks
    Vishal

    Please describe in more detail at which circumstances this error appears? It's not completely clear from the stack trace.

  • Help! How to convert an instance from java.lang.Object to a particula class

    * How to convert an instance from java.lang.Object class to a particular class
    witch is known only at the running time?
    Roster EJB component is make up of RosterHome, Roster and RosterBean.
    RosterHome is the home interface of Roster EJB.
    Roster is the remote interface of Roster EJB.
    RosterBean is the implement of Roster EJB.
    The following code segment is to invoke Roster EJB component.
    String jndiName="roster.RosterHome";
    javax.naming.Context initial = getInitialContext();//getInitialContext() returns a instance of Context.
    Object objref = initial.lookup(jndiName);
    RosterHome home =
    (RosterHome)javax.rmi.PortableRemoteObject.narrow(objref,
    RosterHome.class);
    Roster myRoster = home.create();
    String team="T1"
    String player="Tom"
    myRoster.addPlayer(player,team);
    But, now, all the home interface, the remote interface and the JNDI Name of
    Roster EJB component are not been known at the compiling time. However They are
    known at the running time, throught reading from the XML config file.
    Questions:
    1,How to write code for this case ? or
    2,How to convert an instance from Object class to a particular class witch is known
    only at the running time?
    String jndiName="roster.RosterHome";// in fact, reads from XML file.
    String homeClassName="roster.RosterHome";// in fact, reads from XML file.
    String remoteClassName="roster.Roster";// in fact, reads from XML file.
    javax.naming.Context initial = getInitialContext();//getInitialContext() returns a instance of Context.
    Object objref = initial.lookup(jndiName);
    Object objHome= javax.rmi.PortableRemoteObject.narrow(objref,
    Class.forName(homeClassName));
    /* how to do next?
    }

    I am not sure what you are trying to do. But at some point you should know which methods to call on the remote interfaces. Maybe the method names are stored in the XML file as well or you have a set of standard method names (also consider parameters).
    However, this can be solved by reflection. Look at the java.lang.reflect package, especially java.lang.reflect.Method, and also at java.lang.Class.
    If you are doing this on the app server:
    I've seen posts where people say that reflection is not permitted in EJB, but I don't think so. Check the EJB spec.
    If you are doing this in an application: reflection is always permitted. Probably also in applets and JSP.

Maybe you are looking for