A bug in creator when creating jdbc jndi connection

Hi,
I am using sun java studio creator for jdbc jndi connection. The syntax is
Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/mydb");
conn = ds.getConnection();
It's failed. Once I change to ctx.lookup("jdbc/mydb") and the connection is created.
Once deployed to tomcat, it seems only java:comp/env/jdbc/mydb is working.
The full path(java:comp/env/jdbc/mydb) seems right from my google search.
Why creator using jdbc/mydb? Is it a bug to creator?
Thanks,
Jie

I mean a resource reference in web.xml file that looks like this:
     <resource-ref id="ResourceRef_1103225373500">
          <res-ref-name>DBConnection</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Application</res-auth>
          <res-sharing-scope>Shareable</res-sharing-scope>
     </resource-ref>
where DBConnection is the resource alias I mentioned before:
DataSource ds = (DataSource)ctx.lookup("java:comp/env/DBConnection");
Using WebSphere a binding between this above defined ResourceRef and JNDI mapping must be defined in a file called ibm-web-bnd.xmi. The content of this file will look like this:
<?xml version="1.0" encoding="UTF-8"?>
<webappbnd:WebAppBinding xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:webappbnd="webappbnd.xmi" xmi:id="WebAppBinding_1" virtualHostName="default_host">
<webapp href="WEB-INF/web.xml#WebApp"/>
<resRefBindings xmi:id="ResourceRefBinding_1103225373500" jndiName="jdbc/mydb">
<bindingResourceRef href="WEB-INF/web.xml#ResourceRef_1103225373500"/>
</resRefBindings>
</webappbnd:WebAppBinding>
Obviously using WSAD all of that could be done using IDE. In your case and using Sun IDE, I am not sure. But this is basically the concept of needed mapping in order to reference your JNDI without getting an error. At least this is how we resolved the error you are encountering.
Hope that helps!

Similar Messages

  • CR4E - New JDBC (JNDI) connection at runtime

    Is it possible to create a new JDBC (JNDI) connection at runtime using the propertyBag to set the attributes?  I tried this but received error message stating "error finding jndi name".

    Are you specifying a JDBC or JNDI connection?
    If JDBC, did you set the (Optional) JNDI Connection property?
    If you set the JNDI property for the JDBC connection, it'll try connecting to the JNDI.
    The JDBC has the optional JNDI property, so that you can design a report against JDBC, then use the JNDI when deployed to a J2EE.
    Sincerely,
    Ted Ueda

  • JDBC(JNDI):Connection dinamically managed

    Hi all,
    I'm using
    1) Crystal Reports 2008 for the reports' design,
    2) Java Reporting Component (version 18.8.4.1094) for the integration in java environment,
    3) JBoss (version 4.2.3) as Application Server
    4) Oracle 11 as DBMS
    in a web application.
    When I create a report using JDBC (JNDI) and specify as the "Connection Name (optional)" the following string "java:jdbc/name_data_source",
    How is managed the connection of the report and any sottoreports? In other words are the connections dynamically managed by the container web or ejb?
    Thank you very much.

    Hi, Andrea,
    I'm gonna' make a few guesses here:
    2) Java Reporting Component (version 18.8.4.1094)
    I think you mean Crystal Reports for Java (CRJ) 2.8 version 12.2.209.1094. Neither the JRC (the name for the 1.x series) nor the CRJ (the 2.x series) has any version number in the 18.x range.
    sottoreports
    I think that means "subreports."
    are the connections dynamically managed by the container web or ejb?
    There are two ways the connections can be managed. If you've created a JNDI connection (a named connection), then you can base a report off of it, then at a later date change where the JNDI connection itself points to and the report should still work correctly, as long as the new target database shares the same schema as the original.
    The other way you can manage the connection is to use code to change the database connection information inside the report itself. In this way, you could change it from one JNDI connection to another or even to another type of connection altogether. Again, however, the schemas between the old and the new connections must match.
    Regards,
    Bryan

  • Cannot connect MS SQL Server2005 by using JDBC(JNDI) connection

    Hi all,
    I met a problem when I was trying to create a JDBC(JNDI) connection in crystal report 2008, the following error dialog shows up, it said:
    Database Connector Error: 'SQL Exceptions: [SQL State:] S1000 [Error Message:] [Microsoft][SQL Native Client]Connection is busy with results for another command'
    here is the steps how to reproduce this problem:
    1) create a DSN(Data source name) in ODBC Data Source Administrator dialog, suppose the DSN is test
        (and the DSN test show it works well)
    2) start up Crystal Report 2008, click New to create a new report, the Standard Report Creation Wizard show up
    3) expand Create New Connection node, then double click JDBC(JNDI) note
    4) the JDBC (JNDI) dialog shows up, chooose JDBC Connection in the dialog, and fill the empty fields with:
       Connection URL: jdbc:odbc:test
       Database Classname:sun.jdbc.odbc.JdbcOdbcDriver
    5) click next, it comes to the next pannel, and fill the empty fields with:
        Database: MyTestDB
        UserID: sa
        Password: sa
    6) then click Finish buttion.
    7) a new connection is created, but when I expand the new created connection, an error dialog shows up
      Database Connector Error: 'SQL Exceptions: [SQL State:] S1000 [Error Message:] [Microsoft][SQL Native Client]Connection is busy with results for another command'
    does anyone knows what's wrong with my setting? any help would be appreciated.
    Best Regards
    Tian-liang

    Hi Tian-liang,
    Try using Microsofts JDBC driver rather than Suns. Also search these forums, other have run into the same issue.
    Thank you
    Don

  • How do we create a jndi connection in crystal reports XI

    how do we create a jndi connection in crystal reports XI when the data soiurce is configured on websphere 6.1

    You need to use WLST online. I am not sure what your exact requirements are but one good way of working this is to have a WLST script that deletes all your WL customisations, like connection pools, JMS Servers etc and then creates it. That way you can run the same script repeatedly and it will get everything up to date for you. However you have to remember that everytime you add something new you need to update your delete section. Also your deleting should not fail if the item does not exist. I hope that makes sense!
    As to the specifics of WLST examples to do this then check out the WLST examples in CodeShare.
    If you are still having issues then post another message.
    Geoff

  • How to configure jdbc/jndi connection in crystal report 10

    Post Author: effy
    CA Forum: Data Connectivity and SQL
    i have tried to configure jdbc/jndi connection , i have both
    drivers  data base side and  crystal report side but i
    can't  configure it.  so please help if u know
    something. 

    Sorry, but I'm not on a home pc, I'm working on a virtualized pc with a long chain of permissions ... so I cannot simply download and run an utility...
    Instead... I think (I WAS thinking) someone from SAP can tell me this info ... Probably I'll buy a paid assistance ticket... But really it's a strange thing that a simply connection from a (so) paid software need a so difficult problem solving routine..
    I edited my environment variales: JAVA, PATH; CLASSPATH; JAVA_DIR, and a long list of others ... to ALL point to ALL of directory containing used jars...
    .. I asked my SysAdmin to edit CrConfig.xml and it's done ... classpath are rights, jdbc infos are also ok, ...
    .. but none ...

  • Got Error when creating application server connection

    Hi Guys...I am using SOA 10.1.3.1.0
    I got the following error when creating application server connection
    In Step 1:
    I selected the Connection type as Standalone OC4J 10.1.3 (Why because I use this one)
    In Step 2:
    In this step I gave username and password (same username and password to connect to BPEL console)to authenticate connection
    In step 3:
    It is asking for Hostname, RMI port and URL path. My computer name is gopal-computer. I gave this hostname. RMI port number is 23791 by default. I kept this one as it is and URL path optional I think. I did not give any thing.
    In step 4:
    When I hit the test connection button its giving the following error
    Error while getting remote MBeanServer for url: ormi://gopal-computer:23791/default:
    Error reading application-client descriptor: Error communicating with server: Connection refused: connect; nested exception is:
         javax.naming.CommunicationException: Connection refused: connect [Root exception is java.net.ConnectException: Connection refused: connect]
    Please help me.
    Thanks,
    Gopal.....

    For SOA Suite connection you should choose "Oracle application server 10g 10.1.3"

  • Security Error when creating new db connection

    I have a SQLJ class that creates an explicit connection to the database using the following line of code:
    DefaultContext ctx1 = Oracle.getConnection("jdbc:oracle:thin:@machine_name:1526:sid", userName, password);
    This code works fine when run from the command line, but when the class is loaded into the database and run from inside the database, I get the following error message on the above line:
    java.security.AccessControlException: the Permission (java.net.SocketPermission machine_name resolve) has not been grant
    ed by dbms_java.grant_permission to SchemaProtectionDomain(userid|PolicyTableProxy(userid))
    I am unable to find any information on this error or on the dbms_java.grant_permission package. Any ideas would appreciated.
    Richard.
    null

    I believe you get something like a 30-day full-functioning "trial" from the licensed install discs before you're locked out, if you don't activate over the Internet. It used to be a more manual process, but with CS4, it's done during install as long as you do have a live Internet connection. Again, from the information, it's hard to tell what's actually happening (ie. what's the message box that appears say?), but you could try plugging into the Internet and then going to Help > Activate from any of the suite apps.

  • Possible iOS 5 bug - "Open iTunes when this iPod is connected" using 200 MB

    A strange bug with either iOS 5 or iTunes 10.5 that does not look like it was discussed - I couldn't pull anything up in a search.
    I've noticed that ever since upgrading to iOS 5, the amount of free space on my iPod Touch (3rd G) reported both in iTunes and on the iPod itself decreased by about 2 GB compared to what I had had free under iOS 4.3.
    Originally I attributed it to the fact that iOS 5 happened to be larger in size, until I noticed that I gained about 200 MB by unchecking the "Open iTunes when..." option.  See the following two screenshots:
    The strange part is that the "missing" 200 MB is somehow attributed to "Audio" - also notice the difference in reported Audio size between the two images.
    As a comparison, my iPad is still running iOS 4.3.5.  I checked and unchecked that option in iTunes when the iPad was connected, and there was no change in reported capacity whatsoever.
    Does anyone have an idea as to what the cause of this may be?  Has anyone else experienced this and/or submitted a bug report to Apple software engineers?
    Thanks,
    Steve

    iTunes freezes to the point that I must CtrlAltDel to exit it. It never did this before, but recently it has started doing this. I've had it for 13 months, so no warranty.
    I have tried it in iTunes 7.5 on windows Vista and in iTunes 7.4 on Windows XP. Same issue either way.
    Thanks for your prompt reply!

  • UIView.dll Terminating! error in Designer when creating a BW connection

    Impossible to create a new BW connection in Designer without having designer crashing.
    In the designer logs the following error is showing !!!!!!UIView.dll Terminating!
    Creating a new connection based on any other data provider type does work only when this is based on Bex query then does the error occured.
    Customer is using Serveur :
    Server is AIX
    BOXI 3.1 - sp3
    Integration kit sp3
    Transport have been imported in SAP
    BW version 7.01
    Initially they were on Designer BOXI 3.1 FP 1.4 (where it worked) and have upgraded using
    ENTRPRSECLNTTLS01_4-10007443.exe
    ENTERPRISECLNT03_0-10007619.EXE
    They have desinstalled and reinstalled designer and integration kit.
    Installed on a brand new machine and the error is still there.
    Same error in standalone mode
    Tried to test from my machine in standalone mode and cannot reproduced the error.
    Customer has tried as well creating connection using ''Use Single Sign On when refreshing reports at view time'' crashes designer, it does not matter what user they use at all it is the same all time.
    Same on different client machine too.
    Any idea ? Anyone has encounterred the same problem
    MDA logs are showing
    'Failed to locate the LogFormat settings in the registry. In this case, the LogFormat will use the default format.'
    Thanks
    Steph

    HI Stephanie:
        Hopping you solve that customer's issue, I would like to ask you if you found the source of the error.
         Even I am trying something different than yours, I am  having the same issue as your customer.
         One MDA.LOG file is created with the same message multiple times in multiple lines. The file has not other message and the message is :
    'Failed to locate the LogFormat settings in the registry. In this case, the LogFormat will use the default format.'
    We got a BoXi 3.1 server on Windows 2003 using a CMS database in a windows MS-SQL 2005 server SP4.
    Installing BOXi 3.1SP3 the connection server did not start and the MDA.LOG wsa created. Uninstalling SP3 from it, the Connection server start, but the MDA.log is being created again.
    Could you let me know if you solved and what this MDA.log means? Thanks
    Reinaldo

  • Junit : how to create JDBC URL connection

    hi folks,
    I am implementing JUnit in my application , for that I have seen srdemo application every thing is fine but i havent get how to configure JDBC URL connection 'SRServiceLocalTesting' ? can any body tell me how to do it.
    Thanks in advance
    Regards
    Pravin

    Hi,
    Have a look,
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_xml-to-table/odi_project_xml-to-table.htm
    Thanks,
    Guru

  • Server Exception when using JDBC to Connect with SAP

    Hello,
    I am trying to connect to a view in an external database using JDBC. When I run the TestJDBC Tool, I get the following server exception:
    com.microsoft.sqlserver.jdbc.SQLServerException: ?? ?? '<view_name>'?(?) ???????.
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(Unknown Source)
        at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(Unknown Source)
        at com.sap.ip.bi.sdk.trialarea.connector.servlet.model.JDBCModel.getColumns(JDBCModel.java:202)
        at com.sap.ip.bi.sdk.trialarea.connector.servlet.controller.Control3.doPost(Control3.java:25)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
        at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
        at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
        at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
        at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
        at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
        at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
        at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
        at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
        at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
        at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
        at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
    The question marks really make it difficult to determine exactly what the issue is.
    Is there a way to perform a trace or to determine what is going on? Our third party provider has already confirmed that the authorization they provided is correct and is working.
    Thanks!

    Yes you can run a profiler trace on the SQL Server and include the "User Error Message" event under "Errors and Warnings".  This will show you the error message that SQL Server is sending to the client.
    When you get it, post it here because this is might be a bug in our JDBC driver that it does not turn that error into a sensible com.microsoft.sqlserver.jdbc.SQLServerException.
    David
    David http://blogs.msdn.com/b/dbrowne/

  • How to specifiy the provider to be Oracle.ManagedDataAccess.Client when creating a dynamic connection string with EF Code First from Database?

    I am trying to use the relatively new Code First from Database with the newest EF (6.x) and on an Oracle database (11g, but I have installed the newest ODTwithODAC). First of all, it works fine as long as the connection string is inside the App.Config file. But when I try to build it dynamically in the C# code (or rather, statically at the moment) it fails. I have it working with a dynamically built connection string when doing Model from Database though, so I'm at a loss right now.
    First, I have created a second constructor for the context class that takes a string and does base(connectionString). Then I build the connection string via
    OracleConnectionStringBuilder oracleBuilder = new OracleConnectionStringBuilder();
    oracleBuilder.DataSource = "TEST.BLA.COM";
    oracleBuilder.UserID = "ABC";
    oracleBuilder.Password = "abc";
    oracleBuilder.PersistSecurityInfo = true;
    string connection = oracleBuilder.ToStrin();
    Now trying to open an EntityConnection by giving to it this provider-specific connection string (or even the static one from the App.Config) doesn't work; I get "keyword not supported: user id"). Trying it by creating a context and giving this connection string doesn't work either. I'm pretty sure that this is because I didn't specify the provider to use; after all, it should use the Oracle.ManagedDataAccess.Client provider and not an SQL Server based one.
    I then tried to get around this by using an EntityConnectionStringBuilder on top and specifying the provider keyword there, but then I get "keyword not supported: provider" when using it in the context constructor, and "the 'metadata' keyword is always required" when using it with the EntityConnection constructor.
    As I said above: I bet it's the provider that I have to specify somehow, but I don't know how. The code that does work is the following:
    using (var context = new Model())
    context.Database.Connection.Open();
    context.Database.Connection.Close();
    When I read context.Database.Connection.ConnectionString, it is exactly the provider-specific connection string I created above, but I don't know where to specify the provider again. Do you know of any way to do this? Certainly there must be one.
    PS: I have also posted this question on http://stackoverflow.com/questions/27979454/ef-code-first-from-database-with-managed-oracle-data-access-dynamic-connection because it is quite urgent and I'd like to use Code First from Database. Otherwise I'd have to go "back" to using Model from Database again, which is not ideal because we have updatable views where the .edmx-file has to be edited after every reload of the model, while with Code First from DB inserting into the view automatically works.

    I am trying to use the relatively new Code First from Database with the newest EF (6.x) and on an Oracle database (11g, but I have installed the newest ODTwithODAC). First of all, it works fine as long as the connection string is inside the App.Config file. But when I try to build it dynamically in the C# code (or rather, statically at the moment) it fails. I have it working with a dynamically built connection string when doing Model from Database though, so I'm at a loss right now.
    First, I have created a second constructor for the context class that takes a string and does base(connectionString). Then I build the connection string via
    OracleConnectionStringBuilder oracleBuilder = new OracleConnectionStringBuilder();
    oracleBuilder.DataSource = "TEST.BLA.COM";
    oracleBuilder.UserID = "ABC";
    oracleBuilder.Password = "abc";
    oracleBuilder.PersistSecurityInfo = true;
    string connection = oracleBuilder.ToStrin();
    Now trying to open an EntityConnection by giving to it this provider-specific connection string (or even the static one from the App.Config) doesn't work; I get "keyword not supported: user id"). Trying it by creating a context and giving this connection string doesn't work either. I'm pretty sure that this is because I didn't specify the provider to use; after all, it should use the Oracle.ManagedDataAccess.Client provider and not an SQL Server based one.
    I then tried to get around this by using an EntityConnectionStringBuilder on top and specifying the provider keyword there, but then I get "keyword not supported: provider" when using it in the context constructor, and "the 'metadata' keyword is always required" when using it with the EntityConnection constructor.
    As I said above: I bet it's the provider that I have to specify somehow, but I don't know how. The code that does work is the following:
    using (var context = new Model())
    context.Database.Connection.Open();
    context.Database.Connection.Close();
    When I read context.Database.Connection.ConnectionString, it is exactly the provider-specific connection string I created above, but I don't know where to specify the provider again. Do you know of any way to do this? Certainly there must be one.
    PS: I have also posted this question on http://stackoverflow.com/questions/27979454/ef-code-first-from-database-with-managed-oracle-data-access-dynamic-connection because it is quite urgent and I'd like to use Code First from Database. Otherwise I'd have to go "back" to using Model from Database again, which is not ideal because we have updatable views where the .edmx-file has to be edited after every reload of the model, while with Code First from DB inserting into the view automatically works.

  • Error When Creating BPA Server Connection in Jdeveloper

    Hi,
    I am trying to explore the concept of BPA Suite. I have created a BPMN process and enabled the option 'Share Blueprint with' under SOA. But when i am trying to make a BPA Server Connection in JDeveloper it is showing error like 'Connection Failed'. I am using Local Repository. Could you please help me on this issue.
    Thanks,
    Anju

    Yes, you can choose XE at installation time for the LOCAL database in BPA (ARIS). And, since you say you do connect from BPA before trying to connect from JDev, we know the database is up.
    One more thing to check is that both are the same version (10.1.3.4, hopefully).
    When do you see the connection failed during the setup? It is after you select "local server"? That is, can you see your BPA database (project) show in the drop down and you get the error when you enter the BPA credentials? Or, do you get the error selecting local server in the first place? If so, you should see if you can get a Database connection from JDev to the database on XE - it may be that JDev can't find the database for some reason (proxy settings perhaps).
    Heidi.

  • OC4J 1.0.2.2.1 Creating 2 JNDI Contexts

    Hello,
    I have a problem when creating two JNDI contexts.
    I've got a very simple class that creates 2 contexts serially with 2 separate property objects.
    But the 2nd context seems to be being created with the first properties object. And yes I am closing the first.
    Here is it
    public class TestLookup
    private static void lookup(String name, String password)
    InitialContext ctx = null;
    try
    Properties p = new Properties();
    p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    p.setProperty(Context.PROVIDER_URL, "ormi://localhost:23791");
    p.setProperty(Context.SECURITY_PRINCIPAL, name);
    p.setProperty(Context.SECURITY_CREDENTIALS, password);
    ctx = new InitialContext(p);
    ctx.lookup("Security");
    System.out.println("finish");
    catch (Exception e)
    try
    if (ctx != null)
    ctx.close();
    System.out.println("ctx closed");
    catch (Exception e2)
    e2.printStackTrace();
    e.printStackTrace();
    public static void main(String[] args)
    lookup("123", "admin");
    lookup("admin", "admin");
    Here is the output
    ctx closed
    java.lang.SecurityException: Invalid username/password for default (123)
    etc....
    ctx closed
    java.lang.SecurityException: Invalid username/password for default (123)
    etc....
    Any ideas anyone

    This may be problem with your userid/password. Please look the $OC4J_HOME/j2ee/home/config/principals.xml whether you have a right userid password.
    I did a quick test at looking up at "jdbc/OracleDS" for two users admin and SCOTT and this works fine both in 1.0.2.2.x an 9.0.2
    I got your errors when I had wrong passwords for these users
    regards
    Debu

Maybe you are looking for