Create object given by a string

Hi,
I have a small problem again. Does anybody know how to instantiate an object only knowing the class name? This class name is given at runtime by a String. Does there exist a possibility without reflection?
Greetings.

Class.forName()I think this is reflection... I do not want
reflection :-)Then you can't do what you want for the general case. You'll have to use a series of if statements, or a Map to select from a hardcoded list of classes.
Also, note that, to do it this way, the class must have a public no-arg constructor. You can invoke other ctors using java.lang.reflect.Constructor, but that's reflection too.

Similar Messages

  • Create object name using a String variable

    Hi,
    I�m making a jsp page and I need to add several objects to a vector. The vector's name is arrayGrupo, and the object is Grupo. The problem is that when I create the instance of the object, I cant �give him different names, so the add in the Vector will always be of the same object instance. Is there anyway to create an object name using a variable?
    Something like this:
    <% if (request.getParameter("grupoNome") != null ) {
                                       nomeG=request.getParameter("grupoNome");
                                       descG=request.getParameter("grupoDesc");
                                       int nG=arrayGrupo.getTamanho(); //size of the array
                                       String xpto=String.valueOf(nG);
                                       Grupo "xpto"= new Grupo(); //here is the problem
                                       xpto.setNomeGrupo(nomeG);
                                       xpto.setDescricao(descG);
                                       xpto.setIdgrupo(arrayGrupo.getTamanho()+1);
                                       arrayGrupo.addGrupo(xpto);
    }%>
    Thanks
    Rui Gon�alves

    I want to show a list of objects that are stored in a vector. But I also want to add objects to that vector. If I just want to add one object, I can use this code:
    <% if (request.getParameter("grupoNome") != null ) {
                                       nomeG=request.getParameter("grupoNome");
                                       descG=request.getParameter("grupoDesc");
                                       Grupo newGrupo = new Grupo(nomeG,descG,arrayGrupo.getTamanho()+1);
                                       arrayGrupo.addGrupo(newGrupo);
    %>
    What should I do if I want to add more than one object to the vector?
    I don�t know if I made myself clear but is quite hard to explain my problem.
    Thanks

  • XML Parsing and creating objects..

    I need to create objects with the value present in the XML file under a specific tag.
    E.g.:
    XML file:
    <employees.
    <employee>
    <name>
    <first>Chandan</first>
    <last>Sharma</last>
    </name>
    <empid>1212</empid>
    <dept>Telecom</dept>
    </employee>
    <employee>
    <name>
    <fitst>First</first>
    <last>Last</last>
    </name>
    <empid>100</empid>
    <dept>Dept</dept>
    </employee>
    </employees>
    There may be tags other than <employees> in the XML file.
    I need to parse this file and create objects of class
    Employees{
    String firstName,lastName,empid,dept;
    Please help me.
    As I am new with this, it would be better if you provide me some with code.
    Thanks & Regards,
    Chandan Sharma

    You can od it using SAX of course but the implementation is completely different. As I haven't used any SAX approach for many years, I can't provide you any example but you should find many of them either with google or by downloading any java implementation (like Xerces, Xalan...)
    The better solution depends on your needs. That's the standard answer, I know :)
    when you use DOM, you load the entire content of the file in the memory. and then you travel through the JAVA structure that has been created by using the methods I gave you.
    When you use SAX, you define a listener for your parser that will be called any time the parser finds something interesting. a new node, a new attribute, a new node content... sometimes it's a pain to implement.
    In my opinion if your application will only handle one message at a time, you should keep the DOM approach because I don't think there will be any big difference in time processing. On the other hand if your application will potentially manage multiple messages at the same time, then your computer memory can be overloaded by a DOM approach and the you will face bad performances, in such case use the SAX approach.
    as a conclusion, the best way to make a decision is to run benchmarks. good luck :)
    Marc

  • Use Granfeldts Create Object to create dynamic groups

    Trying to use Sorens Granfeldts, Create Object WF activity to create dynamic groups.
    In a standard function evaluator activity I generate the Filter as [//WorkflowData/Filter]
    The "string" I set it to is:
    &lt;Filter xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; Dialect=&quot;http://schemas.microsoft.com/2006/11/XPathFilterDialect&quot; xmlns=&quot;http://schemas.xmlsoap.org/ws/2004/09/enumeration&quot;&gt;/Person[ObjectID
    = /*[ObjectID = &apos;8dfcb5e8-ff01-400c-8ca7-2a0002d2d2d4&apos;]/ComputedMember]&lt;/Filter&gt;
    In the CreateObject activity I then just have [//WorkflowData/Filter],Filter among the initial values.
    The creation works if I remove this attribute so the rest of the attributes seems to be working.
    The creation fails however end I get the error below in the Forefront Identity Manager event log.
    System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.ResourceManagement.WFActivities.Resolver.GetDisplayStringFromGuid(Guid id, String[] expansionAttributes)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ReplaceGuidWithTemplatedString(Match m)
       at System.Text.RegularExpressions.RegexReplacement.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat)
       at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator)
       at Microsoft.ResourceManagement.WFActivities.Resolver.GetStringAttributeValue(Object attribute)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ResolveEvaluatorWithoutAntiXSS(String match, ResolverOptions resolveOptions)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ResolveEvaluatorForWithAntiXSS(String match, ResolverOptions resolveOptions)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ReplaceMatches(String input, Boolean useAntiXssEncoding, ResolverOptions resolveOptions)
       at Microsoft.ResourceManagement.Workflow.Hosting.ResolverEvaluationServiceImpl.ResolveLookupGrammar(Guid requestId, Guid targetId, Guid actorId, Dictionary`2 workflowDictionary, Boolean encodeForHTML, String expression)
       at Microsoft.ResourceManagement.Workflow.Activities.ResolveGrammarActivity.Execute(ActivityExecutionContext executionContext)
       at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
       at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
       at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
       at System.Workflow.Runtime.Scheduler.Run()
    Have anyone used this WF activity to create dynamic groups and can tell how to set the Filter?

    Hey Kent!
    I did the same thing, with Søren`s Create Object WF. I did it like this on the filter part:
    <Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Dialect="http://schemas.microsoft.com/2006/11/XPathFilterDialect" xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration">/Person[(Department = '[//Target/ObjectID]')]</Filter>,Filter
    The whole thing looks like this:
    (I use Function evaluator to generate a AccountName for groups based on a clean version of DisplayName).
    [//Target/DisplayName],DisplayName
    SEC_[//WorkFlowData/CleanAccountName],AccountName
    [//Target/Manager],Owner
    Security,Type
    DOMAIN_STRING,Domain
    Universal,Scope
    [//Target/DisplayName]_SecGroup,Description
    [//Target/Manager],DisplayedOwner
    None,MembershipAddWorkflow
    True,MembershipLocked
    [//Target/CleanAccountName],MailNickname
    <Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Dialect="http://schemas.microsoft.com/2006/11/XPathFilterDialect" xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration">/Person[(Department = '[//Target/ObjectID]')]</Filter>,Filter
    Regards, Remi www.iamblogg.com

  • How to create object by getting class name as input

    hi
    i need to create object for the existing classes by getting class name as input from the user at run time.
    how can i do it.
    for exapmle ExpnEvaluation is a class, i will get this class name as input and store it in a string
    String classname = "ExpnEvaluation";
    now how can i create object for the class ExpnEvaluation by using the string classname in which the class name is storted
    Thanks in advance

    i think we have to cast it, can u help me how to cast
    the obj to the classname that i get as inputThat's exactly the point why you shouldn't be doing this. You can't have a dynamic cast at compile time already. It doesn't make sense. Which is also the reason why class.forName().newInstance() is a very nice but also often very useless tool, unless the classes loaded all share a mutual interface.

  • SBO2004A: Runtime Error 429 ActiveX Component can't Create Object

    Hello,
    We have an Addon developed with VB6 that run without problems with SBO 6.5.
    We have upgraded to SBO2004A and I have referenced in the source code to the 2004 UI and DI. I debug mode (from IDE) we don't have problems, but when I try to execute the addon from a client, I get this error message:
    <b>Runtime Error 429 ActiveX Component can't Create Object</b>
    Thanks in advance
    Blas

    I'm using Installshield 10.5 to generate the setup file. It's much more easy and not requiered to install Framework 1.1 in each PC client before to install the Addon.
    You have to create and msi project, and write the Installscript to retrieve the install directory from parameter string passed by SAP.
    After install you must execute the AddOnInstallAPI.EndInstall to notify SAP:
    #include "ifx.h"
    prototype  LONG AddOnInstallAPI.EndInstall();  
    prototype  LONG AddOnInstallAPI.RestartNeeded();
    // OnFirstUIBefore
    // First Install UI Sequence - Before Move Data
    // The OnFirstUIBefore event is called by OnShowUI when the setup is
    // running in first install mode. By default this event displays UI allowing
    // the end user to specify installation parameters.
    // Note: This event will not be called automatically in a
    // program...endprogram style setup.
    function OnFirstUIBefore()
        number  nResult, nLevel, nSize, nSetupType;
        string  szTitle, szMsg, szOpt1, szOpt2, szLicenseFile;
        string  szName, szCompany, szTargetPath, szDir, szFeatures, szTargetdir;
        BOOL    bLicenseAccepted;
        LIST listID;
    begin     
        nSetupType = COMPLETE;       
        szDir = TARGETDIR;
        szName = "";
        szCompany = "";
        bLicenseAccepted = FALSE;
    // Beginning of UI Sequence
    Dlg_Start:
        nResult = 0;
    Dlg_SdWelcome:
        szTitle = "";
        szMsg = "";
        //{{IS_SCRIPT_TAG(Dlg_SdWelcome)
        nResult = SdWelcome( szTitle, szMsg );
        //}}IS_SCRIPT_TAG(Dlg_SdWelcome)
        if (nResult = BACK) goto Dlg_Start;
    Dlg_SdLicense2:
        szTitle = "";
        szOpt1 = "";
        szOpt2 = "";
        //{{IS_SCRIPT_TAG(License_File_Path)
        szLicenseFile = SUPPORTDIR ^ "License.rtf";
        //}}IS_SCRIPT_TAG(License_File_Path)
        //{{IS_SCRIPT_TAG(Dlg_SdLicense2)
       // nResult = SdLicense2Rtf( szTitle, szOpt1, szOpt2, szLicenseFile, bLicenseAccepted );
        //}}IS_SCRIPT_TAG(Dlg_SdLicense2)
        if (nResult = BACK) then
            goto Dlg_SdWelcome;
        else
            bLicenseAccepted = TRUE;
        endif;
    Dlg_SdRegisterUser:
        szMsg = "";
        szTitle = "";
        //{{IS_SCRIPT_TAG(Dlg_SdRegisterUser)     
       // nResult = SdRegisterUser( szTitle, szMsg, szName, szCompany );
        //}}IS_SCRIPT_TAG(Dlg_SdRegisterUser)
        if (nResult = BACK) goto Dlg_SdLicense2;
    Dlg_SetupType2:  
        szTitle = "";
        szMsg = "";
        //{{IS_SCRIPT_TAG(Dlg_SetupType2)     
       // nResult = SetupType2( szTitle, szMsg, "", nSetupType, 0 );
        //}}IS_SCRIPT_TAG(Dlg_SetupType2)
        if (nResult = BACK) then
            goto Dlg_SdRegisterUser;
        else
            nSetupType = nResult;
            if (nSetupType != CUSTOM) then
                szTargetPath = TARGETDIR;
                nSize = 0;
            endif;  
        endif;
    Dlg_SdAskDestPath2:
        if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SetupType2;
         szTitle = "";
        szMsg = "";
        if (nSetupType = CUSTOM) then
                    //{{IS_SCRIPT_TAG(Dlg_SdAskDestPath2)     
    //          nResult = SdAskDestPath2( szTitle, szMsg, szDir );
                    //}}IS_SCRIPT_TAG(Dlg_SdAskDestPath2)
            TARGETDIR = szDir;
        endif;
        if (nResult = BACK) goto Dlg_SetupType2;
    Dlg_SdFeatureTree:
        if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SdAskDestPath2;
        szTitle = "";
        szMsg = "";
        szTargetdir = TARGETDIR;
        szFeatures = "";
        nLevel = 2;
        if (nSetupType = CUSTOM) then
            //{{IS_SCRIPT_TAG(Dlg_SdFeatureTree)     
           // nResult = SdFeatureTree( szTitle, szMsg, szTargetdir, szFeatures, nLevel );
            //}}IS_SCRIPT_TAG(Dlg_SdFeatureTree)
            if (nResult = BACK) goto Dlg_SdAskDestPath2; 
        endif;
    Dlg_SQLServer:
        nResult = OnSQLServerInitialize( nResult );
        if( nResult = BACK ) goto Dlg_SdFeatureTree;
    Dlg_ObjDialogs:
        nResult = ShowObjWizardPages( nResult );
        if (nResult = BACK) goto Dlg_SQLServer;
    Dlg_SdStartCopy2:
        szTitle = "";
        szMsg = "";
        //{{IS_SCRIPT_TAG(Dlg_SdStartCopy2)     
        nResult = SdStartCopy2( szTitle, szMsg );     
        //}}IS_SCRIPT_TAG(Dlg_SdStartCopy2)
        if (nResult = BACK) goto Dlg_ObjDialogs;
        return 0;
    end;        
    // OnSetTARGETDIR
    // OnSetTARGETDIR is called directly by the framework to initialize
    // TARGETDIR to it's default value.
    // Note: This event is called for all setups.
    function OnSetTARGETDIR()
    number nId, nIgnore, nResult;
    string szId, szTARGETDIR; 
    string wCMDLINE;
    LIST listID;     
    begin     
        // In maintenance mode the value of TARGETDIR is read from the log file.
        if( MAINTENANCE ) then
            return ISERR_SUCCESS;
        endif;
        // Set TARGETDIR to script default.
        TARGETDIR = "<FOLDER_APPLICATIONS>
    <IFX_COMPANY_NAME>
    <IFX_PRODUCT_NAME>";
        if (CMDLINE != "") then 
           wCMDLINE = CMDLINE;   
           StrReplace (wCMDLINE, '"', '', 0);
           listID = ListCreate (STRINGLIST); 
           if (StrGetTokens (listID, wCMDLINE, "|") > 0) then
              MessageBox ("Parametros incorrectos.", SEVERE);
           else
              ListGetFirstString (listID, TARGETDIR);  
              //MessageBox (TARGETDIR, INFORMATION);
           endif;
           ListDestroy (listID); 
           return 0;
        endif;
        // Read TARGETDIR from the media.
        nResult = MediaGetData( MEDIA, MEDIA_FIELD_TARGETDIR, nIgnore, szTARGETDIR );
        // Use the TARGETDIR from the media if anything was read.
        if( nResult >= ISERR_SUCCESS && StrLengthChars( szTARGETDIR ) ) then
            TARGETDIR = szTARGETDIR;
        endif;
         // Customize the default TARGETDIR for multi-instance application.
         // TODO: If you want something different customize the code below.     
         if( MAINT_OPTION = MAINT_OPTION_MULTI_INSTANCE  && MULTI_INSTANCE_COUNT > 0) then
              // Start with the current multi-instance count plus one.
              nId = MULTI_INSTANCE_COUNT + 1;
              // Find a unique TARGETDIR.
              while( ExistsDir( TARGETDIR ) = EXISTS )
                   // Convert to string.
                   NumToStr( szId, nId );
                   // Update IFX_MULTI_INSTANCE_SUFFIX
                   IFX_MULTI_INSTANCE_SUFFIX = "_" + szId;
                   // Update TARGETDIR
                   TARGETDIR = TARGETDIR + IFX_MULTI_INSTANCE_SUFFIX;
                   // Update nId
                   nId = nId + 1;
              endwhile;
         endif;  
    end;
    // OnEnd
    // The OnEnd event is called at the end of the setup. This event is not
    // called if the setup is aborted.
    function OnEnd() 
    string  wCMDLINE;
    LIST    listID;     
    STRING  DLL_FILE;
    INT     nValue;  
    LONG    nRC;
    NUMBER  nResult;
    begin
    if (CMDLINE != "") then
           wCMDLINE = CMDLINE;   
           StrReplace (wCMDLINE, '"', '', 0); 
           listID = ListCreate (STRINGLIST); 
           if (StrGetTokens (listID, wCMDLINE, "|") > 0) then
              MessageBox ("Parametros incorrectos.", SEVERE);
           else
              ListGetFirstString (listID, DLL_FILE);
              ListGetNextString (listID, DLL_FILE);  
              // MessageBox (DLL_FILE, INFORMATION);
           endif; 
           ListDestroy (listID); 
           nResult = UseDLL (DLL_FILE);
           if (nResult != 0) then
              MessageBox ("No se ha podido cargar\nAddOnInstallAPI.dll", SEVERE);
              abort;
           endif;
           if AddOnInstallAPI.EndInstall() > 0 then
              MessageBox ("Error al ejecutar AddOnInstallAPI", SEVERE);
              abort;
           endif;
    endif;
    end;

  • Creating objects and efficiency

    I am implementing bounding circles for my game and I have a question. I have heard that creating a new object takes up a lot of time (i.e doing it every update). Should I give each of my objects a BoundingSphere instance variable (I created my own simple BoundingSphere class), update it's position every update along with the sprite, or should I remove the instance variable and just return a new BoundingSphere when it is requested?
    Just to clarify:
    Implementation 1:
    private BoundingSphere s;
    public BoundingSphere getBoundingSphere() {
       return s;
    //update s each time sprite is updatedImplementation 2:
    //no private instance variable
    public BoundingSphere getBoundingSphere() {
       return new BoundingSphere(radius, x, y);

    If you know a maximum bound on how many of the created objects you'll need at any given time, you can prevent lots of object creation by implementing an object pool. The pool keeps a list of pre-constructed objects, and to use it, a method may request an object, use a method to initialize its values (not a constructor), then release it back to the pool when it is done using it. This is usually done with Threads to limit the number of them running, but it can be done with any object.
    I hope this helps
    -JBoeing

  • Creating objects with proper stereotypes

    Hi,
    I'm just trying to create Architecture Areas and Business Functions using VB. This all works as expected, besides of one small but important exception:
    I want to create Architecture Areas and Business Functions of a given type (Stereotype).
    When I create the Architecture Area or Business Function, assign the code and name, and then set the Stereotype, everything looks OK. The Stereotype is appearing on the symbol etc., but ... the graphical symbol differs from what we have configured for this element.
    In the script I'm doing it this way:
    L2Process = EamL2.ArchitectureAreas.CreateNew(PdEam.cls_ArchitectureArea)
    L2Process.SetNameAndCode Trim(L3SubSubFolder.Name), Trim(L3SubSubFolder.Code)
    L2Process.Stereotype = "Process"
    The Architecture Area is created, the Stereotype is assigned:
    But the graphical symbol is not the expected one, it"s rather the "default" one ...
    What I have configured is:
    Is there a way to create Architecture areas and Business Functions, so that the configured Custom Symbols are used? MAybe a parameter for CreateNew like in the CreateModel function, where we can set the Diagram Type?
    CreateModel(PdEAM.cls_Model, EvaluateNamedPath("%_MODELS%") + L3SubSubFolder.Name + ".eam" + "|" + "Diagram=CityPlanningDiagram", omf_DontOpenView)
    I can't find anything in the documentation in regards to this issue...
    Thanks,
    Rafal

    Hi Rafal,
    Could you try creating object directly in the collection using the GetCollectionBySteretype("Process") on model ?
    Something like:
    Dim processes
    Set processes = EamL2.GetCollectionByStereotype("Process")
    Set L2Process = processes.CreateNew()
    L2Process.SetNameAndCode Trim(L3SubSubFolder.Name), Trim(L3SubSubFolder.Code)
    This should assign stereotype at initialization and may be fix your issue...
    Marc
    PS. I did not check code, take care of potential typo.

  • ClassNotFoundException when creating objects

    Hi, am am pretty new to using java reflection and all that stuff - so this could be a fairly obvious question.
    I am using reflection to create objects whose names are only known at runtime. The method is as follows:
        public static IGene getRandomGene(Vector genes){
            int size = genes.size();
            int rndOp = (int)Math.floor(Math.random() * size);
            String newClassName = (String)genes.get(rndOp);
            IGene newGene = null;
            try {
                Class geneDefinition = Class.forName(newClassName);
                Constructor cons = geneDefinition.getConstructor(new Class[0]);
                newGene = (IGene)GeneUtils.createObject(cons, new Object[0]);
            } catch (ClassNotFoundException e) {
                System.out.println(e); //And the ClassNotFoundException is encountered
            } catch (NoSuchMethodException e) {
                System.out.println(e);
            return (OperatorGene)newGene;
        }The name of the class to be created (newClassName) is found fine.
    My includes are:
    package simplegp;
    import java.util.Vector;
    import java.lang.reflect.*;
    import simplegp.operandGenes.*;
    import simplegp.operatorGenes.*;
    import simplegp.operatorGenes.doubleOps.*;
    import simplegp.operatorGenes.singleOps.*;These includes definatly cover the classes to be included.
    Am i maknig a silly mistake? I cannot fingure it out.
    Many thanks for any help
    Adam
    PS. The code is for some evolutionay programming, hence havnig Genes

    I seem to have solved the problem - sorry for not searching the forums first.
    I had to specify the class names as:
    simplegp.operandGenes.IntOperandGene
    Rather than just: IntOperandGene
    adam

  • Create Object of "ObjectName" Class by giving only Domain Name.

    Hie,
    I want to create Object of "ObjectName" class without specifying its key value properties, but i want to only specify the domain name.
    For eg:
    ObjectName on=new ObjectName("jboss.ws4ee:*"); here jboss.ws4ee is the domain name and after colon(:) will come the key value properties.. i dont want to specify that because i want the list of all mbeans coming under this domain i.e. jboss.ws4ee
    So anyone can plzzz help me..
    Regards.

    Hi,
    What were you trying to do with that name?
    ObjectName on=new ObjectName("jboss.ws4ee:*");
    You cannot create an MBean with such an ObjectName. You can only
    use it as first argument to queryNames() and queryMBeans();
    If you want to get the attributes of all jboss MBeans then you will need to
    do something like that:
    final ObjectName pattern=new ObjectName("jboss.ws4ee:*");
    for (ObjectName o : server.queryNames(pattern,null)) {
        System.out.println("MBean:  " + o);
        for (MBeanAttributeInfo info : server.getMBeanInfo(o).getAttributes()) {
             final String attrname = info.getName();
             System.out.println("\t"+attrname+"="+server.getAttribute(o,attrname));
    }(disclaimer: this code was eyed-compiled)
    hope this helps,
    -- daniel
    JMX, SNMP, Java, etc...
    http://blogs.sun.com/jmxetc

  • Create Object menu not appearing

    For a particular group I have given the Create Subportal activity right and even though they can get to the Subportal Manager section they're not getting the Create Object from where they should be able to create subportals. Any ideas?

    Hi
    Your description is a bit vague - but here's something you
    can try
    If your using Text inside a MovieClip then you need to Embed
    the Font.
    Select your text and click the Embed button on the Components
    Panel - select all the Characters that are likely to appear in your
    text. Save and Run - See if there's a difference.
    Check your Alpha also you never know.
    Hope it helps

  • Error starting Web Start App: automation server cannot create object

    When starting Web Start Application without java installation just by starting javaws xyz.jnlp in Windows2000 there comes 2 times the Error Message "Microsoft JScript: automation server cannot create object", but the application starts nevertheless.
    Where does this error come from?
    How can we avoid it?

    see:
    http://forum.java.sun.com/thread.jspa?threadID=639218&tstart=10
    this dialog is thrown from the IE javascript engine when Java Web Start tries to invoke it to resolve the correct proxy for a given URL using the configured PAC file.
    /Andy

  • Cannot create object CrystalEnterprise.PSReportFactory.

    Hello,
    I'm getting the following error when I try to obtain the PSReportFactory:
         Cannot create object CrystalEnterprise.PSReportFactory.
    I am using BusinessObjects XI R2 .Net sdk and Visual Studio 2005. I am also connecting to Crystal Reports Server 2008. Here is my code:
    static EnterpriseSession ceSession;
    EnterpriseService ceEnterpriseService;
    ceEnterpriseService = ceSession.GetService("PSReportFactory");
    Object serviceAsObject = ceEnterpriseService.Interface;
    PSReportFactory psReportFactory = (PSReportFactory)serviceAsObject;
    int reportIDAsInteger= Convert.ToInt32(ReportId);
    ReportSource reportSource = psReportFactory.OpenReportSource(reportIDAsInteger);   
    ISCRReportSource iscrReportSource = reportSource;   
    return iscrReportSource;
    The error occurs at the following line:
          ceEnterpriseService = ceSession.GetService("PSReportFactory");
    Thanks for your help,
    koko1313

    I solved this issue by installing all the Developer Components from the Crystal Reports XI R2 disk.  I had previously installed only the sdk for BusinessObjects XI R2 .Net sdk for .net 2.
    Now when I run my application, I get an "Object reference not set to an instance of an object." error in the viewer.  I tried adding a virtual directory in iis pointing to the crystalreportviewer115 folder. But this has not helped. 
    Is there something else that I should be installing in my deployment? I have tried everything I could find on various forums, but nothing works.
    Also, I have simplified my code and removed the creation of the PSReportFactory. Here is what I have now:
    static EnterpriseSession ceSession;
    EnterpriseService ceEnterpriseService;
    ceEnterpriseService = ceSession.GetService("", "InfoStore");
    ceInfoStore = new InfoStore(ceEnterpriseService);
    string sQuery = "Select * From CI_INFOOBJECTS Where SI_PROGID = 'CrystalEnterprise.Report' AND SI_ID=" + reportId;
    ceReportObjects = ceInfoStore.Query(sQuery);
    if (ceReportObjects.Count > 0)
           ceReportObject = ceReportObjects[1];
    CrystalReportViewer1.ReportSource = ceReportObject ;
    This code was working when I used the Crystal Reports .NET sdk for Visual Studio 2005...
    Thanks again,
    koko1313

  • Getting an Exception Unable to create Object

    I have the following methos I am getting the unable to create the file exception
    I believe the problem is when is trying to read the object I try the following
    record.setMessage(input.readObject().toString());
              ///  record = (Message)input.readObject();1) convert the object to a string
    record.setMessage(input.readObject().toString()); 2) I also try this
    record = (Message)input.readObject()Notice that I put the put the file into the cryptpText area and then I get into a String
    cipherTextString = record.toString();
             //put string in JTextArea
              cipherTextArea.setLineWrap(true);
              cipherTextArea.setText(cipherTextString); Here is the setMessage Method in the Message class
    set
    public void setMessage(String eMessage)
         myMessage = eMessage;
    public void performStartTask()
            //choose the file to open
            int returnVal;
            String inputFileName = "";
            //open a JFileChoose
            JFileChooser chooser = new JFileChooser(new File (
                    "C:\\Java_code\\java_files"));
            chooser.setDialogTitle("Please select an encoded file");
            returnVal = chooser.showOpenDialog(null);
            if(returnVal == JFileChooser.APPROVE_OPTION)
                inputFileName = chooser.getSelectedFile().getName();
            //Open the file
            ObjectInputStream input  = null;
            //exception handlig here
            try
                input = new ObjectInputStream( new FileInputStream("C:\\Java_code\\java_files\\" + inputFileName));
              catch (IOException e)
                  System.err.println("error opening the file");
              //read from the file
            record = null;
            record = new Message();
            try
               record.setMessage(input.readObject().toString());
              ///  record = (Message)input.readObject();
             catch(EOFException eofe)          
                 return;
             catch(ClassNotFoundException cnfe)
                      System.err.println("Unable to create Object");
             catch(IOException ioe)
                 System.err.println("Error reading from file ");
             } // end try catch
           System.out.println("Just read in" + record + "." + record.getShift());
             //put the file into the cryptpText area
             //first - get into a string
             cipherTextString = record.toString();
             //put string in JTextArea
              cipherTextArea.setLineWrap(true);
              cipherTextArea.setText(cipherTextString);
             closeFile(input);
              startBoolean = true;
        } // End of performedStartMethod 

    Ok I added this piece of code, hope is right
    catch (Exception e) {
              StackTraceElement[] stack = e.getStackTrace();
                String exception = "";
               for (StackTraceElement s : stack) {
            exception = exception + s.toString() + "\n\t\t";
        System.out.println(exception); anf it shows that the error is here
    record.setMessage(input.readObject().toString());
    java.net.URLClassLoader$1.run(URLClassLoader.java:366)
              java.net.URLClassLoader$1.run(URLClassLoader.java:355)
              java.security.AccessController.doPrivileged(Native Method)
              java.net.URLClassLoader.findClass(URLClassLoader.java:354)
              java.lang.ClassLoader.loadClass(ClassLoader.java:423)
              sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
              java.lang.ClassLoader.loadClass(ClassLoader.java:356)
              java.lang.Class.forName0(Native Method)
              java.lang.Class.forName(Class.java:264)
              java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:622)
              java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1593)
              java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1514)
              java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)
              java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
              java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
              lab01recheverri.Lab01recheverri.performStartTask(Lab01recheverri.java:172)
              lab01recheverri.Lab01recheverri.actionPerformed(Lab01recheverri.java:103)
              javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
              javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
              javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
              javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
              javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
              java.awt.Component.processMouseEvent(Component.java:6505)
              javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
              java.awt.Component.processEvent(Component.java:6270)
              java.awt.Container.processEvent(Container.java:2229)
              java.awt.Component.dispatchEventImpl(Component.java:4861)
              java.awt.Container.dispatchEventImpl(Container.java:2287)
              java.awt.Component.dispatchEvent(Component.java:4687)
              java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
              java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
              java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
              java.awt.Container.dispatchEventImpl(Container.java:2273)
              java.awt.Window.dispatchEventImpl(Window.java:2719)
              java.awt.Component.dispatchEvent(Component.java:4687)
              java.awt.EventQueue.dispatchEventImpl(EventQueue.java:703)
              java.awt.EventQueue.access$000(EventQueue.java:102)
              java.awt.EventQueue$3.run(EventQueue.java:662)
              java.awt.EventQueue$3.run(EventQueue.java:660)
              java.security.AccessController.doPrivileged(Native Method)
              java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
              java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
              java.awt.EventQueue$4.run(EventQueue.java:676)
              java.awt.EventQueue$4.run(EventQueue.java:674)
              java.security.AccessController.doPrivileged(Native Method)
              java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
              java.awt.EventQueue.dispatchEvent(EventQueue.java:673)
              java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
              java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
              java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
              java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
              java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
              java.awt.EventDispatchThread.run(EventDispatchThread.java:97)
    Just read innull.0

  • FDMEE 11.1.2.3 ActiveX component can't create object

    Hello Gurus,
    I am testing FDMEE 11.1.2.3 and am running into an issue when trying to export to my target HFM application. (Import/Validate work fine). Below is the error log:
    I am loading from a flat file.
    E:\Oracle\Middleware\EPMSystem11R1\products\FinancialDataQuality\bin\HFM_LOAD.vbs(4, 1) Microsoft VBScript runtime error: ActiveX component can't create object: 'erpiHFMAdapter.clsFMAdapter'
    2014-01-02 16:11:03,568 FATAL [AIF]: Error in HfmData.loadData
    Traceback (most recent call last):
      File "<string>", line 106, in loadData
    RuntimeError: Load Error
    2014-01-02 16:11:03,614 FATAL [AIF]: Error in HFM Load Data
    2014-01-02 16:11:03,617 INFO  [AIF]: FDMEE Process End, Process ID: 12

    please follow oracle doc
    FDMEE Validate Step Failing with Intersection Check Enabled (Doc ID 1588419.1)
    cause : Currently the TNSNAMES.ORA file on the FDMEE Server does not contain a connect descriptor entry named AIF_ORCL pointing to the FDMEE database instance. When the intersection check code is being ran for the adapter it is unable to resolve the connect descriptor because it does not exist in the 32 bit TNSNAMES.ORA file.
    Solution : A) Logon to the FDMEE Application Server
    B) Browse to the Oracle\Middleware\EPMSystem11R1\DBClient32\Network\Admin directory
    C) Open the TNSNAMES.ORA file in notepad
    D) Add the following connect descriptor and save:
    AIF_ORCL =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = <DBHOST>)(PORT = <DBPORT>))
      (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = <SERVICE>)
    regards,
    -DM

Maybe you are looking for