[Solved] Javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

When making a report today, when you jump to the report page, no data will be displayed, and an error will be reported that the data set has not been generated

Javax.naming.namenotfoundexception: name JDBC is not bound in this context

Then I looked for the configuration files of those databases and thought that there was something wrong. Including two in the project and one in tomcat, no problem

Finally, it is found that the configuration in comfig.xml has not been released. This is a record to prevent this kind of error

<dsConf>
    
        <dataSource>
            <Name>sms</Name> <!-- Data source names, consistent with those in the designer -->
            <JNDIPrefix> java:comp/env/</JNDIPrefix> <! -- java:comp/env/ JNDI lookup prefix -->
            <JNDIName>jdbc/smsdb</JNDIName> <! -- JNDI resource name of the data source -->
            <DBType>ORACLE</DBType> <! -- Database type -->
            <DBEncode>GBK</DBEncode> <! -- Database encoding method -->
            <SQLDecode>false</SQLDecode> <! -- Whether to do Sql statement transcoding -->
            <Default>true</Default> <! -- Whether to be the default data source -->
        </dataSource>
         <dataSource>
            <Name>fss</Name> <! -- Data source name, consistent with in the designer -- >
            <JNDIPrefix></JNDIPrefix> <! -- JNDI lookup prefix -->
            <JNDIName>jdbc/feiandb</JNDIName> <! -- JNDI resource name of the data source -->
            <DBType>ORACLE</DBType> <! -- Database type -->
            <DBEncode>GBK</DBEncode> <! -- Database encoding method -->
            <SQLDecode>false</SQLDecode> <! -- Whether to do Sql statement transcoding -->
            <Default>true</Default> <! -- Whether to be the default data source -->
        </dataSource>

        
        <!-- xml data source configuration
        <dataSource type="xml">
            <Name>XML</Name>
            <Def name="Publication Information" xml="D:\DATASOURCE_XML\table1.xml" encode=""/>
            <Def name="Table 15" xml="D:\DATASOURCE_XML\Table15.xml" encode=""/>
        </dataSource>
        -->
        <! -- webservice data source configuration
        <dataSource type="webservice">
            <Name>WS</Name>
            <WSDL>http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl</WSDL>
        </dataSource>
        -->        
    </dsConf>

Similar Posts: