Create Instance passing String

Hi,
I have one method which takes up a string parameter.
I need to create an instance of that string. .
could you plz. tell me how to do that..
Thnks in advance.
regards
amj

Err... In your previous postings, you have asked about Weblogic server installation, factories, singletons, Eclipse, Tomcat, HTTP, ...
And now you have forgotten how to pass a string to a method?
Start here: http://java.sun.com/docs/books/tutorial/

Similar Messages

  • Creating instances using a string identifier

    Is there a way to create an instance of a class given it's
    class name as a string( for example). I know I could do it simply
    by using conditional logic, but I'd like this to be extensible and
    don't want to have to keep adding conditions as the system grows.
    In other languages I've used, this is possible in many ways
    and was wondering if there is a way to do this in AS 3.0
    Thanks.

    Thanks for the heads up Ed!
    One way to be ableto get around your issue (not that this
    exists in AS 3.0) is to be able to "register" a class so the
    compiler/linker can link it into the swf and you get compile time
    checking.
    This is the way Delphi allows for this. The C# complier is
    kind of in between in that you are still liable to get a runtime
    error in the case that you creat an instance of a class using (say)
    Activator.CreateInstance() which is the equivalent.
    One way to get around this in AS 3.0 (I think) would be to
    simply declare a variables of the types you intend to create
    instances of dynamically. This should force the linker to link in
    the class definition.
    Of course in both C# and Delphi you can create instances of
    classes unknown to you at complie time. From the looks of it, AS
    3.0 can't do this.

  • Creating Class Instances from Strings

    Folks,
    I have a class called Employee. I would like to create instances of this class based on the user input in certain JTextFields in a form. For instance, if the user inputs First Name = John and Last Name = Doe, then the instance John_Doe of the Employee Class is created. I played w/ newInstance() and Class.forName() but can't seem to get that working. Does this require reflection? I just need someone to point me in the right direction.
    Thanks,
    steve

    Dear jverd (and walken),
    Thanks for your note. I'm sorry, I don't really
    understand what you mean by "is the class determined
    at runtime or just the parameters?"It sounds like walker answered your immediate questions, but just to clear up this (which I guess I didn't state very clearly), what I meant was, will you sometimes be creating an Employee, and sometimes some other class, or will it only be the employee's name, etc., that's different for each one you create?
    If, at the time you're writing your code, you know which class you're creating, then you don't need reflection. You just do new WhateverTheClassIs() (possibly passing parameters, such as names, to the constructor.
    On the other hand, if the class to be instantiated will be determined at runtime--maybe you prompt the user for which class, and he enters "Employee"--then you need to use reflection.
    You shouldn't need to worry about reflection for a while. Get the fundamentals of the language solidly under your belt before you tackle that. Good luck! :-)

  • Passing String Which Has Single Quote Row/Value to a Function Returns Double Quoate

    Hi, I'm getting weird thing in resultset. When I pass String which has single quote value in it to a split function , it returns rows with double quote. 
    For example  following string:
    'N gage, Wash 'n Curl,Murray's, Don't-B-Bald
    Returns:
    ''N gage, Wash ''n Curl,Murray''s, Don''t-B-Bald
    Here is the split function:
    CREATE Function [dbo].[fnSplit] (
    @List varchar(8000), 
    @Delimiter char(1)
    Returns @Temp1 Table (
    ItemId int Identity(1, 1) NOT NULL PRIMARY KEY , 
    Item varchar(8000) NULL 
    As 
    Begin 
    Declare @item varchar(4000), 
    @iPos int 
    Set @Delimiter = ISNULL(@Delimiter, ';' ) 
    Set @List = RTrim(LTrim(@List)) 
    -- check for final delimiter 
    If Right( @List, 1 ) <> @Delimiter -- append final delimiter 
    Select @List = @List + @Delimiter -- get position of first element 
    Select @iPos = Charindex( @Delimiter, @List, 1 ) 
    While @iPos > 0 
    Begin 
    -- get item 
    Select @item = LTrim( RTrim( Substring( @List, 1, @iPos -1 ) ) ) 
    If @@ERROR <> 0 Break -- remove item form list 
    Select @List = Substring( @List, @iPos + 1, Len(@List) - @iPos + 1 ) 
    If @@ERROR <> 0 Break -- insert item 
    Insert @Temp1 Values( @item ) If @@ERROR <> 0 Break 
    -- get position pf next item 
    Select @iPos = Charindex( @Delimiter, @List, 1 ) 
    If @@ERROR <> 0 Break 
    End 
    Return 
    End
    FYI: I'm getting @List value from a table and passing it as a string to split function.
    Any help would be appreciated!
    ZK

    fixed the issue by using Replace function like
    Replace(value,'''''','''')
    Big Thanks Patrick Hurst!!!!! :)
    Though I came to another issue which I posted here:
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/a26469cc-f7f7-4fb1-ac1b-b3e9769c6f3c/split-function-unable-to-parse-string-correctly?forum=transactsql
    ZK

  • 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.

  • How to Create Instances in the Transient Root Node and Sub Nodes from Root Node Query Method ?

    Hi All,
    I am Creating a BOPF BO with 3 Nodes,
    Node 1) ROOT -- > contains a query,
    using Root Node I have created Search UIBB Configuration in FBI.
    In testing -- > when i enter Data in the Search Criteria Fields am able to get the details in to the query method
    from Imporing parameter : 'IT_SELECTION_PARAMETERS'.
    HERE I am fetching data from a standard table and trying to fill the data in the Node : 'MNR_SEARCH_RESULT'.
    How to Append data to the Sub node 'MNR_SEARCH_RESULT' when there is no Node instance created in the ROOT Node ?
    For This  I have created an instance in the ROOT Node and Using that I tried to create Instance in the Sub Node 'MNR_SEARCH_RESULT'.
    Below is my code which i have placed in the Query method ..
    DATA : LR_DATA TYPE REF TO ZBO_S_ROOT1.
    DATA : LR_SEARCH_RES TYPE REF TO ZBO_S_MNR_SEARCH_RESULT.
    DATA : LO_CI_SERVICE_MANAGER TYPE REF TO /BOBF/IF_TRA_SERVICE_MANAGER,
            LO_TRANSACTION_MANAGER TYPE REF TO /BOBF/IF_TRA_TRANSACTION_MGR.
       LO_CI_SERVICE_MANAGER = /BOBF/CL_TRA_SERV_MGR_FACTORY=>GET_SERVICE_MANAGER( IV_BO_KEY = ZIF_BO_TEST_PO_C=>SC_BO_KEY ).
       LO_TRANSACTION_MANAGER = /BOBF/CL_TRA_TRANS_MGR_FACTORY=>GET_TRANSACTION_MANAGER( ).
    CREATE DATA LR_DATA.
    LR_DATA->KEY = LO_CI_SERVICE_MANAGER->GET_NEW_KEY( ).
    LR_DATA->ROOT_KEY   = IS_CTX-ROOT_NODE_KEY.
    LR_DATA->PIPO_MAT_ID = '100100'.
    LR_DATA->PIPO_MAT_DESC = 'MATERIAL'.
    LR_DATA->PIPO_SPRAS = 'E'.
    LR_DATA->PIPO_MATL_TYPE = 'ZPMI'.
    LR_DATA->PIPO_MATL_GROUP = 'ZKK'.
         DATA lt_mod      TYPE /bobf/t_frw_modification.
         DATA lo_change   TYPE REF TO /bobf/if_tra_change.
         DATA lo_message  TYPE REF TO /bobf/if_frw_message.
         FIELD-SYMBOLS: <ls_mod> LIKE LINE OF lt_mod.
        APPEND INITIAL LINE TO lt_mod ASSIGNING <ls_mod> .
        <ls_mod>-node        =   ZIF_BO_TEST_PO_C=>sc_node-ROOT.
        <ls_mod>-change_mode = /bobf/if_frw_c=>sc_modify_create.
        <ls_mod>-key         = LR_DATA->KEY.
        <ls_mod>-data        = LR_DATA.
    DATA : LT_CHG_FIELDS TYPE /BOBF/T_FRW_NAME.
    DATA : LS_CHG_FIELDS LIKE LINE OF LT_CHG_FIELDS.
    DATA : LV_KEY TYPE /BOBF/CONF_KEY.
    CALL METHOD IO_MODIFY->CREATE
       EXPORTING
         IV_NODE            = ZIF_BO_TEST_PO_C=>sc_node-ROOT
         IV_KEY             = LR_DATA->KEY
         IS_DATA            = LR_DATA
         IV_ROOT_KEY        = IS_CTX-ROOT_NODE_KEY
       IMPORTING
         EV_KEY             = LV_KEY .
    CREATE DATA LR_SEARCH_RES.
    LR_SEARCH_RES->KEY           = LO_CI_SERVICE_MANAGER->GET_NEW_KEY( )..
    LR_SEARCH_RES->PARENT_KEY    = LV_KEY.
    LR_SEARCH_RES->ROOT_KEY    = LV_KEY.
    LR_SEARCH_RES->MATNR    = '123'.
    LR_SEARCH_RES->ERSDA    = SY-DATUM.
    LR_SEARCH_RES->ERNAM    = SY-UNAME.
    **LR_SEARCH_RES->LAEDA    = .
    **LR_SEARCH_RES->AENAM    = .
    **LR_SEARCH_RES->VPSTA    = .
    *LR_SEARCH_RES->LVORM    = .
    LR_SEARCH_RES->MTART    = 'ZPI'.
    LR_SEARCH_RES->MBRSH    = 'ZTP' .
    LR_SEARCH_RES->MATKL    = 'MAT'.
    **LR_SEARCH_RES->BISMT    = ''
    **LR_SEARCH_RES->MEINS    =
    CALL METHOD io_modify->create
               EXPORTING
                 iv_node            = ZIF_BO_TEST_PO_C=>sc_node-MNR_SEARCH_RESULT
                 is_data            = LR_SEARCH_RES
                 iv_assoc_key       = ZIF_BO_TEST_PO_C=>sc_association-root-MNR_SEARCH_RESULT
                 iv_source_node_key = ZIF_BO_TEST_PO_C=>sc_node-root
                 iv_source_key      = LV_KEY
                 iv_root_key        = LV_KEY.
    I am Unable to set data to the Node . I did not get any error message or Dump while executing . when i tried to retrive data I got the details from the node but am unable to view those details in the FBI UI and BOBT UI while testing .
    Please provide your valuable Suggestions.
    Thanks in Adv.
    Thanks ,
    Kranthi Kumar M.

    Hi Kranthi,
    For your requirement you need only two nodes. Root Node and Result node. Use the same structure for both.
    To create Instance while search.
    Create Query method with input type which has the required fields for selection criteria.
    Fetch the data and create instance in the root node.
    Pass the new instance key as exporting parameter form Query Method.
    To Move data from ROOT to Result.
    Create a action at root node.
    Write a code to create new entries in Result node.
    Then configure the Search UIBB and display result in List UIBB. Add button and assign the action MOVE_MAT_2_RESULT.
    Create another List uibb to display data from Result node.
    Connect the UIBBs using wire schema. SEARCH -> LIST(ROOT) ---> LIST(RESULT).
    Give src node association for ROOT to RESULT Configuration.
    Regards,
    Sunil

  • Using Class and Constructor to create instances on the fly

    hi,
    i want to be able to create instances of classes as specified by the user of my application. i hold the class names as String objects in a LinkedList, check to see if the named class exists and then try and create an instance of it as follows.
    the problem im having is that the classes i want to create are held in a directory lower down the directory hierarchy than where the i called this code from.
    ie. the classes are held in "eccs/model/behaviours" but the VM looks for them in the eccs directory.
    i cannot move the desired classes to this folder for other reasons and if i try to give the Path name to Class.forName() it will not find them. instead i think it looks for a class called "eccs/model/behaviours/x" in the eccs dir and not navigate to the eccs/model/behaviours dir for the class x.
    any ideas please? heres my code for ye to look at in case im not making any sense:)
    //iterator is the Iterator of the LinkedList that holds all the names of the
    //classes we want to create.
    //while there is another element in the list.
    while(iterator.hasNext())
    //get the name of the class to create from the list.
    String className = (String) iterator.next();
    //check to see if the file exists.
    if(!doesFileExist(className))
    System.out.println("File cannot be found!");
    //breake the loop and move onto the next element in the list.
    continue;
    //create an empty class.
    Class dynamicClass = Class.forName(className);
    //get the default constructor of the class.
    Constructor constructor = dynamicClass.getConstructor(new Class[] {});
    //create an instance of the desired class.
    Behaviour beh = (Behaviour) constructor.newInstance(new Object[] {});
    private boolean doesFileExist(String fileName)
    //append .class to the file name.
    fileName += ".class";
    //get the file.
    File file = new File(fileName);
    //check if it exists.
    if(file.exists())
    return true;
    else
    return false;
    }

    ok ive changed it now to "eccs.model.behaviours" and it seems to work:) many thanks!!!
    by the following you mean that instead of using the method "doesFileExist(fileName)" i just catch the exception and throw it to something like the System.out.println() ?
    Why don't you simply try to call Class.forName() and catch the exception if it doesn't exist? Because as soon as you package up your class files in a jar file (which you should) your approach won't work at all.i dont think il be creating a JAR file as i want the user to be able to create his/her own classes and add them to the directory to be used in the application. is this the correct way to do this??
    again many thanks for ye're help:)

  • Creating instances of Document subclass

    I have two new classed, one extends Document (call it CustomDoc) and the other extends Folder (call it CustomFolder).
    Is there any way to use the iFS webui to create these instead of the standard Document and Folder objects?

    Do you want all iFS Files to be stored as an instance of Custom-Doc, or only certain kinds of file. In order to redirect a particular kind of file (identified by it's file extension) to a custom content type you can use the ClassSelectionParser.
    See attached an example that maps BMP, JPG and TIF to the SimpleImage type.
    <?xml version="1.0" standalone="yes"?>
    <OBJECTLIST>
    <PROPERTYBUNDLE>
    <UPDATE RefType="valuedefault">ParserLookupByFileExtension</UPDATE>
    <PROPERTIES>
    <PROPERTY ACTION="add">
    <NAME>tif</NAME>
    <VALUE DataType="String">oracle.ifs.beans.parsers.ClassSelectionParser</VALUE>
    </PROPERTY>
    <PROPERTY ACTION="add">
    <NAME>bmp</NAME>
    <VALUE DataType="String">oracle.ifs.beans.parsers.ClassSelectionParser</VALUE>
    </PROPERTY>
    <PROPERTY ACTION="add">
    <NAME>jpg</NAME>
    <VALUE DataType="String">oracle.ifs.beans.parsers.ClassSelectionParser</VALUE>
    </PROPERTY>
    </PROPERTIES>
    </PROPERTYBUNDLE>
    <PROPERTYBUNDLE>
    <UPDATE RefType="valuedefault">IFS.PARSER.ObjectTypeLookupByFileExtension</UPDATE>
    <PROPERTIES>
    <PROPERTY ACTION="add">
    <NAME>tif</NAME>
    <VALUE DataType="String">SimpleImage</VALUE>
    </PROPERTY>
    <PROPERTY ACTION="add">
    <NAME>jpg</NAME>
    <VALUE DataType="String">SimpleImage</VALUE>
    </PROPERTY>
    <PROPERTY ACTION="add">
    <NAME>bmp</NAME>
    <VALUE DataType="String">SimpleImage</VALUE>
    </PROPERTY>
    </PROPERTIES>
    </PROPERTYBUNDLE>
    </OBJECTLIST>
    I do not know of any way to create instances of custom folders except via XML, or the API,
    Here is an example of how to create an an instance of a custom folder using an XML file
    <PressReleaseFolder>
    <NAME>Oracle8i Press Release</NAME>
    <FOLDERPATH>/PublishedPressReleases</FOLDERPATH>
    <ACL reftype="name" classname="SystemAccessControlList">LockedContent</ACL>
    </PressReleaseFolder>
    null

  • Pass string array to Oracle function from Web page

    Hi. I need to pass a two-dimensional array of string values to an Oracle function from an ASP.NET page. Is there an efficient way to accomplish this? I'm thinking I'll have to create a long string with special delimiters,
    |12345^4.000|67890^3.670|.....
    I'd parse the string on Oracle and break it into its component parts. In this example, each "record" is separated by the bar "|" and each field is separated by the up arrow "^". So each record has two fields.
    Is this a good approach? Your input is much appreciated. Thanks.

    In PL/SQL, it is easy enough to define a record type with two attributes and declare a store procedure that takes in an array of those parameters. I know that from Java it is possible to create and pass in such an array. I would suspect that the same is possible from .Net but I am not a competent .Net developer.
    Justin

  • 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

  • How to create dynamic connection string with variables using ssis.

    Hello,
    Can anyone let me know on how to create dynamic connection string with variables using ssis?
    Any help would be appreciated.

    Hi vinay9738,
    According to your description, you want to connect multiple database from multiple servers using dynamic connection.
    If in this case, we can create a Table in our local database (whatever DB we want) and load all the connection strings.  We can use Execute SQL Task to query all the connection strings and store the result-set in a variable of object type in SSIS package.
    Then use ForEach Loop container to shred the content of the object variable and iterate through each of the connection strings. And then Place an Execute SQL task inside ForEach Loop container with the SQL statements we have to run in all the DB instances. 
    For more details, please refer to the following blog:
    http://sql-developers.blogspot.kr/2010/07/dynamic-database-connection-using-ssis.html
    If there are any other questions, please feel free to let me know.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Address (how to create the right string)

    I have to pass to a JFileChooser a patch of a server directory.
    the client recive from the server the string... (example C:\ )
    now i can have the socket address with socket.getInetAddress();
    now i would like to create with those string a tring that is the right address for the server.
    Many thanks

    You can't access sockets with a JFileChooser. It is a component to see files and not IP connections
    If you need to access a directory in your server using a JFileChooser in your client, you should use something like:
    //name_of_the_server_machine/shared_directory (if you are under windows, or in linux if you can use samba or nfs)

  • 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

  • BEA-090563 -- Cannot create instance of Hostname Verifier

    I am trying to use custom hostname verifier for my osb project and following are the steps.
    1. Create java class -- given below as reference...
    2. Add the full class name @ Admin server --> ssl --> Advanced --> custom hostname verifier -- also choose custom hostname verifier in the host name verification field above it.
    3. Package the class in the jar file using eclipse export java project and place the file in server-lib folder.
    4. Restart admin and osb server.
    I am facing following error ---
    osb_domain.log00932:####<Aug 3, 2012 12:01:41 PM EST> <Error> <Security> <server host name> <osb_server1> <[ACTIVE] ExecuteThread: '
    1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <6cf4c9e4b2f5468a:-4668cc77:138ea27406f:-8000-000000000000095d> <134
    3959301805> <BEA-090563> <Cannot create instance of Hostname Verifier <package name>:WildcardHostnameVerifier.>
    Can somebody let me know if there are any additional settings required for this to work ?
    JAVA CLASS
    package <package name>;
    import java.io.ByteArrayInputStream;
    import java.security.cert.Certificate;
    import java.security.cert.CertificateEncodingException;
    import java.security.cert.CertificateException;
    import java.security.cert.CertificateFactory;
    import java.security.cert.X509Certificate;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import javax.net.ssl.SSLPeerUnverifiedException;
    import javax.net.ssl.SSLSession;
    import weblogic.security.SSL.HostnameVerifier;
    * @author Ravi_Shah01
    public class WildcardHostnameVerifier implements HostnameVerifier {
         /* (non-Javadoc)
         * @see com.certicom.net.ssl.HostnameVerifier#verify(java.lang.String, javax.net.ssl.SSLSession)
         public WildcardHostnameVerifier() {
              System.out.print("Creating instance of WildcardHostnameVerifier");
         public boolean verify(String hostname, SSLSession session) {
              try {
                   Certificate cert = session.getPeerCertificates()[0];
                   byte [] encoded = cert.getEncoded();
                   CertificateFactory cf = CertificateFactory.getInstance("X.509");
                   ByteArrayInputStream bais = new ByteArrayInputStream(encoded);
                   X509Certificate xcert = (X509Certificate)cf.generateCertificate(bais);
                   String cn = getCanonicalName( xcert.getSubjectDN().getName() );
                   if(cn.equals(hostname))
                        return true;
                   Pattern validHostPattern = Pattern.compile("\\*\\.[^*]*\\.[^*]*");
                   Matcher validHostMatcher = validHostPattern.matcher(cn);
                   if(validHostMatcher.matches())
                        String regexCn = cn.replaceAll("\\*.", "(.)*[\\.\\$]");
                        Pattern pattern = Pattern.compile(regexCn);
                        Matcher matcher = pattern.matcher(hostname);
                        if(matcher.matches())
                             if(matcher.group().equals(hostname))
                                  return true;
                             else
                                  return false;
                        else
                             return false;
                   else
                        return false;
              } catch (SSLPeerUnverifiedException e) {
                   e.printStackTrace();
                   return false;
              } catch (CertificateEncodingException e) {
                   e.printStackTrace();
                   return false;
              } catch (CertificateException e) {
                   e.printStackTrace();
                   return false;
         * Return just the canonical name from the distinguishedName
         * on the certificate.
         * @param subjectDN
         * @return
         private String getCanonicalName(String subjectDN) {
              Pattern pattern = Pattern.compile("CN=([-.*aA-zZ0-9]*)");
              Matcher matcher = pattern.matcher(subjectDN);
              if(matcher.find())
                   return matcher.group(1);
              return subjectDN;
    }

    Hi Ravi,
    3. Package the class in the jar file using eclipse export java project and place the file in server-lib folder.Instead of placing the jar in server-lib, please modify setDomainEnv.cmd/setDomainEnv.sh as below to add jar in the classpath-
    set CLASSPATH=<Your_Jar_PATH>;%CLASSPATH%
    Restart WebLogic Server and re-test.
    From Weblogic 10.3.4 onwards there is a patch available to enhance the existing default BEA hostname verifier to include wildcard certificates and wildcard host name verifier is available in Weblogic 10.3.6
    Regards,
    Anuj

  • Incomplete Client Install OSD - Failed to create instance if Software Execution Request Managerr. 0x80070005

    I am using an imaging task sequence and getting a
    0x80070005 error.  IT seems that the SCCM client
    doesn’t complete correctly and actions are missing from the client.
    Below is the log information.  I am not sure if a reboot is causing the issue?
    <![LOG[Path variable _SMSTSBootStagePath converted from C:\_SMSTaskSequence\WinPE to F05092C70000100000000000:\_SMSTaskSequence\WinPE]LOG]!><time="09:40:56.205+300" date="04-07-2014" component="TSManager" context=""
    type="1" thread="2244" file="resolvesource.cpp:1597">
    <![LOG[Updated security on object C:\_SMSTaskSequence.]LOG]!><time="09:40:56.237+300" date="04-07-2014" component="TSManager" context="" type="1" thread="2244" file="utils.cpp:1704">
    <![LOG[Set a global environment variable _SMSTSNextInstructionPointer=12]LOG]!><time="09:40:56.237+300" date="04-07-2014" component="TSManager" context="" type="0" thread="2244" file="executionenv.cxx:668">
    <![LOG[Set a TS execution environment variable _SMSTSNextInstructionPointer=12]LOG]!><time="09:40:56.237+300" date="04-07-2014" component="TSManager" context="" type="0" thread="2244"
    file="executionenv.cxx:386">
    <![LOG[Set a global environment variable _SMSTSInstructionStackString=8]LOG]!><time="09:40:56.237+300" date="04-07-2014" component="TSManager" context="" type="0" thread="2244" file="executionenv.cxx:668">
    <![LOG[Set a TS execution environment variable _SMSTSInstructionStackString=8]LOG]!><time="09:40:56.237+300" date="04-07-2014" component="TSManager" context="" type="0" thread="2244" file="executionenv.cxx:414">
    <![LOG[Save the current environment block]LOG]!><time="09:40:56.237+300" date="04-07-2014" component="TSManager" context="" type="0" thread="2244" file="executionenv.cxx:833">
    <![LOG[Expand a string: %_SMSTSMDataPath%\Logs]LOG]!><time="09:40:56.268+300" date="04-07-2014" component="TSManager" context="" type="0" thread="2244" file="executionenv.cxx:782">
    <![LOG[_SMSTSReturnToGINA variable set to true]LOG]!><time="09:41:56.381+300" date="04-07-2014" component="TSManager" context="" type="1" thread="2244" file="engine.cxx:936">
    <![LOG[Skipped Reboot System]LOG]!><time="09:41:56.381+300" date="04-07-2014" component="TSManager" context="" type="1" thread="2244" file="engine.cxx:940">
    <![LOG[The action (Restart Computer) initiated a reboot request]LOG]!><time="09:41:56.381+300" date="04-07-2014" component="TSManager" context="" type="1" thread="2244" file="engine.cxx:277">
    <![LOG[MP server http://XXXXXXXXXXX. Ports 80,443. CRL=false.]LOG]!><time="09:41:56.381+300" date="04-07-2014" component="TSManager" context="" type="1" thread="2244"
    file="utils.cpp:5881">
    <![LOG[Setting authenticator]LOG]!><time="09:41:56.396+300" date="04-07-2014" component="TSManager" context="" type="1" thread="2244" file="utils.cpp:5903">
    <![LOG[Set authenticator in transport]LOG]!><time="09:41:56.396+300" date="04-07-2014" component="TSManager" context="" type="0" thread="2244" file="libsmsmessaging.cpp:7734">
    <![LOG[Sending StatusMessage]LOG]!><time="09:41:56.428+300" date="04-07-2014" component="TSManager" context="" type="1" thread="2244" file="libsmsmessaging.cpp:4023">
    <![LOG[Setting message signatures.]LOG]!><time="09:41:56.443+300" date="04-07-2014" component="TSManager" context="" type="0" thread="2244" file="libsmsmessaging.cpp:1295">
    <![LOG[Setting the authenticator.]LOG]!><time="09:41:56.443+300" date="04-07-2014" component="TSManager" context="" type="0" thread="2244" file="libsmsmessaging.cpp:1325">
    <![LOG[CLibSMSMessageWinHttpTransport::Send: URL: XXXXXXXXXX:80  CCM_POST /ccm_system/request]LOG]!><time="09:41:56.443+300" date="04-07-2014" component="TSManager" context="" type="1" thread="2244"
    file="libsmsmessaging.cpp:8604">
    <![LOG[Request was successful.]LOG]!><time="09:41:56.474+300" date="04-07-2014" component="TSManager" context="" type="0" thread="2244" file="libsmsmessaging.cpp:8939">
    <![LOG[****************************************************************************]LOG]!><time="09:41:56.490+300" date="04-07-2014" component="TSManager" context="" type="1" thread="2244"
    file="tsmanager.cpp:925">
    <![LOG[Execution engine result code: Reboot (2)]LOG]!><time="09:41:56.490+300" date="04-07-2014" component="TSManager" context="" type="2" thread="2244" file="tsmanager.cpp:931">
    <![LOG[Process completed with exit code 2147945410]LOG]!><time="09:41:56.521+300" date="04-07-2014" component="TSMBootstrap" context="" type="1" thread="2352" file="commandline.cpp:1123">
    <![LOG[Exiting with return code 0x80070BC2]LOG]!><time="09:41:56.521+300" date="04-07-2014" component="TSMBootstrap" context="" type="1" thread="2352" file="tsmbootstrap.cpp:1238">
    <![LOG[Process completed with exit code 2147945410]LOG]!><time="09:41:56.537+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="2144" file="commandline.cpp:1123">
    <![LOG[Task sequence requested a reboot]LOG]!><time="09:41:56.537+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="2144" file="basesetuphook.cpp:1580">
    <![LOG[Terminating system message loop.]LOG]!><time="09:41:56.553+300" date="04-07-2014" component="OSDSetupHook" context="" type="0" thread="2168" file="debugwindow.cpp:222">
    <![LOG[Restoring original desktop wallpaper.]LOG]!><time="09:41:56.568+300" date="04-07-2014" component="OSDSetupHook" context="" type="0" thread="2144" file="wallpaperselector.cpp:139">
    <![LOG[::SystemParametersInfoW( 0x0014, 0, (LPVOID)m_sOriginalWallpaper.c_str(), 0x0002 | 0x0001 ), HRESULT=80070002 (e:\nts_sccm_release\sms\client\osdeployment\osdgina\wallpaperselector.cpp,162)]LOG]!><time="09:41:56.568+300" date="04-07-2014"
    component="OSDSetupHook" context="" type="0" thread="2144" file="wallpaperselector.cpp:162">
    <![LOG[Failed to set log directory. Some execution history may be lost.
    The system cannot find the file specified. (Error: 80070002; Source: Windows)]LOG]!><time="09:43:40.359+300" date="04-07-2014" component="OSDSetupHook" context="" type="3" thread="840" file="osdsetuphook.cpp:192">
    <![LOG[Executing task sequence]LOG]!><time="09:43:40.375+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="840" file="osdsetuphook.cpp:279">
    <![LOG[Task Sequence environment not found.]LOG]!><time="09:43:40.390+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="840" file="basesetuphook.cpp:1450">
    <![LOG[Attempting to get active request.]LOG]!><time="09:43:40.390+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="840" file="basesetuphook.cpp:48">
    <![LOG[Failed to create instance if Software Execution Request Managerr. 0x80070005]LOG]!><time="09:43:40.437+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="840"
    file="basesetuphook.cpp:57">
    <![LOG[Waiting for ccmexec process to start.]LOG]!><time="09:43:40.437+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="840" file="basesetuphook.cpp:58">
    <![LOG[Failed to create instance if Software Execution Request Managerr. 0x80070005]LOG]!><time="09:43:46.257+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="840"
    file="basesetuphook.cpp:57">
    <![LOG[Waiting for ccmexec process to start.]LOG]!><time="09:43:46.257+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="840" file="basesetuphook.cpp:58">
    <![LOG[Failed to create instance if Software Execution Request Managerr. 0x80070005]LOG]!><time="09:43:51.257+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="840"
    file="basesetuphook.cpp:57">
    <![LOG[Waiting for ccmexec process to start.]LOG]!><time="09:43:51.257+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="840" file="basesetuphook.cpp:58">
    <![LOG[Failed to create instance if Software Execution Request Managerr. 0x80070005]LOG]!><time="09:43:56.257+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="840"
    file="basesetuphook.cpp:57">
    <![LOG[Waiting for ccmexec process to start.]LOG]!><time="09:43:56.257+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="840" file="basesetuphook.cpp:58">
    <![LOG[Failed to create instance if Software Execution Request Managerr. 0x80070005]LOG]!><time="09:44:01.257+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="840"
    file="basesetuphook.cpp:57">
    <![LOG[Waiting for ccmexec process to start.]LOG]!><time="09:44:01.257+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="840" file="basesetuphook.cpp:58">
    <![LOG[GetActiveRequest failed with error code 0x87d01012]LOG]!><time="09:44:07.804+300" date="04-07-2014" component="OSDSetupHook" context="" type="3" thread="840" file="basesetuphook.cpp:66">
    <![LOG[GetActiveRequest failed. 0x87D01012.]LOG]!><time="09:44:07.804+300" date="04-07-2014" component="OSDSetupHook" context="" type="3" thread="840" file="basesetuphook.cpp:83">
    <![LOG[ReleaseActiveRequest failed. 0x87d01012.]LOG]!><time="09:44:07.804+300" date="04-07-2014" component="OSDSetupHook" context="" type="3" thread="840" file="basesetuphook.cpp:122">
    <![LOG[Deleting SMS_MaintenanceTaskRequests istance: SMS_MaintenanceTaskRequests.TaskID="{11EB4952-7CDD-45D5-BD6F-DA65E193E04F}".]LOG]!><time="09:44:07.835+300" date="04-07-2014" component="OSDSetupHook"
    context="" type="1" thread="840" file="basesetuphook.cpp:144">
    <![LOG[Removed 1 instance of SMS_MaintenanceTaskRequests for tasksequence.]LOG]!><time="09:44:07.835+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="840" file="basesetuphook.cpp:155">
    <![LOG[Uninstalling Setup Hook]LOG]!><time="09:44:07.835+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="840" file="basesetuphook.cpp:1628">
    <![LOG[Removing setup hook from registry.]LOG]!><time="09:44:07.835+300" date="04-07-2014" component="OSDSetupHook" context="" type="0" thread="840" file="vistasetuphook.cpp:143">
    <![LOG[Successfully removed C:\WINDOWS\system32\OSDGINA.DLL]LOG]!><time="09:44:07.835+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="840" file="basesetuphook.cpp:1321">
    <![LOG[Successfully removed C:\WINDOWS\system32\OSDSETUPHOOK.EXE]LOG]!><time="09:44:07.835+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="840" file="basesetuphook.cpp:1321">
    <![LOG[Successfully removed C:\WINDOWS\system32\_SMSOSDSetup]LOG]!><time="09:44:07.835+300" date="04-07-2014" component="OSDSetupHook" context="" type="1" thread="840" file="basesetuphook.cpp:1358">

    You are starting the OSD from Full OS? Is there Bitlocker enabled on the machine you're trying to re-install? Could you post a screenshot of your Task Sequence?

Maybe you are looking for