Author Message
RossParrent
Joined: Apr 1, 2014
Messages: 64
Location: Denver
Offline
Hi all,


I'm moving my AEP application from one Tomcat server to another, upgrade versions and a new database specification. I receive the error, "javax.naming.NameNotFoundException: Name jdbc is not bound in this Context" error first thing when running the root branch of the application.
I checked the web, server and context .xml files, as the context should be declared in one or several of these locations. I compared the new to the old and found no alarming discrepancies (see the attached spreadsheet). There seem to be more entries in the TC 7 export than the previous, TC 6x export, but I assume that could be credited to the newer Tomcat version.


I also reviewed another post, here and checked the comment, but I'm sure the DBops are named as needed.


  • The project giving the error is here,

  • along with the associated modules, here

  • and here.

  • The error log is here.

  • Any hints would be much appreciated. Thanks!

    Filename JDBCinXML.xlsx [Disk] Download

    Ross Parrent Support Engineer | Sales Engineering | ATAC-Technicenter Highlands Ranch, CO 80129 | 720-444-8135 one number
    WilsonYu
    Joined: Nov 6, 2013
    Messages: 3950
    Offline
    This error usually indicate the data source definition is missing in the context xml file. To verify the context file, first check if there is a <appname>.xml file in the Tomcat/catalina/localhost directory. If it exists, that the file Tomcat is looking at for the data source information. If not, the context.xml file in the app's META-INF directory is being used. So you need to verify if the context xml file has the data source name matching the data source you have defined in OD.

    For example:
    <Resource ... name="name="jdbc/<od datasource name" ... </Resource>
    RossParrent
    Joined: Apr 1, 2014
    Messages: 64
    Location: Denver
    Offline
    Thanks Wilson,


    Checking the legacy production Tomcat server, I see an <app>.xml file for every application deployed to that system, but the new, upgraded server shows none of those.

    What would be the cause of this...is there an Eclipse export parameter that I have failed to set? Otherwise, do I need to add these files manually to this directory?

    Thanks!


    Ross Parrent Support Engineer | Sales Engineering | ATAC-Technicenter Highlands Ranch, CO 80129 | 720-444-8135 one number
    WilsonYu
    Joined: Nov 6, 2013
    Messages: 3950
    Offline
    It is the copyXML parameter in Tomcat. This parameter is defaulted to false for newer Tomcat systems:

    https://tomcat.apache.org/tomcat-7.0-doc/config/host.html

    Regardless, the context.xml file in META-INF should be used instead. The <appname>.xml is just a copy of it.
    RossParrent
    Joined: Apr 1, 2014
    Messages: 64
    Location: Denver
    Offline
    Well, if that's the case, then it's not the problem apparently. Where is the "hosts.xml" file to be found? I think I've looked everywhere.


    The resource lines in the context.xml files are different between TC 6 and 7. The context.xml for the upgrade root application (TC 7) is located here. The same file for the legacy app is here.


    The big difference I see is the upgrade file shows lots of "ResourceParams", where the legacy file is much simpler. Still, the "ResourceParams" look sensible in their syntax and values. I would suppose they would work.


    I made an adjustment to the resource lines where I saw a difference. The legacy system shows

    factory="org.apache.tomcat.dbcp.dbcp.cpdsadapter.DriverAdapterCPDS"
    where the upgrade system showed
    factory="org.apache.tomcat.dbcp.cpdsadapter.DriverAdapterCPDS"
    , i.e. only a single instance of "dbcp". I tested, but that made no difference.

    Referencing the other forum post, here, I'm curious if the system is interpretting "jdbc" as the name of the datasource?

    Caught an application error ( EXCEPTION> 
    
    javax.naming.NameNotFoundException: Name jdbc is not bound in this Context


    Ross Parrent Support Engineer | Sales Engineering | ATAC-Technicenter Highlands Ranch, CO 80129 | 720-444-8135 one number
    WilsonYu
    Joined: Nov 6, 2013
    Messages: 3950
    Offline
    If you are moving from TC 6 to 7, you should not have this problem. The difference in using the <Resource> and <ResourceParams> tags are between TC 5 and TC 6, and TC 6 and TC 7 are exactly the same. So I suspect you are trying to move apps running on TC 5.* to TC 7. The proper way to do is importing the apps into the OD environment which is using TC 7 and export the package for deployment from there. OD will translate the context format automatically to run on the TC 7 environment.
    RossParrent
    Joined: Apr 1, 2014
    Messages: 64
    Location: Denver
    Offline
    I have been re-developing the entire application on OD 7 for TC 7. I'm not really migrating anymore. According to the Tomcat Manager on the legacy server, per the attached screen shot, the version is:
  • Apache Tomcat/6.0.32

  • I have a totally clean build - no errors or warnings - of all three modules as linked in my original post.


    Perhaps there is some more detailed trace I can look at from withing the EP reporting system?

    • [Thumb - TomcatVersions.png]
    [Disk] Download

    Ross Parrent Support Engineer | Sales Engineering | ATAC-Technicenter Highlands Ranch, CO 80129 | 720-444-8135 one number
    WilsonYu
    Joined: Nov 6, 2013
    Messages: 3950
    Offline
    OK. I get that all three modules are built in OD 7 and TC 7, and they are tested in simulated. Correct? Then you exported them for deployment and found the "Name jdbc is not bound in this Context" error. Correct? Can you post the context.xml from the app's META-INF in the Tomcat/WebApps/<appname> directory? Can you post the screenshot of the web browser after loading the validation page http://ip:port/<appname>/jsp/validate-db.jsp from the deployed app?
    RossParrent
    Joined: Apr 1, 2014
    Messages: 64
    Location: Denver
    Offline
    The context page from the Upgrade system is posted here.


    The Validation page screen shot is attached.


    The Validation page text is posted here.


    I see notification of multiple "scr rt common" and "VP app Log Client" jars. I'll check that out in the java build path.


    I did NOT test the app in the simulator. I haven't got the simulator working :-(, sorry.


    Wilson, thanks for taking a deeper look!

    • [Thumb - UpgradeValidationPage.png]
    [Disk] Download

    Ross Parrent Support Engineer | Sales Engineering | ATAC-Technicenter Highlands Ranch, CO 80129 | 720-444-8135 one number
    Shrikant.pawar
    Joined: May 19, 2015
    Messages: 21
    Offline
    There are two things to check out here.
    1) Is your applications are referring any host layer (Java Project) If yes then go and check in the code on which properties file your reading dataBase name and context path.
    2) If your not referring any java project then your work is straight forward as you will get all the dbop files automatically in your set-Up.

    Also please make sure that your importing all the necessary jar files....

    Hope this helps...
    WilsonYu
    Joined: Nov 6, 2013
    Messages: 3950
    Offline
    You need to test first in the design environment and make sure it works in simulation. That way, you know if something is wrong with the context definition. If there is something wrong there ( i.e. the data source may not be in sync with the context definition), you can correct it by deleting it and updating it using the right-click menu on the project.
    Also, your validate page information seems not quite right; the scert jar file is newer than the scertcommon jar. I am also interested in the information on the validate-db.jsp page as I asked earlier.
    The bottom line is you test your app in the design environment. If everything works fine there, you export the app from there for deployment.
    RossParrent
    Joined: Apr 1, 2014
    Messages: 64
    Location: Denver
    Offline
    Hi Wilson,
    Attached is the validate-db.jsp screen shot. Lot's of clues there.


    Thanks, -REP

    • [Thumb - UpgradeValidation-dbPage.png]
    [Disk] Download

    Ross Parrent Support Engineer | Sales Engineering | ATAC-Technicenter Highlands Ranch, CO 80129 | 720-444-8135 one number
    WilsonYu
    Joined: Nov 6, 2013
    Messages: 3950
    Offline
    I see that the sqljdbc.jar file is in the app's webinf/lib directory. You need to copy it into the Tomcat lib directory since Tomcat connection pool is using it. After you make any change in the library files, make sure you restart Tomcat.
    WilsonYu
    Joined: Nov 6, 2013
    Messages: 3950
    Offline
    I see that the sqljdbc.jar file is in the app's webinf/lib directory. You need to copy it into the Tomcat lib directory since Tomcat connection pool is using it. After you make any change in the library files, make sure you restart Tomcat.
    RossParrent
    Joined: Apr 1, 2014
    Messages: 64
    Location: Denver
    Offline
    on the DB validation page, I click the "go" button to connect to the database as defined. I receive back the following error:


    There is a problem finding the context information for the data source you selected.
    For Tomcat, make sure the context XML file is in the <TOMCAT_HOME>/conf/Catalina/localhost directory,
    and the context information for the data source exists in the file;
    for other application server, make sure you have defined the data sources in the admin console.


    The context file is actually named for the application when placed in this location as has been discussed earlier.


    I have attached screen shots of the validate-db page, the directory on the app server, and the content of the "context".xml file.
    I have restarted the app server.


    I notice the tomcat version is slightly different: appserver: 7.0.26 v eclipse build: 7.0.55. I wouldn't expect that to be a factor of this magnitude, would you?
    Thanks again,

    • [Thumb - context-(TechCtrMainV42)-xml.png]
    [Disk] Download
    • [Thumb - appserver-CatalinaLocalhost-dir.png]
    [Disk] Download
    • [Thumb - UpgradeValidation-dbPage-connetionErr.png]
    [Disk] Download

    Ross Parrent Support Engineer | Sales Engineering | ATAC-Technicenter Highlands Ranch, CO 80129 | 720-444-8135 one number
    Go to:   
    Mobile view