Config JDBC/DATASOURCE/JNDI for NT 4.0/DB2 6.1/Weblogic 6.0

Hi, i got a problem to access a database "ESAV1" using jdbc. I can do it using
the DriverManager : "try { Class.forName("COM.ibm.db2.jdbc.net.DB2Driver"); String
url = "jdbc:db2://javaserv1:6789/ESAV1"; Connection con = DriverManager.getConnection(url,
"db2admin", "db2admin");
// Create a Statement java.sql.Statement stmt = con.createStatement();
// Select des pays : java.sql.ResultSet rset = stmt.executeQuery("select distinct
NOM, ZONE from ER_PAYS ORDER BY NOM ASC"); ..." This works all right. NOW I want
to use a datsource to optimize the performance of my application. First Problem
: i want to put attributes to my web application (I did on Websphere and it worked).
When i try to configurate them in the web.xml file as context-param, it does not
work : "<web-app> <context-param> <param-name>datasource</param-name> <param-value>ESAV</param-value>
</context-param> <context-param> <param-name>password</param-name> <param-value>db2admin</param-value>
</context-param> <context-param> <param-name>userid</param-name> <param-value>db2admin</param-value>
</context-param>... " When I put directly in my java code (in the "init" method
" of my servlet), it does not work either: "password = (String) this.getServletContext().getAttribute("password");
if (password == null){ password = "db2admin";} userid = (String) this.getServletContext().getAttribute("userid");
if (userid == null){userid = "db2admin";} Hashtable env = new Hashtable(); Context
ctx = null; env.put(Context.PROVIDER_URL, "t3://telajava1:7001 env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
String dataSrcName =(String) this.getServletContext().getAttribute("datasource");
if (dataSrcName == null) {dataSrcName = "ESAV"; } try { ctx = new InitialContext(env);
String dbJndi = dataSrcName; ds = (DataSource) ctx.lookup(dbJndi); ...." This
gives me null for the attributes "datasource" "userid" and "password" (using getServletContext).
Then when I give them values, the ctx and ds values are : javax.naming.InitialContext@27ff0d
and weblogic.jdbc.common.internal.RmiDataSource@62ba99 but ther is no response
to "...Connection conn = com.eroaming.Controller.ds().getConnection(db2admin,db2admin);
.." and no error message...it just blocks...! If somebody can help me with those
troubles I would be very thankful.
ps : 1.the JDBC Connection Pools Configuration : NAME : driverERoaming URL : jdbc:db2://javaserv1:6789/ESAV1
DRIVER CLASS NAME : COM.ibm.db2.jdbc.net.DB2Driver PROPERTIES : language=fr_FR
2. the JDBC Data Sources configuration : Name: ESAV JDNI NAME :ESAV POOL NAME
:driverERoaming
3. My DataBase Configuration : NAME : ESAV1 user : db2admin password : db2admin
BEA is on the host : telajava1 DB2 is on the host : telaserv1

6.1 did not implement the final version of the Servlet 2.3 specification, that's
          why you see differences.
          http://edocs.bea.com/wls/docs61/notes/new.html#1064420
          Sanjeev <[email protected]> wrote:
          > Hi All,
          > I was using weblogic 6.1 and as my organization wants to go for 7.0, we
          > are in the process of evaluating 7.0 ver.
          > WL6.1 javax.servlet.filter interface provides the methods doFilter(), setFilterConfig(),
          > getFilterConfig(). We have an implementation for the Filter which also contains
          > a private method init(FilterCongig filterConfig).
          > In 7.0 javax.servlet.filter interface the methods are doFilter(), init(), destroy().
          > Because of the obvious reason i have a private implementation of init(FilterConfig
          > )in my code the build does not succeed. When i checked the java specifications
          > from Sun site I found 1.3.1 and 1.4(beta) specs provide doFilter(), init() and
          > destroy().
          > Question is: Is weblogic 6.1, JDK 1.3.1 compliant, if so why there is not init()
          > method in the filter interface??. (Otherwise its a bug)
          > Because of this the porting has become a serious issue as in some cases we need
          > to support both 6.1 and 7.0
          Dimitri
          

Similar Messages

  • Changing JDBC Datasource Configuration for Report with Sub reports at once

    The Env  details are as follows
    CR Developer
    Version 14.0.2.364 RTM
    We are using JDBC Connection Datasource for our CR2011 report which contains 30+ sub reports. Each of the sub report uses a JDBC Datasource to connect to Postgres database and Since the JDBC connection string changes on each environment we need to edit each sub report every time we switch environments.
    Is there a easy way to accomplish this on all sub reports at one shot?
    I am aware that if we use ODBC connection it would be easy since we can just change the DSN config and it will start working. But we are not using ODBC connection since We are seeing that our report (with too many sub reports) crashes when we use ODBC driver for Postgres.
    Any help/suggestion would be appreciated.

    Hello,
    CR also has a fully support Java Reporting Engine. If you have Java developers available check out this forum:
    SAP Crystal Reports, version for Eclipse
    You can find more info and samples from here:
    http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessIntelligence%28BusinessObjects%29+Home
    And help.sap.com for the SDK reference material.
    Don

  • JNDI lookup() for sql server jdbc datasource returns null

    Hi,
    I am trying to use a jdbc datasource in tomcat 5 to access a sql server 2000 database. I had many common problems and did found an answer to them in the forums but I'm having one last (I hope) problem. My program is also using a mySQL datasource and it works fine.
    The problem is that my lookup returns null. No exception, just null. It seems that many people had this problem but I didn't found any answer to it.
    This is the lookup code:
        Context ctx = new InitialContext();
        Context envCtx = (Context)ctx.lookup("java:comp/env");
        axaptaDS = (DataSource) envCtx.lookup("jdbc/axapta"); //returns null :(This my context.xml config:
    <ResourceParams name="jdbc/axapta">
        <parameter>
          <name>factory</name>
          <value>com.microsoft.jdbcx.sqlserver.SQLServerDataSourceFactory</value>
        </parameter>
        <parameter>
          <name>url</name>
          <value>jdbc:microsoft:sqlserver://hostname:1433</value>
        </parameter>
        <parameter>
          <name>password</name>
          <value>password</value>
        </parameter>
        <parameter>
          <name>maxActive</name>
          <value>4</value>
        </parameter>
        <parameter>
          <name>maxWait</name>
          <value>5000</value>
        </parameter>
        <parameter>
          <name>driverClassName</name>
          <value>com.microsoft.jdbcx.sqlserver.SQLServerDataSource</value>
        </parameter>
        <parameter>
          <name>username</name>
          <value>username</value>
        </parameter>
        <parameter>
          <name>maxIdle</name>
          <value>2</value>
        </parameter>
      </ResourceParams>And I also put these lines in my web.xml file:
    <resource-ref id="ResourceRef_1092254277306">
         <res-ref-name>jdbc/axapta</res-ref-name>
         <res-type>javax.sql.DataSource</res-type>
         <res-auth>Container</res-auth>
         <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>Thanks for helping!

    I finally found a remedy to this problem:
    specify this driver instead and remove the entry about the factory in the context's .xml file:
    com.microsoft.jdbc.sqlserver.SQLServerDriver

  • What is the method of getUserName() for JDBC DataSource in JDeveloper 11g.

    Hi All,
    I am facing a issue about getUserName() Method.
    The below method
      getDBTransaction().getConnectionMetadata().getUserName()
    working fine for JDBC URL While the  same method not working for JDBC DataSource.
    So What is optional method for getUserName() for JDBC DataSource,  I need  JDBC DataSource because in Our Standalone weblogic server we using data source.
    Maroof

    Hi Vohar,
    JNDI is there then how we can get user name you have any idea?
    Our Connection.xml look like below
                                        user                              oraJDBC                              1500                              192.168.0.0                              user1                                       thin                 

  • JDBC Datasource creation via ANT doesn't expose the JNDI name

    I'm using the wlconfig ANT task to create a Datasource (& JDBC connectionpool) on the weblogic server. The datasource is created fine, and I can test it using the console.
    The problem is that the provided JNDI name isn't exposed in the JNDI tree. This seems to be related to the fact that the following element is generated in the config/jdbc/CP-PoolName-2164-jdbc.xml
    &lt;jdbc-data-source&gt;
    &lt;name&gt;PoolName&lt;/name&gt;
    &lt;internal-properties&gt;
    *&lt;property&gt;*
    *&lt;name&gt;LegacyType&lt;/name&gt;*
    *&lt;value&gt;1&lt;/value&gt;*
    *&lt;/property&gt;*
    When removing the LegacyType 1 property from the JDBC config xml, the JNDI name is exposed fine.
    I've used the instructions located at [http://edocs.bea.com/wls/docs100/programming/ant_tasks.html] where an example of a JDBCConnectionPool creation is provided.
    The 10.3 documentation doesn't include the example anymore, but I'm having the problem both on BEA Weblogic 10.0 and Oracle Weblogic 10.3
    &lt;wlconfig url="t3://localhost:7001" username="weblogic" password="weblogic"&gt;
    bq. &lt;query domain="base_domain" type="Server" name="AdminServer" property="adminserver"/&gt;
    bq. &lt;create type="JDBCConnectionPool" name="MediumSecureOnlineNode1Pool" property="customPool1"&gt;
    bq. bq. &lt;set attribute="CapacityIncrement" value="1"/&gt; \\ &lt;set attribute="DriverName" value="oracle.jdbc.OracleDriver"/&gt; \\ &lt;set attribute="InitialCapacity" value="1"/&gt; \\ &lt;set attribute="MaxCapacity" value="10"/&gt; \\ &lt;set attribute="Password" value="pass"/&gt; \\ &lt;set attribute="Properties" value="user=username"/&gt; \\ &lt;set attribute="RefreshMinutes" value="0"/&gt; \\ &lt;set attribute="ShrinkPeriodMinutes" value="15"/&gt; \\ &lt;set attribute="ShrinkingEnabled" value="true"/&gt; \\ &lt;set attribute="TestConnectionsOnCreate" value="true"/&gt; \\ &lt;set attribute="TestConnectionsOnRelease" value="true"/&gt; \\ &lt;set attribute="TestConnectionsOnReserve" value="true"/&gt; \\ &lt;set attribute="TestTableName" value="SQL SELECT 1 FROM DUAL"/&gt; \\ &lt;set attribute="URL" value="jdbc:oracle:thin:@localhost:1521"/&gt; \\ &lt;set attribute="Targets" value="${adminserver}"/&gt;
    &lt;/create&gt;
    As we would like to automate the process of configuring our weblogic instances using ANT, is there a way to create JDBC datasources that don't have the LegacyType 1 element included in the config ?

    Curious if you were ever able to find a resolution to this issue?
    I am facing the same thing now with our Ant scripts and WL10.3 connection pools/datasources.
    I would like to either specify a different LegacyType or suppress it altogether. Any help would be appreciated.
    Many thanks,
    Steve

  • Jndi for datasource

    Hi
    Im using Jboss 4.2.1 and I've deployed a EJB that have a @PersistentContext. The Persistence.xml access this data-source:
    <jta-data-source>java:/MySqlDS</jta-data-source>The configuration for this data source is:
    <?xml version="1.0" encoding="UTF-8" ?>
      <datasources>
        <local-tx-datasource>
          <jndi-name>MySqlDS</jndi-name>
          <connection-url>jdbc:mysql://localhost/dbprojectx</connection-url>
          <driver-class>com.mysql.jdbc.Driver</driver-class>
          <user-name>root</user-name>
          <password>root</password>
          <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
          <metadata>
            <type-mapping>mySQL</type-mapping>
          </metadata>
        </local-tx-datasource>
      </datasources>It's works perfect... But if I try to access direct this datasource from jndi or create EntityManagerFactory with Persistence.createEntityManagerFactory I've got errror saying that there isnt a named for MySqlDS
    javax.naming.NameNotFoundException: MySqlDS not bound
         at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
         at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
         at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
         at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)My two codes that I've got erro
         public static void main(String[] args) {
              Persistence.createEntityManagerFactory("projectxDatabase");
         }and
         public static void main(String[] args) {
              Context ctx = new InitialContext();
                    Object ds = ctx.lookup("java:/MySqlDS");
         }Do u know what should I do?
    thanks

    hi guys
    even i am having the same problem. so pls let know if somebody has encounterd this problem before
    cheers

  • How to undeploy JNDI JDBC datasources?

    We have created JDBC DataSource in production server, and deleted as we were not able to start those JDBC oracle DataSource. but this DataSource are still there in JNDI registry.
    Is there way to undeploy JNDI JDBC datasources?
    Thanks,
    Nitesh Shelar.

    Closing....
    Solution Found None

  • Non-jdbc datasource for MapViewer

    Is it possible to specify a non-jdbc datasource for Oracle MapViewer?
    That is, if I want Mapviewer to access the database through my own data layer, or with an ORM, is it possible?
    Thanks,
    Rupesh

    I copied jdbcdrv.zip intp C:\Program Files\Sybase\SQL
    Anywhere 9\java
    and using Java page in CF admin, added C:\Program
    Files\Sybase\SQL Anywhere 9\java to classpath, restarted CF
    Application server.
    I then defined new datasources using existing ODBC dsns as
    described in
    http://www.ianywhere.com/developer/product_manuals/sqlanywhere/0902/en/html/dbpgen9/000001 52.htm
    (doesn't seem kosher but that's what my model showed).
    It's not exactly speedy but I've not gotten any errors yet
    (maybe because it isn't speedy)
    Anybody have any idea if there is another way that doesn't
    use anODBC dsn ?

  • JDBC Datasource problem in AM configrations

    Hi,jhon
    can u tell me the how to create the jdbcdatasource in WLS how we have to give the jndi name and i have changed in AM configration of JDBC Datasource but its not matching with jdbc datasource present in WLS can anyone tell me with the example how to create jdbc datasource
    May 7, 2009 8:01:38 PM oracle.adf.share.security.providers.jps.CSFCredentialStor
    e fetchCredential
    WARNING: Unable to locate the credential for key FOD in C:\Oracle\Middleware\use
    r_projects\domains\SFA\config\oracle.
    May 7, 2009 8:01:38 PM oracle.adf.share.jndi.ReferenceStoreHelper throwPartialRe
    sultException
    WARNING: Incomplete connection information
    May 7, 2009 8:01:38 PM oracle.adf.share.security.providers.jps.CSFCredentialStor
    e fetchCredential
    WARNING: Unable to locate the credential for key fod1 in C:\Oracle\Middleware\us
    er_projects\domains\SFA\config\oracle.
    May 7, 2009 8:01:38 PM oracle.adf.share.jndi.ReferenceStoreHelper throwPartialRe
    sultException
    WARNING: Incomplete connection information
    May 7, 2009 8:01:46 PM com.sun.faces.lifecycle.Phase doPhase
    SEVERE: jsf.lifecycle.phase.exception
    <May 7, 2009 8:01:46 PM GMT+05:30> <Error> <HTTP> <BEA-101017> <[weblogic.servle
    t.internal.WebAppServletContext@1d164ae - appName: 'application1', name: 'adfm',
    context-path: '/adfm', spec-version: '2.5', request: weblogic.servlet.internal.
    ServletRequestImpl@9a1336[
    GET /adfm/faces/br-o.jspx?_adf.ctrl-state=41665048_3 HTTP/1.1
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shock
    wave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd
    .ms-xpsdocument, application/xaml+xml, */*
    Accept-Language: en-us
    UA-CPU: x86
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.5072
    7; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
    Connection: Keep-Alive
    Cookie: oracle.uix=0^^GMT+5:30; JSESSIONID=QcJvKCwChv6V6Rx61T6hL1V7bvcbjGRtX9SCP
    2ydnrTLKtTW05c6!-595734161
    ]] Root cause of ServletException.
    oracle.jbo.DMLException: JBO-26061: Error while opening JDBC connection.
    at oracle.jbo.server.ConnectionPool.createConnection(ConnectionPool.java
    :253)
    at oracle.jbo.server.ConnectionPool.instantiateResource(ConnectionPool.j
    ava:168)
    at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:546)
    at oracle.jbo.pool.ResourcePool.useResource(ResourcePool.java:327)
    at oracle.jbo.server.ConnectionPool.getConnectionInternal(ConnectionPool
    .java:104)
    Truncated. see log file for complete stacktrace
    java.sql.SQLException: ORA-01005: null password given; logon denied
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.ja
    va:70)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:1
    16)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :177)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:406)
    Truncated. see log file for complete stacktrace
    >

    http://blogs.oracle.com/shay/2008/11/common_pitfalls_when_deploying.html

  • Connecting locally with BC4J and JDBC DataSource

    I have a BC4J project/module which I'm using as the data access layer for a web application, and that is deployed in 'local' mode on the OC4J server. In the config for the BC4J Module, I'm using the 'JDBC DataSource' connection type. When I deploy to OC4J, the appropriate entries are made in data-sources.xml and things run fine.
    W/in JDev, however, I'd like to be able to use the BC4J Tester and/or some local java classes (ie, run with a main method, outside the context of OC4J) to do some testing as I develop, including accessing the DB via my BC4J module, with the JDBC DataSource connection type. Currently, in order to run outside of the context of OC4J, I need to modify my config to use a connection type of 'JDBC URL' in order to successfully connect via the tester or via a main method driven class. (But then must be sure to change it back to 'JDBC DataSource' prior to redeploying.) If don't do this, and instead try to use the DataSource connection type, I get the errors "oracle.jbo.JboException: JBO-27200: JNDI failure. Unable to lookup Data Source at context jdbc/ADD_OWNER_DEV2DS" and "javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial" (among others)
    It seems pretty clear that I need to somehow/somewhere specify the context factory or such when running in JDev vs under OC4J, or somehow point the IDE to the local OC4J instance as the source of the info, etc?
    When trying to connect from the development environment, I have a local OC4J instance up and running, and I have what I think is an appropriate entry in data-sources.xml (I've tried this in 4 locations - j2ee\home\config, multi\system\oc4j-config, system9.0.3.1035\oc4j-config and as a new Data Sources Descriptor in the project.)
    Is there a way to set things up such that I can use the 'JDBC DataSource' connection type regardless of whether I'm running inside or outside of OC4J?
    Thanks,
    Jim

    Jim,
    You need some jndi implementation to bind(define) the datasource that can be looked up at runtime. Unfortunately, currently the only jndi implementation available in which you can bind datasources comes from oc4j. So you have to run in oc4j for using the datasource as your connection type.
    Dhiraj

  • Datasource & JNDI lookup...

    Another JDBC question.
    To lookup a JDBC datasource in my Websphere appserver i use JNDI. In various doc�s I�ve found they say that I should use the same DataSource object to retrive the connections so I don�t have to make a lookup everytime i want a java.sql.Connection object. So my question is, do I have to make the get method of the datasource synchronized or is it "thread safe"?
    Best regards
    Nick

    do u have an answe for this yet ?

  • Deployment using JDBC DataSource instead of JDBC URL

    Hello,
    I've noticed some strange behaviour when deploying an ADF application (11g, latest release) to a WLS (integrated or stand-alone), when using JDBC DataSource as a connection type for the application module.
    Normally, when you create your Business Components, a Database Connection is added to the Application Resources panel, eg MyConnection. If you then set your AM to JDBC DataSource instead of JDBC URL, the default datasource would be jdbc/MyConnectionDS. To make the application use the DataSource defined on the WLS, I then uncheck "Auto Generate and Synchronize weblogic-jdbc.xml Descriptors during deployment" in the Application Properties > Deployment tab.
    So far so good: after deployment to the WLS, the application uses the DataSource defined on the WLS server (jdbc/MyConnectionDS). When changing it on the server to another database, the application indeed uses this other database. Also, the following is automatically added to the web.xml during deployment to .ear file:
      <resource-ref>
        <res-ref-name>jdbc/MyConnectionDS</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
      </resource-ref>Now the part that doens't make sense to me: if I delete the password in the Database Connection under Application Resources, I can still deploy the application, but the jdbc/MyConnectionDS on the WLS is not found anymore. While it is still there. I get the following error message:
    Unable to lookup Data Source at context java:comp/env/jdbc/MyConnectionDS
    oracle.jbo.DMLException: JBO-27200: JNDI failure. Unable to lookup Data Source at context java:comp/env/jdbc/MyConnectionDS
    I made the JDev connection (used at development) invalid, and the deployed application stops working (at runtime). While it should just be using the JDBC DataSource defined on the WLS, that is still there. The reason appears to be that when there is no password in the Database Connection in JDev, the entry in the web.xml (see above) is not made during deployment.
    I am doing something wrong? Or is this "expected" behaviour?
    The reason why it bothers me: I have made a reusable component (a Data Control, let's call it A) from a model project, by deploying it to a ADF library JAR. I've set the AM of this project to use a certain jdbc datasource, which will be defined on the WLS.
    When importing the library JAR of A inside another application (B), the connection of the A is added to B. But ofcourse, without the password for security reasons, so we're in the situation described above: When I deploy the new application B, the web.xml is not updated with the DataSource of A, and the application doens't work. And what I would like to avoid, is that whenever someone uses component A, that they have to update the connection details of component A in application B. Because when I fill in the password of application A's Database Connection in application B, all works well again.
    I hope this question makes sense. :-)
    Thanks in advance,
    Chris

    Arun and Krithika,
    Thanks for your replies. I have already done what both of you suggested:
    Chris Schryvers wrote:
    I then uncheck "Auto Generate and Synchronize weblogic-jdbc.xml Descriptors during deployment" in the Application Properties > Deployment tab.I can get it to work, both for deployment on the internal WLS as on a stand-alone WLS.
    My only question is: why does a property at development time (the empty password of the JDev connection) influence the runtime behaviour (the JDBC DataSource not being found after deployment).
    Ofcourse, setting the password for the connection in JDev "solves" the problem. But I want to avoid that everyone who uses the reusable component needs to fill in the password for its database connection. In my opinion, that's the whole point of using a JDBC datasource instead of a JDBC URL: the reusable component just states that there needs to be a jdbc/MyConnectionDS on the server and it can be used as is. Wihtout any modifications at development time.
    What's more:
    Suppose I import the reusable JAR and its connection is added to JDev, without password.
    *) Leaving the password empty: DS not found after deployment (web.xml not adjusted, as mentioned in my original post)
    *) Entering the correct password: DS found, web.xml adjusted at deploy time.
    *) Entering an incorrect password: DS found, web.xml adjusted at deploy time.
    It even works when I enter an incorrect password, which proves that the JDBC DataSource on the server is used, instead of the JDev connection. Then why is the web.xml not adjusted when the password remains empty?
    Arun, I'll check the documention that you linked to, but this just seems like an weird decision in the implementation of JDev/ADF. :-)

  • Could not find "jdbc.datasources=..." in default.properties file

    Dear sirs,
    I sucessfully install jdk1.3 ,j2ee 1.3 and 50 day's trial cloudscape5.1 , then run the Cview create a database ,now I want to rigister the database by opening %J2EE_HOME%\config\default.properties file to find the line likes
    "jdbc.datasources=..." to add my database name behind , but I could not find it ,it's content is only appeared as
    following :
    # maximum size of message driven bean instance
    # pool per mdb type
    messagebean.pool.size=3
    # maximum size of a "bulk" message bean delivery
    messagebean.max.serversessionmsgs=1
    # message-bean container resource cleanup interval
    messagebean.cleanup.interval=600
    passivation.threshold.memory=128000000
    idle.resource.threshold=600
    log.directory=logs
    log.output.file=output.log
    log.error.file=error.log
    log.event.file=event.log
    distributed.transaction.recovery=false
    transaction.timeout=0
    transaction.nonXA.optimization=true
    sessionbean.timeout=0
    # validating parser values
    # validating.perser is used when archive file are loaded by
    # any of the J2EE Reference Implementation tools.
    # deployment.validating.parser is used when deploying an
    # archive on the J2EE AppServer.
    validating.parser=false
    deployment.validating.parser=true
    What shoul I do?
    Best regard !
    zhangyu
    cosbulk

    hi zylf,
    what u are looking for is ther in the resource.properties file..
    %J2EE_HOME%\config\resource.properties
    dont rely too much on tutorials.. many are outdated.. it seems..
    try opening all the files in the j2ee dir's, read 'em and try to understand them....
    a better forum for this is the J2EE forum at this url..
    http://forum.java.sun.com/forum.jsp?forum=136
    all the best..
    -Jer

  • DataSource JNDI  Lookup gives NamingException

    Hi i am using Weblogic 11g
    I had created a Datasource in it from Services/JDBC/DataSources and assigned it a name myAppDbPool
    But from my servlet when i am looking for it It is displaying as
    While trying to look up comp/env/myAppDbPool in /app/webapp/TestingDS/9028625.
    I had used differnt options like
    1. Putting the properties and passing it to the InitailContext.
    2. Used java:comp/env/myAppDbPool, java:comp/myAppDbPool.
    But all in waste ,so please let me know where i am doing wrong .
    This is inside my servlet :
    InitialContext ctx=new InitialContext();
    DataSource ds=(DataSource)ctx.lookup("java:comp/env/myAppDbPool");
    Please tell me if i am doing anything wrong here .
    Thanks n advance

    Ok. Take one step back. Make sure that your Datasource is infact targetted to Admin Server (and all managed servers in case of cluster). When we create a Datasource in weblogic console, we create connection pool with all db details and as we click and click at one point, it should show Target Tab with list of servers on this domain. So make sure that it is targetted to Admin Server. Infact just open config.xml file and check if your datasource is listed there. config.xml file is under your domain/config folder.
    Goud

  • Proxy Authentication with JDBC Datasource instead of JDBC URL?

    Hello,
    A requirement for my current project (ADF 10g) is that a user should be able to log in with his regular database account. For the moment, this is implemented using Proxy Authentication, as described in the following article:
    http://blogs.oracle.com/jheadstart/2008/01/using_proxy_authentication.html
    For now, we are using a JDBC URL defined in the application module config for the BC. In short: a ProxyAuthConnectionPoolManager class was created that overrides the default ConnectionPoolManagerImpl. The getConnection method has been overridden to create a standard connection (with the username/pw defined on the AM), and additionally, create a proxy connection within this connection with the specific user credentials. The (simplified) code:
        public Connection getConnection(String key, String url, Properties props, String username, String pwd) {
            // first fetch a default connection from the pool through the superclass
            Connection connection = super.getConnection(key, url, props, username, pwd);
            // cast into an OracleConnection
            OracleConnection oraConnection = (OracleConnection) connection;
                // close any proxy sessions that would still exist on the connection
                if (oraConnection.isProxySession()) oraConnection.close(OracleConnection.PROXY_SESSION);
                // get a handle on the session scope
                Map sessionScope = ADFContext.getCurrent().getSessionScope();
                if (sessionScope != null) {
                    // find the user object in the session (the account the user logs in with)
                    ProxyAuthUser user = (ProxyAuthUser) sessionScope.get(ProxyAuthUser.JHS_USER_KEY);
                    if (user != null) {
                        // create a property map with the end user credentials
                        Properties proxyProps = new Properties();
                        proxyProps.put(OracleConnection.PROXY_USER_NAME, user.getDbUsername() + "/" + user.getDbPassword());
                        proxyProps.put(OracleConnection.PROXY_USER_PASSWORD, user.getDbPassword());
                        // open the proxy session
                        oraConnection.openProxySession(OracleConnection.PROXYTYPE_USER_NAME, proxyProps);
                return oraConnection; 
        }Now, this works perfectly when using a JDBC URL. But when I switch the JDBC Datasource the ProxyAuthConnectionPoolManager class is not called anymore. This is all done in code in the Application Server. While using a JDBC Datasource is actually necessary: otherwise for each environment (dev, test, production,...) a different WAR file is needed.
    What class can I override with code similar to the piece above, to open a proxy connection inside the existing connection, when using a JDBC Datasource?
    Your help would be greatly appreciated!
    Chris

    Hello Krasimir,
    Frank Nimphius gave me the solution to this problem. The prepareSession is indeed the best place to put the code:
       private OracleConnection oconn = null;
       public void prepareSession(SessionData SessionData) {
          super.prepareSession(SessionData);
          oconn = ((PrxyTransactionImpl)this.getDBTransaction()).getPrxyConnection();
          // Specify the user that connects through the proxy user and its roles
          Properties prop = new Properties();
          prop.put(OracleConnection.PROXY_USER_NAME,"hr");
          prop.put(OracleConnection.PROXY_USER_PASSWORD,"hr");
          //prop.put(OracleConnection.PROXY_ROLES, roles);
          // Open the proxy session (DB-authenticated users)
          try {
             oconn.openProxySession(OracleConnection.PROXYTYPE_USER_NAME, prop);
          catch (SQLException e) {
             // Close the connection, to avoid connection to remain open after exception
             oconn.abort();
             e.printStackTrace();
       }But Frank also created the following helper classes to extend the ADF BC behavior:
       package oracle.sample.dbprxy.adfbc;
       import oracle.jbo.server.DBTransactionImpl2;
       import oracle.jbo.server.DatabaseTransactionFactory;
        * TransactionFactory that returns PrxTransactionImpl, which is a subclass of
        * DBTransactionImpl2
        * @author Frank Nimphius
       public class PrxyDatabaseTransactionFactory extends DatabaseTransactionFactory {
          public PrxyDatabaseTransactionFactory() {
             super();
           * Override the create method to return an instance of PrxyTransactionImpl instead
           * of DBTransactionImpl2
           * @return PrxyTransactionImpl
          public DBTransactionImpl2 create() {
             return new PrxyTransactionImpl();
       package oracle.sample.dbprxy.adfbc;
       import oracle.jbo.server.DBTransactionImpl2;
       import oracle.jdbc.internal.OracleConnection;
       public class PrxyTransactionImpl extends DBTransactionImpl2 {
          public PrxyTransactionImpl() {
             super();
           * The DBTransactionImpl2 does not expose the connection in a public
           * method. This class is a wrapper to expose the connection to the
           * BC app, so it can be accessed in the ApplicationModuleImpl class
           * @return OracleConnection - SQL Connection
          public OracleConnection getPrxyConnection() {
             return (OracleConnection) this.getJdbcConnection();
       }In the configuration of your Application Module, you have to set the property "TransactionFactory" (normally the last one in the list) to oracle.sample.dbprxy.adfbc.PrxyDatabaseTransactionFactory. This way, the DBTransaction() of your AM will have a getPrxyConnection() method and you will have the connection at your disposal. You won't need the createPreparedStatement in your code anymore.
    To close the connection, this is the code behind my "logout button" on the backing bean. Application Module Pooling and Connection Pooling will take care of the rest for you!
       ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
       HttpSession session = (HttpSession)ectx.getSession(false);
       session.invalidate();Another thing: be sure to set the internalconnection property to a different JDBC Datasource (or file based) than the one you are using to connect to the database (the default value). Otherwise connection pooling will be confused and there will be too much pending database connections.
    This works for me, all sessions are closed in time and logging out seems secure. I do not have my complete, adjusted code here at my disposal, but next week, when I'm back at work, I'll have a look to see if there is anything I forgot to mention. So this should get you started, but I'll keep you posted!
    A huge thank you to Frank again for helping me (/us) out with this problem!! And sorry I forgot to post the answer here sooner. I was too busy with testing it. :-)
    Regards,
    Chris

Maybe you are looking for

  • What type of OS X do I need?

    Hi. I recently tried to download a free trial of Final Cut Pro X, but the trial would not download because my MacBook Pro is an OS X 10.6.7. I'm not a computer genius, but is Snow Leopard supposed to be OS X 10.6.8 in order to install FCP X? Thanks.

  • Client Proxy error

    Hi friends, My scnario is Proxy to JDBC. In this when i went to test my proxy interface.. i got this error.. <CODE>INTERNAL.SYSTEM_NOT_CONFIGURED_AS_XMB</CODE>   <ERRORTEXT>System not configured as XI Integration Engine</ERRORTEXT> please rectify.. R

  • Customer Advance amount is not reflecting in the F.07

    Hi, When we are running F.07, for a particular Customer F.07 is not showing the advance amount. For the rest of the Customer it is showing the figures. When I view FBL3N (special GL a/c) and FBL5N (Customer) reports here it showing the figures but th

  • Approval Preview to be defaulted to Table for Shopping cart

    Hi All, The Approval preview needs to be defaulted as table instead of graphic in BBPSC01 (Extended Form). We are using SRM 4.0 - SAPKIBKS13. Your inputs will help in resolving this issue.Business wants this be done on priority. Regards K Gp

  • Can I get a full screen on iphoto without the toolbar at the bottom?

    can I get a full screen on iphoto 11 without the toolbar at the bottom?