Data source needs to be specified in context.xml instead of web.xml - why?

Hi,
I'm using a Spring JndiObjectFactoryBean to create my JNDI data source in my code:
<bean id="jndiDataSource" class="org.springframework.jndi.JndiObjectFactoryBean" lazy-init="true">
          <property name="jndiName" value="java:comp/env/jdbc/DS_OURDB_DB2" />
          <property name="lookupOnStartup" value="false"/>
          <property name="proxyInterface" value="javax.sql.DataSource"/>
     </bean>I have the necessary Resource added to my Tomcat's server.xml:
<Resource accessToUnderlyingConnectionAllowed="false"
            defaultAutoCommit="true" defaultReadOnly="false"
            driverClassName="com.ibm.db2.jcc.DB2Driver"
            factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
            initialSize="0" logAbandoned="false" maxActive="8"
            maxIdle="8" maxOpenPreparedStatements="0" maxWait="-1"
            minEvictableIdleTimeMillis="1800000" minIdle="0"
            name="jdbc/DS_OURDB_DB2" numTestsPerEvictionRun="3"
            password="ourpass" poolPreparedStatements="false"
            removeAbandoned="false" removeAbandonedTimeout="300"
            testOnBorrow="true" testOnReturn="false"
            testWhileIdle="false" timeBetweenEvictionRunsMillis="-1"
            type="javax.sql.DataSource"
            url="jdbc:db2://machine1:60056/DBD1" username="ouruser"
               validationQuery="SELECT current date FROM sysibm.sysdummy1"/>I then have the resource referenced in my web.xml:
<resource-ref>
          <res-ref-name>jdbc/DS_OURDB_DB2</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Container</res-auth>
          <res-sharing-scope>Shareable</res-sharing-scope>
     </resource-ref>However, I'm getting JndiLookupFailureExceptions when I attempt to use this JNDI resource.
I can resolve it by specifying the following in my META-INF/context.xml:
<Context>
     <ResourceLink global="jdbc/DS_OURDB_DB2" name="jdbc/DS_OURDB_DB2" type="javax.sql.Datasource"/>
</Context>I've read some of the JNDI/Tomcat documentation. However, I still do not understand why it doesn't work with the web.xml. Can anyone explain please? Thanks

Can answer this myself after some more investigation. The reason I required the entry in the META-INF/context.xml was because I had specified the Resource as a Global Reference in the server.xml. By adding this Resource to my application's Context in the server.xml the configuration in the web.xml worked as expected.

Similar Messages

  • Failed to acquire DAS with data sources that match the specified OCE

    Please help, Thank you all.
    We are migrating Oracle databases from Windows to Linux servers. Currently, I have no problem to use my desktop Hyperion Intelligence Designer 8.5 with new oce file to connect to Linux. However, I published the same oce file to Hyperion Performance Suite 8.5 then I got “Sever Error [2018]: Failed to acquire Data Access Service with data sources that match the specified OCE”.
    I launched Service Configurator, in the “Local Service Configurator - DAS1_host”, the “Database JDBC URL is point to Linux server. Also, I added ODBC connection to Oracle database on Linux in the “Properties of Data Access Service: DAS1_host’s Data Source”. Database of JDBC URL in BI1_host, AZ1_host, PUB1_host, SM1_host, LS1_host, UT1_host, BPS1_host, AN1_host are also point to Linux server.
    The “Remote Service Configurator” has ES1_host’s” Storage” with JDBC URL point to Linux server. The same for RM1_host’s and NS1_host’s “Storage” with JDBC URL point to Linux server.
    Is there some missing configuration on the server? Thank you in advance.

    You should login to my oracle support to look into this ID.
    This is the solution mentioned
    Solution
    1) In the .profile file, you will find the definition of the LD_LIBRARY_PATH variable. However, the path to 64 bit libraries is probably appended before the path to the 32 bit libraries(%ORACLE_HOME%/lib32). Therefore, please reverse the order in the definition so that the 32 bit libraries get loaded before the 64 bit libraries.
    Then, restart all services.
    2) Oracle 9.2 was the first Oracle release which defaults to using the 64 bit libraries in the 'lib' directory and the 32-bit libraries that we need are in the 'lib32' directory.
    Therefore, please have the%ORACLE_HOME%/lib32 placed in front of the LD_LIBRARY_PATH environment variable definition.Then, restart all services.
    3) Please check that users have read and write access to the files located in the %ORACLE_HOME%/lib32 folder.
    4) Check the permissions of the libclntsh.a file(located in the %ORACLE_HOME%/lib32 folder) are set to rwxr-xr-x
    5) Recreate the OCE connection in DAS and restart DAS in CMC.
    6) Restart all the BIPlus Services and process the query.

  • Replicate data source needed?

    Hi,
      I have done some changes in the program used to enhance the data source in the R3, No changes done on the structure. Do i need to replicate it in BI.
    Thanks
    Karthikeyan.L

    Hi
    If you have enhanced the datasource by adding a field then you need to replicate the datasource.
    But if you have only changed the exit program you need not do that
    data will be populated automaically.
    Regards
    PBI

  • SRM Approver Name - Data source need for this DSO: 0BBP_SCA

    Hello Experts,
    I am having difficulty to get shopping cart approver name loaded (but approver id is loaded) into BI reports
    I am using standard business content  (DS Names: 0BBP_TD_SC_1, 0BBP_TD_SC_APPR_1)
    Please let me know the data source reg. this. Any hint reg. this will be appreciated.
    I tried all these info objects, No luck yet.
    0BBP_APPROV
    0BPARTNER
    http://help.sap.com/saphelp_sm32/helpdata/en/29/9cfb3673421a4a809ec9fe82d6a16b/content.htm
    Thanks in advance.
    Thanks
    Praba

    Hello Navesh,
    You are right. Sorry I did not mention clearly in the title.
    But I used correct DSOs respectively for the Data source
    1)
    Approval Process for Shopping Carts u2013 Single Documents Locate the document in its SAP Library structure
    DSO: Technical name: 0BBP_SCA
    DS: 0BBP_TD_SC_APPR_1
    2)
    Shopping Carts u2013 Single Documents Locate the document in its SAP Library structure
    DSO: Technical name: 0BBP_SC
    DS: Technical name: 0BBP_TD_SC_1
    Please let me know relevant info object for Approver Name.
    0BPARTNER
    0BBP_APPROV
    0HRPOSITION
    Note: Source system is SRM
    Thanks
    Praba

  • SSIS XML Data Source - worked in BIDS, can't read XML in SSDT

    I have an SSIS 2008 package built in BIDS (2008) that uses a series of XML locations (similar to
    http://corpslocks.usace.army.mil/lpwb/xml.tonnage?in_river=AG&in_lock=42&in_mon_yr=092013) to get tonnage information and load it into a SQL Server 2008 R2 database. This has been running daily without error for over 60 days. I am now migrating
    this to SSIS 2012 using SQL Server Data Tools and I am having difficulty reading the XML into the database.
    The package does the following (it is pretty simple):
    1. read the URLs (there are 200) from a database view into a variable object
    2. a for each loop container that loops through the variable object, gets the data from each URL (the XML URL is stored as a variable) and loads it into the database
    The BIDS package still works great. I first used the converter to migrate to 2012. I then recreated a package with exactly the same settings as BIDS. No dice either way. I also tried using a local xsd file, then using one inline. SSDT will recognize all
    of the columns correctly when I use inline, but neither method is capable of reading the data into a table.
    I know the package is going to the addresses, all of the URLs show up in the error logs. The error messages are as follows: "[Load data from tonnage url [47]] Error: The file "http://corpslocks.usace.army.mil/lpwb/xml.tonnage?in_river=AG&in_lock=42&in_mon_yr=092013"
    was not found. Please verify the file path and try again."
    Has anyone run into this and solved it? I think I have tried every possible setting available, with no luck. Any ideas or suggestions are appreciated. Thanks!

    I have an update on this issue. I believe it is a connectivity issue or possibly a setting in SSDT. 
    I can access the remote XML file location through my browser. I have downloaded the XML from the remote location and my package runs using the local XML file perfectly. I have BIDS 2008 installed on the same machine and it works without a problem (using
    the remote XML location). This last piece makes me think there is a network setting or something in SSDT.
    Does anyone have any additional troubleshooting advice or other suggestions? My error output is included below. 
    Thanks!
    Information: 0x40043006 at Data Flow Task, SSIS.Pipeline: Prepare for Execute phase is beginning.
    Error: 0xC020F440 at Data Flow Task, XML Source [31]: The file "http://corpslocks.usace.army.mil/lpwb/xml.lockqueue?in_river=GI&in_lock=01" was not found. Please verify the file path and try again.
    Error: 0xC02090D0 at Data Flow Task, XML Source [31]: The XML Source was unable to read the XML data.
    Error: 0xC0047019 at Data Flow Task, SSIS.Pipeline: XML Source failed the prepare phase and returned error code 0xC02090D0.
    Information: 0x4004300B at Data Flow Task, SSIS.Pipeline: "ADO NET Destination" wrote 0 rows.
    Information: 0x40043009 at Data Flow Task, SSIS.Pipeline: Cleanup phase is beginning.
    Task failed: Data Flow Task

  • What is specified in jta-data-source in persistence.xml??

    When searching on the web I find examples like:
    <jta-data-source>java:DefaultDS</jta-data-source>
    or
    <jta-data-source>jdbc/MyDataSource</jta-data-source>
    What exactly is specified here? Prob dumb question but I can't figure it out.
    Ty

    hi user644732
    This says ...
    http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
    "The container-specific name of the JTA datasource to use."
    (tip : You can use "Your Control Panel" to make your name visible in forum posts.)
    regards
    Jan Vervecken

  • Help needed on to write a program on connecting to data source

    I would to program a class that connect to data source without any manually configure.
    Is there other way that i could use intsead of using
    db = DriverManager.getConnection("jdbc:odbc:Driver={SQL Server};Server=MyServerName;Database=MyDataBase","","");
    My project requires me to use JDBC-ODBC Bridge on connecting to data source on client machine
    Is there any other way?

    Oh, oh,
    why???
    It's so simple to do a JDBC connection using the same connection params, which you use for your VB program's connnection.
    If your VB prog uses a system or user DSN configured via control panel, then use the same DSN in your Java prog.
    Dear karentan,
    you have just the same question now active in 4 or 5 different topics. And I and others have not been able to understand what really is your problem, I fear.
    Would you please do two things:
    1) Start a new topic (yes, another one!) and tell us there what exactly is your problem. What do you want to do?
    Not: is it possible ... but: I want ...
    2) Go to all the other topics you spreaded here and post the link of your new topic there, so that the poor people who try to answer your 5 (always the same) questions know that they can spare their time.
    Please, hold this forum useful!
    And let us come to the point that you are helped and we are glad!

  • Report Viewer and Multiple Data Sources

    I know that it is possible to create a report in Crystal Reports using multiple data sources.  But is it possible to use just the Free  Report Viewer to view a report with Multiple Data Sources?
    Our company uses Crystal Reports XI.  I do not use the program myself, I am in the IT Department.  I have limited knowledge of Crystal and do not do any of the report writing.
    If this is possible, and if someone could help me out with what would need to be done, or point me in the right direction of a Knowledge Base or Help Topic that explains this, that would be great.
    Thanks.

    I believe it can but both data sources need to be set up. Ask a report designer to help you use the Designer to test this and see what is required.

  • Error while deleting data source : Message RSO414

    Hello Guys,
    We have activated data source 2LIS_04_PKKANBAN and entire standard BI content . When i tried to extract data, i got 0 records initially and after that i came to know that some functions needs to be activated in ECC to extract KANBAN data.
    We activated some function and deleted & filled setup tables for KANBAN and i can see data in RSA3 (368 Records). Then i tried to extract data into SAP BI. it took  me 20 minutes but ended with error. "Data Source needs to be activated again as it was changed (We just activated one function only) nothing changed to data source" I activated data source again in ECC and replicate on SAP BI side but i am not able to get it in activated mode.
    I tried to activate it manually and it takes 20-25 minutes but i am not able to activate it and getting error "Error when activating DataSource : MESSAGE NO  RSO414 " "Error when resetting DataSource 2LIS_04_PKKANBAN to the active version". i also can't delete data source as when i try to delete it, i get the error "ERROR WHEN DELETING DATA SOURCE : MESSAGE NO RSO414" .  What to do in this situation ?
    Regards,
    Komik Shah

    Hi Rahul,
    I tried it but it didn't help me.
    Also there is no FM in SAP BI called RS_DATASOURCE_ACTIVATE_ALL. I have activated  data source in my ERP system  and replicated same on BI side as we don't have standard Transfer Rules or Transformation, i can't use RS_TRANSTRU_ACTIVATE_ALL .
    Regards,
    Komik Shah

  • Segments in Check Writer XML data source

    Hi,
    Can anyone tell me what are the Segments 1-10 in the XML data source that I see for Check Writer (XML) when I use "Third Party Checks". I tried populating few fields in the Entry values for the corresponding element but that didn't work.
    We need an additional field to populate some reference number that needs to be printed on the check and we would like to use one of these segments since it eliminates the customization.
    - <EMPLOYEE_THIRD_PARTY_PAYMENTS>
    <ORG_PAYMENT_METHOD_ID>63</ORG_PAYMENT_METHOD_ID>
    <PERSONAL_PAYMENT_METHOD_ID>103704</PERSONAL_PAYMENT_METHOD_ID>
    <CHECK_DEPOSIT_NUMBER>166986</CHECK_DEPOSIT_NUMBER>
    <SEGMENT1 />
    <SEGMENT2 />
    <SEGMENT3 />
    <SEGMENT4 />
    <SEGMENT5 />
    <SEGMENT6 />
    <SEGMENT7 />
    <SEGMENT8 />
    <SEGMENT9 />
    <SEGMENT10 />
    <PRE_PAYMENT_ID>4077062</PRE_PAYMENT_ID>
    <VALUE>151</VALUE>
    <PREPAYMENT_ASSIGNMENT_ACTION>1363042534</PREPAYMENT_ASSIGNMENT_ACTION>
    <ORG_PAYMENT_METHOD_NAME>TP Bethesda</ORG_PAYMENT_METHOD_NAME>
    </EMPLOYEE_THIRD_PARTY_PAYMENTS>

    Ok..found it. Those are the bank details.

  • Multiple Data source in Struts-Config.xml

    Hi ,
    I am Amit Garg and i am new to this forum....
    Can any one help me out with the problem that i need to have 3 data source in my struts-config file and how will my getDatasource(request) method recoganise which data source to pick and access.

    Hi Amit Garg,
    <data-sources>
    <data-source type = "org.apache.commons.dbcp.BasicDataSource" key = "DBA">
    </data-source>
    <data-sources>
    <data-source type = "org.apache.commons.dbcp.BasicDataSource" key = "AISDEV">
    </data-source>
    </data-sources>
    u just configure ur struts-config.xml file in the above manner and use the following steps in ur action servlet to retrive the DataSource object
    getDatasource(request,"DBA") for accessing first datasource
    getDatasource(request,"AISDEV") for accessing second datasource.
    byeeeeee

  • Multiple XML HTTP Data sources sequentially

    Hi,
    We are creating a report using multiple XML HTTP Data sources sequentially.
    The Report uses multiple XML HTTP Data sources sequentially; the report creation fails or delayed. We would like to join the datasources after accessing from the HTTP Server.
    At the same time the same XML files when locally accessing as data sources, the report is getting created.
    Is there any alternate solution for XML HTTP Data Source Access. Or in which way I can proceed with this.
    Thanks,
    Unni

    I am not able to use datasets here.
    The context is as below.
    I am running an HTTP server (XML-RPC program),which will generate an XML output as defined with a local XML Schema.
    Here I have multiple HTTP requests ,each will generate multiple XML outputs.
    I am using XML and WebServices Connection where I will provide like below,
    (Please note file1,file2 are normal text files with data corresponds to xsds.)
    HTTP(s) XML URL : http://localhost:8002/ReadTable?name=file1
    Local Schema File : E:\Test\file1.xsd
    HTTP(s) XML URL : http://localhost:8002/ReadTable?name=file2
    Local Schema File : E:\Test\file2.xsd
    Like this I am able to create multiple XML outputs through HTTP requests.(only file1),which means while creating reports the sequential requests are not handling properly.
    My report will join say two of theese files. But at the time of report creation it will ask of only runtime parameter of first request in the join.
    Here The report will generate only with data from first text(data) file.(file1)
    Hope you got a clarity about the proble.

  • Change all reports data source connection

    I have numerous SQL reports that require their data source connection changed. Does anyone have code to change all reports that use a data source name of 'Data_Warehouse_Main' to a different shared connection.
    Thanks

    Hi BiscuitB,
    According to your description, there are numerous SQL reports and their data source need to be changed. You used RSScripter but it does not work.
    In Reporting Services, if we want to change data sources of multiple SSRS Report, we can use Powershell to set the data sources for an item in a report server database or SharePoint library. To achieve your goal, we need to use both the Reporting Service
    GetItemDataSources Method and the SetItemDataSources Method. You can refer to the thread provided by PrajapatiNeha, and the PowerShell script sample will be helpful for you.
    Reference:
    GetItemDataSources Method
    SetItemDataSources Method
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu

  • What data sources use for report which looks like tr. FS10N

    Hello,
    I would like to create report in BW which will looks like transaction FS10N (G/L account balance display). Can anybody give some tips which data sources I should use and how initialize these data sources?
    There is old genereal ledger in our system, so I suppose that I need data sources 0FI_GL_20 and 0FI_GL_21 but I don´t know how initialize it.
    Thanks for help.
    Regards,
    Karel

    Hi Suman,
    I asked because f.e. retail data sources 2LIS_03_BF or 2LIS_03_UM had to be initialize via tr. OLI1BW and OLIZBW. After that data sources were filled and then data could be loaded to BW by infopackages. But thanks for info that some data sources needn't initialization. By the way, is somewhere info about this (if data source need initialization and how find out transaction for initialization)? Thanks for advices.
    About data sources 0FI_GL_20 and 0FI_GL_21: We delayed this because there is needed to switch on function Reporting financials (tr. SFW5) and other things -> I didn't recieve confirming (from higher position) that I can switch it on
    Regards,
    Karel

  • Change data source of report in SharePoint 2013

    Hi there
    Not sure if this should be in the SharePoint forum or here, but since moving from SharePoint 2010 to 2013, we're having trouble finding where to change the data source of an existing SSRS report when stored in a SP doc library. In SharePoint 2010 "Manage
    Data Sources" was available directly from the context menu as described in the MSDN documentation
    here. Unfortunately we're not able to find this option anywhere in 2013.
    Any suggestions on where to find this?
    Thanks!

    Hi timofcourse,
    Glad to hear that your issue have been resolved and your sharing of the information will benefit others a lot.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

Maybe you are looking for

  • Re: problem in sap standard

    Hello,       What is the note number.

  • Connecting to EM, isql*plus

    hi all, after entering my isql*plus or EM URL, it dos not connnect it always replys CANT CONNECT TO SERVER or sometimes WINSOCK ERROR..... i just installed oracle 10g, i have tried reinstalling it but it is still the same. when i finshed installing i

  • PS CC 2014: How to create 3D-shadows on a vertical surface?

    Hi! PS CC 2014: I imported 3D-objects in a 2D-environment (photo). The objects are placed on a wall (vertical surface). I would like to create natural shadows from these objects onto the wall. But I only succeed in making shadows on the ground plane

  • Does anyone know how to calculate the impedance using waveforms

    does anyone know how to calculate the impedance using waveforms?

  • Oracle 8i download incorrect documents

    We are currently trying to integrate already existing and referenced documents in a database Oracle 8i Standard Edition. So I wrote a PL/SQL procedure that load sequentially all documents as LOB in a table. The procedure worked perfectly, but now tha