Cannot create resource instance

Hi to get a pool connection I use a universal pool connection(ucp.jar). I did this:
In the server.xml of tomcat i put these:
<Resource
     name="onconsultas"
     auth="Container"
     description ="Pool for onconsultas"
     type="oracle.jdbc.pool.OracleConnectionPoolDataSource"               
  />In the context.xml of tomcat i put these:
<Context path="/onconsultas" docBase="onconsultas" debug="0" reloadable="true">
     <ResourceParams name = "onconsultas">
          <parameter>
               <name>driverClassName</name>
               <value>oracle.jdbc.driver.OracleDriver</value>
          </parameter>
          <parameter>
               <name>factory</name>
               <value>oracle.jdbc.pool.OracleDataSourceFactory</value>
          </parameter>
          <parameter>
               <name>logAbandoned</name>
               <value>true</value>
          </parameter>
          <parameter>
               <name>removeAbandoned</name>
               <value>true</value>
          </parameter>
          <parameter>
               <name>removeAbandonedTimeout</name>
               <value>60</value>
          </parameter>
          <parameter>
               <name>url</name>
               <value>jdbc:oracle:thin:@198.198.111.170:1521:asesoras</value>
          </parameter>
          <parameter>
               <name>user</name>
               <value>sisope</value>
          </parameter>
          <parameter>
               <name>password</name>
               <value>sisope</value>
          </parameter>
     </ResourceParams>  
</Context>In the web.xml of tomcat( i also tried in the web.xml of mi aplication):
resource-ref>
        <description>Description pool</description>
        <res-ref-name>onconsultas</res-ref-name>
        <res-type>oracle.jdbc.pool.OracleConnectionPoolDataSource</res-type>
        <res-auth>Container</res-auth>
</resource-ref>Finally in mi class I code:
Context ctx = null;
Context initCtx = new InitialContext();
  ctx = (Context) initCtx.lookup("java:comp/env");
  OracleConnectionPoolDataSource dataSource = ( OracleConnectionPoolDataSource) ctx.lookup("/onconsultas");in the line of the dataSource is the error and said:
javax.naming.NamingException: Cannot create resource instance
What is wrong? i don't get it

I forgot: I 'm using tomcat 6.0.18 that came with the netbeans 6.9 and I `m not using servlets. Almost all the code is in the jsp.

Similar Messages

  • Cannot create resource instance (Works on NetBeans/Tomcat)

    I have a project that works just fine in NetBeans w/ Tomcat but when I deploy it to Sun One Web Server 6.1 SP5 I get the following error:
    StandardWrapperValve[jsp]: WEB2792: Servlet.service() for servlet jsp threw exception
    javax.servlet.ServletException: Cannot create resource instance
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:536)
         at jsps.index_jsp._jspService(_index_jsp.java:91)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
         at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:687)
         at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:459)
         at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:375)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
         at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)
         at com.iplanet.ias.web.WebContainer.service(WebContainer.java:580)
    ----- Root Cause -----
    javax.naming.NamingException: Cannot create resource instance
         at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:167)
         at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:834)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
         at org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at jsps.index_jsp._jspService(_index_jsp.java:79)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
         at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:687)
         at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:459)
         at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:375)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
         at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)
         at com.iplanet.ias.web.WebContainer.service(WebContainer.java:580)
    I have the following in my in context.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/BOEnterpriseTest1">
    <Resource name="jdbc/dev10g" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@10.10.10.10:1521:dev" username="userid" password="pwd" maxActive="20" maxIdle="10" maxWait="-1"/>
    </Context>
    I have the following in my web.xml:
    <resource-ref>
    <description>jdbc:oracle:thin:@10..10.10.10:1521:dev</description>
    <res-ref-name>jdbc/dev10g</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    What�s missing on the Sun One server?

    I am trying to do a refresh of a Crystal Reports report in a JSP.
    Using the web.xml looking like:
    <resource-ref>
    <description>jdbc:oracle:thin:@10.10.
    10.10:1521:dev10g</description>
    <res-ref-name>jdbc/dev10g</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Application</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    and code in my JSP:
    <%
    InitialContext initContext = new InitialContext();
    DataSource source = (DataSource) initContext.lookup("java:comp/env/jdbc/dev10g");
    Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    try{
    DataSource ds = (DataSource)initCtx.lookup("Data");
    catch ( NamingException e ){
    DataSource ds = (DataSource) initContext.lookup("java:comp/env/jdbc/dev10g");
    initCtx.bind("Data", ds);     
    I get the following error:
    WEB2720: Error initializing naming context for context /BOEnterpriseTest1
         javax.naming.NameNotFoundException: WEB3885: Name Data is not bound in this Context
              at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
              at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
              at com.iplanet.ias.web.WebModule.verifyResType(WebModule.java:510)
              at com.iplanet.ias.web.WebModule.bindResources(WebModule.java:410)
              at com.iplanet.ias.web.WebModule.bindGlobalResourceRefs(WebModule.java:352)
              at com.iplanet.ias.web.WebModule.createNamingContext(WebModule.java:323)
              at org.apache.catalina.core.StandardContext.start(StandardContext.java:3718)
              at com.iplanet.ias.web.WebModule.start(WebModule.java:251)
              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
              at org.apache.catalina.core.StandardHost.start(StandardHost.java:652)
              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
              at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355)
              at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
              at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431)
              at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500)
              at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161)
    What steps do I need to do on the Server side or in my code?

  • Tomcat - MySQL - Cannot create resource instance

    I keep getting an error when trying to lookup my JNDI name. I know that this name is bound to a Context because I can list the bindings
    Context initCtx = new InitialContext();
    NamingEnumeration enum = initCtx.listBindings("java:comp/env/jdbc");
    while (enum.hasMoreElements()) {
    System.out.println(enum.nextElement().toString());
    And sure enough the name of my database I added through the console appears. However, I keep getting this error:
    javax.naming.NamingException: Cannot create resource instance
    on this second line of code
    Context ctx = new InitialContext();
    DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/ArgonautDB");
    My MySQL Connector jar file is in $CATALINA_HOME/common/lib and I believe my server.xml settings are correct because I added this Data Source to the context through the console and the web.xml file should be simple...nevertheless I still get this error.
    Any suggestions on where I else I can turn. Pulling my precious few last hairs out here....

    Thank you very much. That did the trick. Actually what did the trick was to reinstall tomcat with the standard installation, NOT the LE installation which doesn't include the dbcp jar files needed for connecting to a database - but you were right about missing those.
    I was dissapointed in Tomcat's documentation of this issue. I would have thought that something that has to have caused other developers problems like this would have been documented somewhere more pronounced (if at all) on Tomcat's site.
    For those other newbies out there who don't want to pull out your hair...here is a summary of the steps I took to remedy this problem.
    1) Install the latest version of Tomcat. Do NOT install the LE version, it does not include the neccessary library files to connect to a database (commons-dbcp.jar and commons-pool.jar).
    2) Download the latest mysql connector library from http://www.mysql.com/downloads/mysqlcc.html. Once you have extracted the tar file, there will be some directories, a README file, a couple other text files and a jar file named mysql-connector-java-VERSION-stable-bin.jar. Move the mysql-connector-java-VERSION-stable-bin.jar file to $CATALINA_HOME/common/lib.
    3) Follow the instructions on http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
    to create a test database, a test jsp file and a test class to access the database.

  • Javax.naming.NamingException: Cannot create resource instance (JOTM )

    Hi all,
    I wanted to create an application with transaction management, first i tired out tyrex but could get a thing out of it now i am trying out JOTM, but i am getting this error "javax.naming.NamingException: Cannot create resource instance ", below is my configuration..
    ===context.xml===
    <Context path="/FYPMS" docBase="FYPMS" debug="1" reloadable="true" crossContext="true" antiResourceLocking="true">
    <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_crs_log." suffix=".txt"
              timestamp="true"/>
         <Resource name="jdbc/mysql" auth="Container" type="javax.sql.DataSource"
    maxActive="100" maxIdle="30" maxWait="10000"
    username="root" password="password" driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://127.0.0.1:3306/fypms?autoReconnect=true"/>
    <Resource name="UserTransaction" auth="Container"
    type="javax.transaction.UserTransaction"/>
    <ResourceParams name="UserTransaction">
    <parameter>
    <name>factory</name>
    <value>org.objectweb.jotm.UserTransactionFactory</value>
    </parameter>
    <parameter>
    <name>jotm.timeout</name>
    <value>60</value>
    </parameter>
    </ResourceParams>
    </Context>
    ===web.xml===
    <resource-ref>
    <res-ref-name>jdbc/mysql</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    ===insert.java===
    try{
    System.out.println("pass0");
    Context ctx = new InitialContext();
    Context envCtx = (Context)ctx.lookup("java:comp/env");
    DataSource datasource = (javax.sql.DataSource)envCtx.lookup("jdbc/mysql");               
    UserTransaction ut = (UserTransaction)envCtx.lookup("UserTransaction");
    ut.begin();
    the dataSource can be retrieve successfully but when i tired to retrieve the UserTransaction i get a "Cannot create resource instance ". Please help mi out with this.. thx
    fatmond

    we are trying to connect MS Access thru tomcat and it is giving the above exception
    i have changed the server.xml
    <Resource name="jdbc/Mess" auth="Container" scope="Shareable" type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/Mess">
    <parameter>
    <name>maxWait</name>
    <value>5000</value>
    </parameter>
    <parameter>
    <name>maxActive</name>
    <value>4</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>admin</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:odbc:Mess</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>sun.jdbc.odbc.JdbcOdbcDriver</value>
    </parameter>
    <parameter>
    <name>maxIdle</name>
    <value>2</value>
    </parameter>
    <parameter>
    <name>username</name>
    <value>admin</value>
    </parameter>
    </ResourceParams>
    web.xml
    <resource-ref>
    <description>Access Datasource example</description>
    <res-ref-name>jdbc/Mess</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    java class
    Context initContext = new InitialContext();
    DataSource ds = (DataSource)initContext.lookup("java:/comp/env/jdbc/Mess");
    con = ds.getConnection();
    Please help.......

  • HELP-DIALOG POP UP BOX-JAVA Cannot create XMLHTTP instance.

    After going to a Web site with Opera Browser, I get the following dialog box JAVA "Cannot create xmlhttp instance".
    Now it pops up when ever I use Opera, but not Internt Exployer. Can you tell a Newbie how to fix it?
    I uninstalled Java 1.4.2 & installed ( jre 1.5.0.05 ) and I still get the
    same Dialog Box. The Box stops me from using Opera Browser,
    because it reappears all the time. I NEED HELP. My OS is XP Home.
    PM me at( trader_zzzz, yahoo.com ). Thanks in advance, traderzzzz.

    Java is not involved in the error - Javascript is. Javascript is not Java, and except for the similar name, they have nothing in common. The problem is the way that Opera is interacting with Javascript and the webpage you visited. You probably want to look for the solution at Opera's website. This search listing may help:
    http://www.google.com/search?q=Cannot+create+xmlhttp+instance

  • Cannot create an instance of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)"

    Windows Server 2008
    SQL Express 2012
    Tried opening a .csv and a .xls file, without success. File is located on the local server and not somewhere else.
    I know, I know, the forums are full of this error message. But sometimes when you follow all of the rules, stuff still happens, or in this case Doesn't happen.
    I installed the proper ACE drivers (64 bit) and reconfigured SQL Server to allow Ad Hoc Queries. Hell I even rebooted the server after the install.
    I have successfully installed these drivers on several machines (work stations and servers), and all have worked just fine. So, I am at a loss as to why it won't work on this system. I might have forgotten some obscure setting, but I don't think so.
    Ted

    Registry fix was also tried?
    EXEC sp_MSSet_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess', 1
    GO
    EXEC sp_MSSet_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'DynamicParameters', 1
    GO

  • Cannot create object

    Hi gurus,
    the following code:
    <b><i>DATA: ref_cl_rsd_odso TYPE REF TO cl_rsd_odso,
          ref_if_rsd_dta  type ref to if_rsd_dta,
          e_s_dta TYPE rsd_s_dta,
          wa_e_s_dta TYPE rsd_s_dta.
    START-OF-SELECTION.
    create object ref_cl_rsd_odso.
      CALL METHOD ref_cl_rsd_odso->if_rsd_dta~dta_get_info
        IMPORTING
          e_s_dta = e_s_dta.</i></b>
    return an activation error:
    "You cannot create an instance of the class "CL_RSD_ODSO" outside the class"          
    Could you help me?
    Thanks in advance!
    Bye!
    Ferdinando

    Hi,
    Go through the below code,
    We need to call the factory method to get the instance of this class.
    DATA: ref_cl_rsd_odso TYPE REF TO cl_rsd_odso,
    ref_if_rsd_dta type ref to if_rsd_dta ,
    e_s_dta TYPE rsd_s_dta,
    wa_e_s_dta TYPE rsd_s_dta.
    START-OF-SELECTION.
    CALL METHOD CL_RSD_ODSO=>FACTORY
    EXPORTING
       I_ODSOBJECT   = SPACE
       I_REFNM       =
       I_TXTLG       =
       I_TXTSH       =
       I_INFOAREA    =
       I_BWAPPL      =
      RECEIVING
        R_R_ODSO      = ref_cl_rsd_odso.
    EXCEPTIONS
       INPUT_INVALID = 1
       CANCELLED     = 2
       others        = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD ref_cl_rsd_odso->if_rsd_dta~dta_get_info
    IMPORTING
    e_s_dta = e_s_dta.
    Regards,
    Azaz Ali.

  • Cannot create process to handle workflow instance conversation

    <Nov 18, 2002 1:04:30 PM IST> <Error> <B2B> <000000> <<Process>
    Hi,
    Iam getting following error when iam trying to invoke
    subworkflow.
    can anyone help me in solving this problem.
    regards
    Ananth
    ERROR: Cannot cr
    eate process null.>
    <Nov 18, 2002 1:04:30 PM IST> <Error> <B2B> <000000> <<B2B-BPM-Plugin> ERROR:
    Cannot create process to handle workflow instance conversation
    com.bea.b2b.protocol.ProcessManager$CreateException: ERROR: Cannot create proces
    s null.

    Hi Ajaz,
    Error description is not detailed enough to provide the solution. You need to post the error message what you got in the server log files. This should contain specific details about the issue.
    Not sure but issue may be related to JVM settings. if it is so, server log file will provide the error description.

  • PowerPivot - SP2013 - Cannot create the service instance because the parent Service does not exist

    Unable to setup PowerPivot using PowerPivot configuration tool.
    I have One server which has SQL 2012 SP1 and SP2013.
    The farm is configured with all service applications.
    SQL has default instance with DB Engine and SSAS Tabular. Reporting Services has been configured using SharePoint mode and has a service application.
    The Power Pivot instance is set up with DB Engine and the SSAS.
    I keep getting this error. Ive tried so many times uninstalling, making sure features removed, rebuilding the farm (thank god for autospinstaller..)
    11/07/13 12:06:17:6858 Verbose: CreateSystemServiceInstance.NeedsExecute
    11/07/13 12:06:17:6858 Verbose: Running function IsFarmConfigured to check whether SharePoint is configured regardless of availability
    11/07/13 12:06:17:6858 Verbose: Farm is configured
    11/07/13 12:06:17:6858 Verbose: Entering function GetService(Guid)
    11/07/13 12:06:17:6868 Verbose: Service is not installed.
    11/07/13 12:06:17:6868 Verbose: Service instance not found in local server.
    11/07/13 12:06:17:6868 Verbose: CreateSystemServiceInstance.NeedsExecute(True)
    11/07/13 12:06:17:6868 Verbose: CreateSystemServiceInstance.CanExecute
    11/07/13 12:06:17:6868 Verbose: CreateSystemServiceInstance.CanExecute(True)
    11/07/13 12:07:41:5662 Verbose: CreateSystemServiceInstance.Execute
    11/07/13 12:07:41:5682 Verbose: Entering function GetService(Guid)
    11/07/13 12:07:41:5702 Verbose: Service is not installed.
    11/07/13 12:07:41:5702 Verbose: CreateSystemServiceInstance.Execute(Skipped)
    11/07/13 12:07:41:5702 High: Cannot create the service instance because the parent Service does not exist.
    11/07/13 12:07:41:5702 High: Prerequisites check for execution failed. Farm is not in a valid state.

    Did you install the PowerPivot add-in for SharePoint? There are 2 parts to this - the SQL Server Power Pivot for SharePoint which is the Analysis Services instance running in Tabular Mode and the PowerPivot Add-in. The last line in your error message seems
    to tell you that you have a missing component in the farm, possibly the PowerPivot Add-in
    Edwin Sarmiento SQL Server MVP | Microsoft Certified Master
    Blog |
    Twitter | LinkedIn
    SQL Server High Availability and Disaster Recover Deep Dive Course

  • Cannot Create Instance Error

    I am using 11gR1, I am trying to run an application created out of a project template. I was able to successfully deploy both the composite and UI, When I login as initiator and click on the process link I am getting "cannot create instance error".
    In EM, the Instance shows that its been faulted and has the following message.
    ORABPEL-10513 Cannot get application roles from application identified by "{0}". An error occured while getting application roles from application identified by "OracleBPMProcessRolesApp". The underlying APIs threw an exception. Check the error stack and fix the cause of the error. Contact oracle support if error is not fixable.
    All the organization roles have been created properly. Can anyone please tell me what could be the cause of this error. Thanks
    Venkat

    Hey Venkat,
    Do you have any sample where you work with BPM template (MDS)...?if yes, could you share....those...?
    I am new to 11g..in learning phase....it would be very nice if you could share some samples.....
    Rgds,
    Biltu...

  • 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

  • Deserialize works fine. Now I cannot create my class instance

    When I deserialize my object a can get the object. Ok.
    ObjectInputStream ois = new ObjectInputStream(new FileInputStream(fichero));     
                   aux = ois.readObject();                
                   System.out.println(aux);
    And I see :
    mypackage.myclass (This class is a Jpanel based and some references to another classes)
    Now I have 3 questiosn - problems:
    1.- I dont know the class name (or I want that my code works with every kind of object) ,so... Is it neccesary to CAST the object?
    2.- In this case.... it can be done by mean of string name ? aux = (the_cast) .... ( when the_cast = "MYclass")
    3.- Finally I dont know how to create an instance of my new class
    ((MY_CAST) aux.getclass()).newinstance(); throws an error of "java.lang.Class cannot be cast ..."
    Any help?

    tonnot wrote:
    Now I have 3 questiosn - problems:
    1.- I dont know the class name (or I want that my code works with every kind of object) ,so... Is it neccesary to CAST the object? No, it's not necessary usually and when you don't know the type at compile time, then it's not possible either.
    2.- In this case.... it can be done by mean of string name ? aux = (the_cast) .... ( when the_cast = "MYclass")No, that's not possible. Since casting doesn't change anything about the object but only about the reference, casting "to a dynamic type" is meaningless, since you couldn't have a reference variable "of a dynamic type" to hold the newly-cast object anyway.
    3.- Finally I dont know how to create an instance of my new class
    ((MY_CAST) aux.getclass()).newinstance(); throws an error of "java.lang.Class cannot be cast ..."The problem is that you're trying to cast the Class object to MY_CAST (which I assume is your class), while it should in fact be a Class<? extends MY_CAST>.
    I'm unclear what you want to achieve here and what you know about the object: Why do you want to create a new instance of an object you know nothing about?

  • Cannot find new instances in the workspace

    I use BPM Standalone 10g and Studio 10g.
    I create a process without a global creation activity and deploy as well as publish it in the BPM Standalone.
    The process just has one activity named Interactivejcooper. Its main task is set to Method.
    I also create a JAVA PAPI to create new instances of this process. It can create new instances.
    However, I cannot find all new instances created by PAPI in the workspace.
    The following code is in the PAPI.
    --------------------code------------------------
    package piic;
    import fuego.lang.ConnectionPassport;
    import java.util.Properties;
    import fuego.papi.Arguments;
    import fuego.papi.CommunicationException;
    import fuego.papi.InstanceInfo;
    import fuego.papi.ProcessService;
    import fuego.papi.ProcessServiceSession;
    import fuego.papi.OperationException;
    import java.util.Properties;
    public class Class1 {
    public Class1() {
    public static void main(String[] args) throws CommunicationException, OperationException {
    Class1 class1 = new Class1();
    Properties configuration = new Properties();
    configuration.setProperty(ProcessService.DIRECTORY_ID, "default");
    configuration.setProperty(ProcessService.DIRECTORY_PROPERTIES_FILE, "D:\\BPM_HOME_standalone\\webapps\\papiws\\WEB-INF\\directory.xml");
    configuration.setProperty(ProcessService.WORKING_FOLDER, "/tmp");
    ProcessService processService = ProcessService.create(configuration);
    ConnectionPassport passport = processService.createPassport("jcooper");
    passport.setPassword("welcome1");
    passport.fillPassport();
    ProcessServiceSession session = processService.createSession(passport, "localhost");
    for (String processId : session.processesGetIds()) { 
    System.out.println("\n ProcessID: " + processId);
    String processId = "/Processwithoutglobalstart";
    String argumentName = "MyArgument";
    Object argumentValue = new Object();
    Arguments arguments = Arguments.create();
    arguments.putArgument(argumentName, argumentValue);
    session.processCreateInstance(processId, arguments);
    System.out.println("49-----------");
    for (String processId2 : session.processesGetIds()) { 
    System.out.println("\n ProcessID: " + processId2);
    for (InstanceInfo instance : session.processGetInstances(processId2)) {
    System.out.println(" instance.getId()-> " + instance.getId());
    System.out.println(" activity.getActivityId()-> " +instance.getActivityId());
    System.out.println(" activity.getActivityName()-> " +instance.getActivityName());
    session.close();
    processService.close();
    ----------------------println----------------------------------
    E:\Jdeveloper10131_20090318\jdk\bin\javaw.exe -client -classpath E:\Jdeveloper10131_20090318\jdev\mywork\PAPInewInstancewithoutCreation\Project1\classes;D:\BPM_HOME_standalone\client\papi\lib\b1util.jar;D:\BPM_HOME_standalone\client\papi\lib\b1oracle.jar;D:\BPM_HOME_standalone\client\papi\lib\b1base.jar;D:\BPM_HOME_standalone\client\papi\lib\fuegopapi-client.jar piic.Class1
    Creating connector [fuego:SQL]
    Creating ProcessService with id 'oracle/2009-03-31 18:08:47+08:00'.
    Creating local folder: /tmp\system\Schema3387192-1796619082\catalogs
    Loading catalogs from local folder: /tmp\system\Schema3387192-1796619082\catalogs
    0 jars found locally.
    [CatalogMgrCache] =======================
    Registering CatalogMgr [oracle/2009-03-31 18:08:47+08:00] ...CatalogManagerCache 1465214:
    Managers:
    Counters:
    [CatalogMgrCache] =======================
    CatalogMgr [oracle/2009-03-31 18:08:47+08:00] REGISTERED!CatalogManagerCache 1465214:
    Managers:
    {oracle/2009-03-31 18:08:47+08:00=fuego.util.LocalCatalogManager@1d0d124}
    Counters:
    ProcessService 'oracle/2009-03-31 18:08:47+08:00' created successfully.
    ProcessID: /InvokeJava2#Default-1.0
    ProcessID: /Process#Default-1.0
    ProcessID: /ProcessB#Default-1.0
    ProcessID: /Processwithoutglobalstart#Default-1.0
    ProcessID: /Testprocess#Default-1.0
    Unreachable Engine Tolerance (seconds):
    by default: 0
    to be used: 0
    This papi client will not cache exceptions which imply that an engine could not be reached.
    Adding local catalog for project: 163
    Processing the synchronization information, instance '163:247:0' was created.
    49-----------
    ProcessID: /InvokeJava2#Default-1.0
    instance.getId()-> /InvokeJava2#Default-1.0/242/0
    Adding local catalog for project: 162
    activity.getActivityId()-> /InvokeJava2#Default-1.0/tojava
    activity.getActivityName()-> tojava
    ProcessID: /Process#Default-1.0
    ProcessID: /ProcessB#Default-1.0
    ProcessID: /Processwithoutglobalstart#Default-1.0
    instance.getId()-> /Processwithoutglobalstart#Default-1.0/243/0
    activity.getActivityId()-> /Processwithoutglobalstart#Default-1.0/Interactivejcooper
    activity.getActivityName()-> Interactivejcooper
    instance.getId()-> /Processwithoutglobalstart#Default-1.0/244/0
    activity.getActivityId()-> /Processwithoutglobalstart#Default-1.0/Interactivejcooper
    activity.getActivityName()-> Interactivejcooper
    instance.getId()-> /Processwithoutglobalstart#Default-1.0/247/0
    Session 'jcooper7676692326836000001' has been closed.
    activity.getActivityId()-> /Processwithoutglobalstart#Default-1.0/Interactivejcooper
    activity.getActivityName()-> Interactivejcooper
    instance.getId()-> /Processwithoutglobalstart#Default-1.0/246/0
    activity.getActivityId()-> /Processwithoutglobalstart#Default-1.0/Interactivejcooper
    activity.getActivityName()-> Interactivejcooper
    instance.getId()-> /Processwithoutglobalstart#Default-1.0/245/0
    activity.getActivityId()-> /Processwithoutglobalstart#Default-1.0/Interactivejcooper
    activity.getActivityName()-> Interactivejcooper
    ProcessID: /Testprocess#Default-1.0
    [CatalogMgrCache] =======================
    Unregistering CatalogMgr [oracle/2009-03-31 18:08:47+08:00] ...CatalogManagerCache 1465214:
    Managers:
    {oracle/2009-03-31 18:08:47+08:00=fuego.util.LocalCatalogManager@1d0d124}
    Counters:
    {oracle/2009-03-31 18:08:47+08:00=1}
    [CatalogLoaderMgr] unregisterCatalogMgr freeing resources of LocalCatalogManager
    [CatalogMgrCache] =======================
    CatalogMgr [oracle/2009-03-31 18:08:47+08:00] UNREGISTERED!CatalogManagerCache 1465214:
    Managers:
    Counters:
    Process exited with exit code 0.

    I don't know what happens. It works after I restart BPM studio in 2 hours.

  • Create multiple instance in a database

    is it possible to create multiple instance in a database.if possible then is it possible to activate many instance at a time.(in personal edition)

    Instance in Oracle refers to the Oracle database "engine" - a collection of processes using a shared memory area, accessing a physical Oracle database.
    Multiple instances are possible on the same platform for different physical databases. But not a Good Idea..
    Multiple instances on different platforms are for the same physical database using Oracle Real Application Clusters, aka Oracle RAC.
    Thus your question does not make a lot of sense. My guess is that you are in fact refering to an Oracle session instead as this is "in the database" as you refered to.
    Each client that connect to Oracle, creates/establishes an Oracle session. A single client uses one (usually the default) or more sessions (usually used by a multi-threading client).
    By default, the Oracle Instance supports multiple Oracle (client) sessions. Including Personal Oracle. In the past, Personal Oracle limited (via the Listener) the number of remote clients (i.e. clients on other platforms) that can connect. I would assume that this is still the case. I however do not recall that there were a limit imposed on the number of local sessions that could be created - the limiting factor here is afterall the power and resources available by the PC. It's very unlikely that a common PC will be able to support a Personal Edition Oracle instance and 100's of local client sessions at the same time.
    If you do mean instance as per the strict Oracle definition - why would you want to create two Oracle instances (each with its own physical database) on a PC? That does not make sense on a large db server platform. It makes even less sense on a small PC platform.
    Each Oracle instance has overheads (processing and memory). Each physical Oracle database has overheads (system space, temp space, redo, logs, etc). Why duplicate these overheads?
    On a single platform - what can two Oracle instances (less capable because of reduced resources availability) do what a single Oracle instance cannot do faster and better and more effectively? Thus is it not a Good Idea to run multiple instances on a single platform. (exceptions acknowledged)

  • "cannot create jbcd driver of class " for connect URL 'null'" error

    I am trying to get an application that is currently working fine on a Windows platform to work in a Linux environment.
    One thing that is different from my setup in Windows, and also one that I have no experience with, is the Linux-Ubuntu default install of Apache uses Virtual Hosts and Tomcat's equivalent multiple sessions.
    I'm running the app out of the usr/share/tomcat6/webapps/msgboard instance of Tomcat vs var/lib/tomcat6.
    I am calling the application from Apache Virtual Host port 80 using mod_jk. The application cannot run under native Tomcat because of the extensive use of PHP. Everything else in the application is working correctly including a DWR (Ajax) servlet. However I also tried a simple test app from native Tomcat and got the same results.
    I also tried connecting with jdbc:mysql://localhost:3306/msgboard?autoreconnect=true&user=root&password=password at the terminal prompt and got
    bash: jdbc:mysql://localhost/msgboard?autoreconnect=true: No such file or directory
    [1]7074
    [2] 7048
    [1] Exit 127 jdbc:mysql://localhost/msgboard?autoreconnect=true
    [2]+ Donesyslog error is
    Feb 23, 2009 3:01:51 PM org.directwebremoting.util.CommonsLoggingOutput info INFO: Exec: Online.getPosts()
    Feb 23 15:01:51 ubuntu jsvc.exec[6779]: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Feb 23 15:01:51 ubuntu jsvc.exec[6779]: Caused by: java.sql.SQLException: No suitable driverFollowing is all the pertinent setup info for reference and critique. Any suggestions would be greatly appreciated.
    Apache2.2
    Tomcat6
    JDBC
    mod_jk
    Java (not sure what ver, it's the default Ubuntu install ver.)
    PHP
    Currently I am pointing to mysql-connector-java.jar in my CLASSPATH at /usr/share/java/mysql-connector-java.jar added symlinks commons-dbcp.jar, commons-logging.jar to usr/share/tomcat6/lib
    Application is deployed from usr/share/tomcat6/webapps/msgboard
    The basic code snippet in class calling the jdbc
    WEB-INF/classes/dbLink.class
    Context ctx = new InitialContext();
    DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/msgboardDB");
    WEB-INF/web.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app id="msgboard">
    <display-name>Message Board</display-name>
    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/msgboardDB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    META-INF/context.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <Context path="/msgboard" docBase="msgboard"
    debug="5" reloadable="true" crossContext="true">
    <Resource name="jdbc/msgboardDB"
    auth="Container"
    type="javax.sql.DataSource"
    maxActive="100"
    maxIdle="30"
    maxWait="10000"
    username="root"
    password="thePassword"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/msgboard?autoReconnect=true"/>
    </Context>
    I also included a symlink to this in var/lib/tomcat6/config named msgboard.xml
    per instruction at http://ubuntuforums.org/showthread.php?t=430133 and have since removed it.
    my.cnf
    [client]
    port = 3306
    bind-address = 127.0.0.1
    permissions set in /etc/tomcat6/policy.d/04webapps.policy
    permission java.net.SocketPermission "127.0.0.1:3306", "connect,resolve,listen,accept";
    per instruction at http://ubuntuforums.org/showthread.php?t=430133
    other permiissions set /etc/tomcat6/policy.d/50local.policy
    grant codeBase "file:/usr/share/tomcat6/webapps/msgboard/-" {
    permission java.net.SocketPermission "127.0.0.1:3306", "connect,resolve,listen,accept";
    grant codeBase "file:/usr/share/tomcat6/webapps/msgboard/WEB-INF/classes/-" {
    permission java.io.FilePermission "/usr/share/tomcat6/webapps/msgboard/WEB-INF/classes/logging.properties", "read";
    grant codeBase "jar:file:/usr/share/tomcat6/webapps/msgboard/WEB-INF/lib/mysql-connector-java-5.1.6.jar!/-" {
    permission java.net.SocketPermission "127.0.0.1:3306", "connect,resolve,listen,accept";
    I even tried setting Tomcat Security to "no" per instruction at
    http://webui.sourcelabs.com/ubuntu/mail/user/threads/Tomcat_connecting_to_MySQL_-Ubuntu8.10_Server.meta
    http://ubuntuforums.org/showthread.php?t=1034957&highlight=apache+tomcat+jdbc
    http://ubuntuforums.org/showthread.php?t=66615
    http://ubuntuforums.org/showthread.php?t=33601&highlight=java+mysql
    http://ubuntuforums.org/showthread.php?t=430133
    http://programminglinuxblog.blogspot.com/2008/03/connection-pooling-with-java-all.html
    http://webui.sourcelabs.com/ubuntu/mail/user/threads/Tomcat_connecting_to_MySQL_-Ubuntu8.10_Server.meta

    SOLUTION
    I had to add
    <Resource name="jdbc/webappDB"
         auth="Container"
         type="javax.sql.DataSource"
            maxActive="100"
         maxIdle="30"
         maxWait="10000"
            username="root"
         password="password"
         driverClassName="com.mysql.jdbc.Driver"
            url="jdbc:mysql://localhost:3306/webapp?autoReconnect=true"/>into /var/lib/tomcat6/conf/Catalina/localhost/ webapp.xml
    Note: the above context file was created automatically after deploying the webapp. I had to add the <resource> to it.
    The context I created in usr/share/tomcat_home/webapp/META_INF/context.xml is still there and has the same <resource>.defined in it. I did not verify whether or not it still needs to be there.
    After that I had to add two policies
    /var/lib/tomcat6/conf/policy.d/03catalina.policy
    grant {
    permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.dbcp.*";
    and 04webapps.policy
    permission java.net.SocketPermission "127.0.0.1:3306", "connect,resolve,listen,accept";
    That did the trick!
    Other things that were done but have not been verified as to have any bearing on this issue.
    I changed the active java from openjdk to java-sun
    I added $tomcat_home/lib:$tomcat_home/lib/mysql-connector.jar:$tomcat_home/lib/commons-dbcp.jar to PATH
    Changed CLASSPATH=usr/share/classpath:usr/share/java/commons-dbcp.jar:usr/share/java/mysql-connector.jar
    Edited by: wlbragg on Feb 25, 2009 12:58 AM
    Edited by: wlbragg on Feb 25, 2009 12:59 AM
    Edited by: wlbragg on Feb 25, 2009 1:11 AM

Maybe you are looking for

  • Why can't I use face time on my iPad when it's all turned on

    I have always been able to use face time on my iPad mini but it won't let me now, please help?

  • How to copy the data in a cube to another cube

    Hi ,I created one cube by copying.Now I want the data available in earlier cube to Copied Cube.Plz can any one help in this. Thanx in Advacnce Vasu

  • Creating a File Adapter in XI 3.0

    Hi I want to use the File adapter in XI 3.0 to generate a file on my server. Is there any detailed!!! step by step guide where I can read about this? I have created a business service, a communication channel, interface determination and a receiver d

  • Planned Order for Purchased Parts W/o using MRP

    Hi All,    I want to create the New Planned Order which I want to convert it to Pur. req. and then further convert it to Purchase Order.     But I don't want to run the MRP for the same. And also we have maintained ND (No planning) in MRP1.    It is

  • IPhone 4S freezes when connected to iTunes

    Hi all, Here's what's been happening: just got an iPhone 4S handed down to me from my dad about a week ago.  Initial set-up process went just fine, and I was able to transfer music onto it no problem.  However, starting yesterday, every time I plug m