JDBC JNDI INITIAL_CONTEXT_FACTORY
sigh
Still haven't gotten the hang of JNDI completely. Below's my code. I'm going to access a JDBC database. What INITIAL_CONTEXT_FACTORY should I use? The file system one seems to be the wrong one. Does it matter that it's an MS Access database? Isn't there just some generic INITIAL_CONTEXT_FACTORY for all JDBC databases?
<vent>
Why isn't there some handy list somewhere that shows the common INITIAL_CONTEXT_FACTORYs? Why do we have to hunt them down?
</vent>
Thanks,
Gary
public Connection getConnection(ClientSession clientSession) throws SQLException, NamingException, RemoteException
Properties env = new Properties();
InitialContext ic;
DataSource ds;
Connection connection;
env.setProperty(InitialContext.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory");
ic = new InitialContext(env);
ds = (DataSource)ic.lookup("java:comp/env/jdbc/"+getDataSourceName(clientSession));
connection = ds.getConnection();
return connection;
If you don't know what JNDI service you should be
using then you're in big trouble.
If you're developing code for a J2EE App Server or
Tomcat then the JNDI Service will already be running
in the Container and you need do no more than get the
env context and lookup the DataSource.
If you're developing a client app then you must know
the J2EE server that you're connecting to and so will
either be running in a ClientContainer or using a
jndi.properties file provided for you by the Server.
So what is it that you're trying to do?Write an RMI server that accesses a JDBC database. Instead of using DriverManager, I thought I'd give JNDI a whirl.
The client apps of my server might be servlets or a Swing app.
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 -
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,
JieI 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! -
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 ... -
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-liangHi Tian-liang,
Try using Microsofts JDBC driver rather than Suns. Also search these forums, other have run into the same issue.
Thank you
Don -
The mysteries of JDBC, JNDI, and Tomcat 5.5.4
Like thousands beforefore, I can't get connection pooling to work in Tomcat. I followed all the steps:
- put jar file for MySQL JDBC driver in TOMCAT_HOME/common/lib
- put the Jakarta Commons libs in the same location
- put resource declaration in META-INF/context.xml, per the Tomcat 5.5 docs like so:
<Context docbase="C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\commutercorps"
path="\commutercorps" >
<Resource name="jdbc/commutercorpsds"
auth="Container"
type="javax.sql.DataSource"
maxActive="100"
maxIdle="30"
maxWait="10000"
username="myusername"
password="mypassword"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/commuter_corps_signup"/>
</Context>- added resource ref in web.xml
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/commutercorpsds</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>I also double checked my connection URL and found that it does work fine when do this in my Java code:
Class.forName("com.mysql.jdbc.Driver");
Connection con =
DriverManager.getConnection
("jdbc:mysql://localhost:3306/commuter_corps_signup", "...", "...");When I try to use Tomcat 5.5.4, JNDI like this...
try
InitialContext initialContext = new InitialContext();
DataSource dataSource =
(DataSource) initialContext.lookup
("java:comp/env/jdbc/commutercorpsds");
Connection con = dataSource.getConnection();
Statement stmt = con.createStatement();
stmt.executeUpdate(SQLMaker.getInsert(request,
request.getParameter("table")));
con.close();
stmt.close();
} catch (NamingException e)
System.out.println(e.getMessage());
e.printStackTrace();
}...I get...
Cannot create JDBC driver of class '' for connect URL 'null'
Caused by: java.sql.SQLException: No suitable driver
Any help would be greatly appreciated.
Thanks,
EI used to get the message
Cannot create JDBC driver of class '' for
connect URL 'null'
No suitable driverError.
I was running, jakarta-tomcat-5.0.14.exe on windows.
I had it installed on a path without spaces
d:\tomcat5\Good.
I wanted to use Hibernate. So i used, extensiontools.What's that?
First create a env var: HIBERNATE_HOME pointing to
the hibernate extracted dir.No need for this.
Modify setenv.bat to correct %CP% for
commons-logging, commons-collection and anything
else: the version string at the end of the jar
changes.Wrong. You shouldn't be doing this.
Then run ddl2hbm, straightforward, fill info in all
tabs and hit generate. Will show some error message,
but still creates xmls.I don't see what any of this has to do with Tomcat deployment.
Then run hbm2java, and hand over each xml file as
parameter. Creates some java files in generated dir.
Modify the toString method to something simpler and
remove the import for apache class.All great, but still has nothing to do with Tomcat deployment.
move them over to webapp classes.You should create a WAR file or a separate context directory for your application under /webapps. If you're doing anything else, it's wrong.
Create JNDI in sever.xml as mentioned.Nope. Shouldn't be editing server.xml. Put that stuff in an application-specific context.xml, which goes in the META-INF of your WAR file.
Create reference in web.xml as mentioned.Good.
Goto conf/catalina/localhost/<webappname>.xmlNo need for this. Don't know what you're doing here.
add the line
<ResourceLink name="jdbc/Oracle"
type="javax.sql.DataSource" global="jdbc/Oracle"/>
replace Oracle with your datasource name.
and i got me workingMight be working, but it's not really correct.
% -
How can we use Cloudscape and JDBC, JNDI
Hello all,
I was trying to install the example included in the J2EE called RMS but have problems to do that.
I got this message:
reference java:comp/env/CloudscapeDB is using a JNDI name that is not bound jdbc/CloudscapeDB
How can I edit in the default file in J2EE.
Please help.
Thank youPlease, help and reply
-
Problem using JDBC (JNDI) DataSource and data-sources.xml w/ OC4J
I have a JClient application developed in JDev X. It works fine when using a JDBC URL for the connection (which then writes the connection into the BC4J.xcfg files, one for each application module). However, I would like the app to retrieve the data source from the server's data-sources.xml file. However, when, on the configurations tab of the application module I set the connection type to JDBC DataSource, and give it the JNDI name, it does not work, either with the embedded OC4J or the stand-alone OC4J. Any suggestions???
In the stand alone OC4J I verified that the data source exists (using java -jar admin.jar ormi://nemethzoltan3 admin welcome -application adatklinika -testDataSource -location jdbc/adatklinikaCoreDS) ... so the data source is defined in the data-sources.xml. Of course the error I get is JBO-30003.
If I just try to "test" the data source in Jdeveloper (using the context menu of the app module, and setting it to use the adatklinikaCoreDS) I get a JNDI error: unable to lookup data source and at level 3 a "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". I checked, the data source is defined under tools->embedded OC4J properties->data sources.
If I try to run the main form, simply nothing happens.
Please help!!!Ok, figured out why running from jdeveloper wasn't working: the embedded OC4J server wasn't started (start it by running an html page from your project or something...and make sure you don't have a stand-alone oc4j running). AND more importantly it didn't have the library "embedded oc4j client" library included (project properties -> profiles -> development -> libraries)...which is needed for whatever reason.
Now to try and get it working with the stand-alone OC4J... -
WLS 10.3, JDeveloper 11- JDBC/JNDI
I've been looking for a couple days now, and i can't find a understandable answer.
I am trying to implement Security into my ADF application. I would like it to use Active Directory, (possibly from more than 1 AD server) or permissions based on there DB users/passwords and roles.
I am using JDeveloper 11g production release, and ADF faces. I am not sure if we can use LDAP as i am not sure if it is set up. If anyone can lend a helping hand and let me know if any of these are viable options that would be great!!
If these are not good/viable options, is there a easy way to add users/roles to a existing production application without access to Jdeveloper or having to re-deploy the application?
Thanks Everyone!
Edited by: Dan Surkan on 18-Nov-2008 11:49 AM - changed subjectSo the above questions are still open and i have another,
I am trying to deploy my app to the WLS 10.3 server. I deploy through JDeveloper or through the server control panel (install the WAR file) and i get the same error for both:
<Nov 18, 2008 12:15:13 PM CST> <Error> <HTTP> <BEA-101371> <There was a failure when processing annotations for application ----directory----/LocalServer.war. Please make sure that
the annotations are valid. The error is javax.faces.webapp.FacesServlet>
<Nov 18, 2008 12:15:13 PM CST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with
ID '1227032103734' for task '0'. Error is: 'weblogic.application.ModuleException: Failed to load webapp: 'LocalServer.war'
weblogic.application.ModuleException: Failed to load webapp: 'LocalServer.war'
at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:387)
at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
Truncated. see log file for complete stacktrace
java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
Truncated. see log file for complete stacktrace
<Nov 18, 2008 12:15:14 PM CST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for app
lication 'Dashboard'.>
<Nov 18, 2008 12:15:14 PM CST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.application.ModuleException: Failed to load webapp: 'LocalServer.war'
at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:387)
at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
Truncated. see log file for complete stacktrace
java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
Truncated. see log file for complete stacktrace
Anyone have any insight on this.
If you need me to post any of my xml files, just let me know which ones and i will put them up ASAP!
ps. Yes i did the ADF patch for the WLS server.
--Dan Surkan
Edited by: Dan Surkan on 18-Nov-2008 1:40 PM -
JBOSS jndi Datasource: jdbc not bound
Im adding an jndi Datasource to JBOSS 4.0.2.
1. i copied jdbc driver to JBOSS_HOME/server/default/lib.
2. i copied following ds.xml to JBOSS_HOME/server/default/deploy (its based ony the mysql-ds.xml from the samples)
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>jndi-name</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/databasename</connection-url>
<driver-class>org.gjt.mm.mysql.Driver</driver-class>
<user-name>username</user-name>
<password>password</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>I look this up using java:jndi-name. Works perfect.
For compatibility with other containers, i want to move my jndi-datasource to java:comp/env/jdbc/jndi-name
So i change my ds-description:
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>comp/env/jdbc/jndi-name</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/databasename</connection-url>
<driver-class>org.gjt.mm.mysql.Driver</driver-class>
<user-name>username</user-name>
<password>password</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>Looking this up with java:comp/env/jdbc/jndi-name leads to Could not find datasource: java:comp/env/jdbc/jndi-name
javax.naming.NameNotFoundException: jdbc not bound
Some lines above jboss prints:
[WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:name=comp/env/jdbc/jndi-name,service=DataSourceBinding to JNDI name 'java:comp/env/jdbc/jndi-name
Please can somebody explain what the problem is about binding a datasource somewhere else than directly to "java:"In web.xml making the following entry:
<web-app>
<description>MySQL Test App</description>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/test</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
Next, add a file jboss-web.xml under WEB-INF/ folder of the web-application. This file should contain entry as:
<jboss-web>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/test</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<jndi-name>java:/jdbc/test</jndi-name>
<res-auth>Container</res-auth>
</resource-ref>
</jboss-web>
Next, in JBOSS_HOME/server/default/deploy folder make a xx-ds.xml file or else, a similiar file can be found in that same folder with the name hsqldb-ds.xml. Make following entries in that xml file:
<datasources>
<local-tx-datasource>
<jndi-name>/jdbc/test</jndi-name>
<type-mapping>MySQL</type-mapping>
<connection-url>jdbc:mysql://localhost:3306/shopping_cart</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<password>root123</password>
<min-pool-size>1</min-pool-size>
<max-pool-size>5</max-pool-size>
</local-tx-datasource>
This should bind the jndi name.
In our client application, we need to look up as:
Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:/jdbc/test");
Connection conn = ds.getConnection();
This works perfectly. -
Crystal Reports XI and Sun One 6.1 web server SP 5 Error finding JNDI name
I am trying to create a Crystal Reports XI report in a JSP using Sun One 6.1 Web server sp 5.
At this point I am getting the error �Error finding JNDI name� on Sun One
The application will run on Netbeans/Tomcat
I have done the following:
I edited CRConfig.xml
<?xml version="1.0" encoding="utf-8"?>
<CrystalReportEngine-configuration>
�
<DataDriverCommon>
<JavaDir>C:\Program Files\Java\j2re1.4.2_10\bin</JavaDir>
<Classpath>C:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14.jar;�</Classpath>
�
<JDBC>
<CacheRowSetSize>100</CacheRowSetSize>
<JDBCURL>jdbc:oracle:thin:@10.10.10.10:1521:dev</JDBCURL>
<JDBCClassName>oracle.jdbc.driver.OracleDriver</JDBCClassName>
<JDBCUserName>lab_ro</JDBCUserName>
<JNDIURL></JNDIURL>
�
</JDBC>
I created a report using JDBC (JNDI) connection and have the JNDI Connection set to the name of DATA.
The report works just fine in Crystal Reports.
Then in Netbeans I created an application and it runs in the Tomcat part of Netbeans
In context.xml I have:
<Context path="/BOEnterpriseTest3">
<Resource name="jdbc/dev" auth="Container" type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@10.10.10.10:1521:dev"
username="theuserid" password="thepassword" maxActive="20" maxIdle="10" maxWait="-1"/>
</Context>
In web.xml I have
<web-app>
<context-param>
<param-name>crystal_image_uri</param-name>
<param-value>crystalreportviewers11</param-value>
</context-param>
�
<taglib>
<taglib-uri>/crystal-tags-reportviewer.tld</taglib-uri>
<taglib-location>/WEB-INF/crystal-tags-reportviewer.tld</taglib-location>
</taglib>
<resource-ref>
<description>jdbc:oracle:thin:@10.10.10.10:1521:dev</description>
<res-ref-name>jdbc/dev10g</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-ref>
<description>jdbc:oracle:thin:@10.10.10.10:1521:dev</description>
<res-ref-name>Data</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
</web-app>
in web-inf\sun-web.xml I have
<sun-web-app>
<resource-ref>
<res-ref-name>jdbc/dev10g</res-ref-name>
<jndi-name>Data</jndi-name>
</resource-ref>
</sun-web-app>
I have copied all of Common Files\Business Objects\3.0\java\lib and Common Files\Business Objects\3.0\java\lib\external to the lib folder
I have copied crystalreportviewers11 to the root of my web application
I have tried to load the JNDI information and display the report
<%@page pageEncoding="UTF-8"
import="com.crystaldecisions.reports.reportengineinterface.*,
com.crystaldecisions.report.web.viewer.*,
javax.naming.*,
javax.sql.*,
java.sql.*"%>
<%
InitialContext initContext = new InitialContext();
DataSource source = (DataSource) initContext.lookup("java:comp/env/jdbc/dev10g");
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
try{
// Look up our data source
DataSource ds = (DataSource)initCtx.lookup("Data");
out.println("found ds under jdbc/Data");
catch ( NamingException e ){
// Look up our data source
DataSource ds = (DataSource) initContext.lookup("java:comp/env/jdbc/dev10g");
initCtx.bind("Data", ds);
out.println("found ds under java:com/env:jdbc/Data - bound into root initial context for Crystal to find");
%>
<%
//Use the relative path to the report; the physical or full qualified URL cannot be used.
String reportName = "useridincluded.rpt";
//Database username and password
String userName = "theuserid";
String password = "thepassword";
//check to see if the Report Source Session Variable already exist
Object reportSource = session.getAttribute("Report1");
// Create a new ConnectionInfos and ConnectionInfo object
com.crystaldecisions.sdk.occa.report.data.ConnectionInfos connectionInfos = new com.crystaldecisions.sdk.occa.report.data.ConnectionInfos();
com.crystaldecisions.sdk.occa.report.data.ConnectionInfo connectionInfo = new com.crystaldecisions.sdk.occa.report.data.ConnectionInfo();
//Set username and password for the report's database
connectionInfo.setUserName(userName);
connectionInfo.setPassword(password);
//Add object to collection
connectionInfos.add(connectionInfo);
//---------- Create a ReportClientDocument -------------
com.crystaldecisions.reports.sdk.ReportClientDocument reportClientDocument = new com.crystaldecisions.reports.sdk.ReportClientDocument();
//---------- Set the path to the location of the report soruce -------------
//Open report.
reportClientDocument.open(reportName, 0);
//Get the report source
reportSource = reportClientDocument.getReportSource();
//---------- Create the viewer and render the report -------------
//create the CrystalReportViewer object
com.crystaldecisions.report.web.viewer.CrystalReportViewer crystalReportViewer = new com.crystaldecisions.report.web.viewer.CrystalReportViewer();
//set the reportsource property of the viewer
crystalReportViewer.setReportSource(reportSource);
//set the DB logon into the viewer
crystalReportViewer.setDatabaseLogonInfos(connectionInfos);
//set viewer attributes
crystalReportViewer.setOwnPage(true);
crystalReportViewer.setOwnForm(true);
crystalReportViewer.refresh();
//set the CrystalReportViewer print mode
//crystalReportViewer.setPrintMode(com.crystaldecisions.report.web.viewer.CrPrintMode.ACTIVEX);
crystalReportViewer.setPrintMode(com.crystaldecisions.report.web.viewer.CrPrintMode.PDF);
//process the report
crystalReportViewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);
%>
On the Sun One Web server
On the Java Tab
JDBC Connection Pools
Pool Name = dev10g
Class name = oracle.jdbc.pool.OracleDataSource
User id = theuserid
url = 10.10.10.10
password=thepassword
JDBC Resources
JNDI Name=dev10g
Pool = dev10g
I get the error finding JNDI name � how do I tell Sun One where the JNDI is to make Crystal Reports work?I tried the following to test the JNDI
I am trying to do JNDI in Sun One Web server 6.1 sp 5 but I seem to be missing an important part. I get two different errors based on the JSP code, �Cannot retrieve data source: javax.naming.NamingException: Cannot create resource instance� or �Cannot retrieve data source: javax.naming.NamingException: Cannot create resource instance�.
Context.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/BOTest">
<Resource name="jdbc/dev10g" auth="Container" type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@10.10.10.10:1521:dev10g"
username="userid" password="password" maxActive="20" maxIdle="10" maxWait="-1"/>
<Resource name="Data" auth="Container" type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@10.10.10.10:1521:dev10g"
username="userid" password="password" maxActive="20" maxIdle="10" maxWait="-1"/>
</Context>Sun-one.xml:
<sun-web-app>
<context-root>BOTest</context-root>
<resource-ref>
<res-ref-name>jdbc/dev10g</res-ref-name>
<jndi-name>jdbc/dev10g</jndi-name>
</resource-ref>
</sun-web-app>web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
<resource-ref>
<description>jdbc:oracle:thin:@10.10.10.10:1521:dev10g</description>
<res-ref-name>jdbc/dev10g</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-ref>
<description>jdbc:oracle:thin:@10.10.10.10:1521:dev10g</description>
<res-ref-name>Data</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
</web-app>server.xml has:
<RESOURCES>
- <JDBCCONNECTIONPOOL name="dev10g" datasourceclassname="oracle.jdbc.pool.OracleDataSource" steadypoolsize="8" maxpoolsize="32" poolresizequantity="2" idletimeout="300" maxwaittime="60000" connectionvalidationrequired="off" connectionvalidationmethod="auto-commit" validationtablename="" failallconnections="off" transactionisolationlevel="read-uncommitted" isolationlevelguaranteed="off">
<PROPERTY name="URL" value="jdbc:oracle:thin:@10.45.3.197:1521:dev10g" />
<PROPERTY name="User" value="lab_ro" />
<PROPERTY name="Password" value="0asphalt1" />
</JDBCCONNECTIONPOOL>
<JDBCRESOURCE jndiname="jdbc/dev10g" poolname="dev10g" enabled="on" />
<JDBCRESOURCE jndiname="Data" poolname="dev10g" enabled="on" />
- <JDBCCONNECTIONPOOL name="Data" datasourceclassname="oracle.jdbc.pool.OracleDataSource" steadypoolsize="8" maxpoolsize="32" poolresizequantity="2" idletimeout="300" maxwaittime="60000" connectionvalidationrequired="off" connectionvalidationmethod="auto-commit" validationtablename="" failallconnections="off" transactionisolationlevel="read-uncommitted" isolationlevelguaranteed="off">
<PROPERTY name="User" value="lab_ro" />
<PROPERTY name="URL" value="jdbc:oracle:thin:@10.45.3.197:1521:dev10g" />
<PROPERTY name="Password" value="0asphalt1" />
</JDBCCONNECTIONPOOL>
<JDBCRESOURCE jndiname="jdbc/Data" poolname="Data" enabled="on" />
<JDBCRESOURCE jndiname="dev10g" poolname="dev10g" enabled="on" />
</RESOURCES>I am getting the following error: �Cannot retrieve data source: javax.naming.NamingException: Cannot create resource instance�
With the following code:
<%@page
import="java.io.*,
javax.sql.*,
javax.naming.*,
java.sql.*,
java.util.*"%>
<%
Context init;
Context ctx;
DataSource datasource;
Connection con;
try
init = new InitialContext();
Context envCtx = (Context) init.lookup("java:comp/env");
datasource = (DataSource) envCtx.lookup("jdbc/dev10g");
catch(NamingException ex)
out.print("Cannot retrieve data source: " + ex.toString(true));
return;
try
con = datasource.getConnection();
catch (Exception e)
out.print("Cannot retrieve connection: " + e.toString());
return;
try
PreparedStatement pstmt = con.prepareStatement("SELECT PROJNO FROM MATERIALSLAB.VW_ASPHALTHEADERINFO");
ResultSet results = pstmt.executeQuery();
while (results.next())
out.println(results.getString(1));
catch(Exception ex)
out.print("Got connection, can't execute query: " + ex.toString());
return;
%>I get the following error: Cannot retrieve data source: javax.naming.NamingException: Cannot create resource instance
With the following code:
<%@page
import="java.io.*,
javax.sql.*,
javax.naming.*,
java.sql.*,
java.util.*"%>
<%
Context init;
Context ctx;
DataSource datasource;
Connection con;
try
init = new InitialContext();
ctx = (Context) init.lookup("java:comp/env");
datasource = (DataSource) ctx.lookup("jdbc/dev10g");
catch(NamingException ex)
out.print("Cannot retrieve data source: " + ex.toString(true));
return;
try
con = datasource.getConnection();
catch (Exception e)
out.print("Cannot retrieve connection: " + e.toString());
return;
try
PreparedStatement pstmt = con.prepareStatement("SELECT PROJNO FROM MATERIALSLAB.VW_ASPHALTHEADERINFO");
ResultSet results = pstmt.executeQuery();
while (results.next())
out.println(results.getString(1));
catch(Exception ex)
out.print("Got connection, can't execute query: " + ex.toString());
return;
%> -
Hi,
I have an rpt file developed in crystal report 2008. it connects to SQL Server using ODBC(RDO) connection. I have a jsp file that needs to change the datasource to use JDBC (JNDI). The scriptlet for changing datasource is given below. I have my sqljdbc.jar in the web-inf\lib folder of my application as well as in \server\{server_name}\lib folder. when I try to run the jsp it gives me error as follows :
ERROR [com.businessobjects.reports.sdk.JRCCommunicationAdapter] detected an exception: Error loading JDBC driver. The class 'com.microsoft.jdbc.sqlserver.SQLServerDriver' could not be found.
at com.crystaldecisions.reports.queryengine.Connection.t1(Unknown Source)
at com.crystaldecisions.reports.dataengine.dfadapter.DFAdapter.a(Unknown Source)
at com.crystaldecisions.reports.dataengine.dfadapter.DFAdapter.for(Unknown Source)
at com.crystaldecisions.reports.reportdefinition.ReportHelper.a(Unknown Source)
at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.long(Unknown Source)
at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.a(Unknown Source)
at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.byte(Unknown Source)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(Unknown Source)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(Unknown Source)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(Unknown Source)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(Unknown Source)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(Unknown Source)
at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(Unknown Source)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(Unknown Source)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(Unknown Source)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
at com.businessobjects.sdk.erom.jrc.a.a(Unknown Source)
at com.businessobjects.sdk.erom.jrc.a.execute(Unknown Source)
at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(Unknown Source)
at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(Unknown Source)
at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.ds.a(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
at ....
<br>
<br>
Scriptlet :
<%
//Report can be opened from the relative location specified in the CRConfig.xml, or the report location
//tag can be removed to open the reports as Java resources or using an absolute path (absolute path not recommended
//for Web applications).
final String DBUSERNAME = "sa";
final String DBPASSWORD = "password";
final String CONNECTION_STRING = "!com.microsoft.jdbc.sqlserver.SQLServerDriver!jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=;user=;password=";
final String TRUSTEDCON = "false";
final String PREQESERVERNAME = "jdbc:microsoft:sqlserver://localhost:1433";
final String SERVERTYPE = "JDBC (JNDI)";
final String DATABASE_DLL = "crdb_jdbc.dll";
final String DATABASE = "bssc";
final String DBCLASSNAME = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
final String USEJDBC = "true";
final String DATABASE_NAME = "bssc";
final String SERVERNAME = "jdbc:microsoft:sqlserver://localhost:1433";
final String CONNECTIONURL = "jdbc:microsoft:sqlserver://localhost:1433";
final String SERVER = "localhost";
%>
<%
final Logger logger = Logger.getLogger(ReportAction.class.getName());
final String REPORT_NAME = "../reports/Krt.rpt";
try {
ReportClientDocument oReportClientDocument = new ReportClientDocument();
oReportClientDocument.open(REPORT_NAME, 0);
// Create the two connectioninfo objects to use
IConnectionInfo oldConnectionInfo = new ConnectionInfo();
IConnectionInfo newConnectionInfo = new ConnectionInfo();
// Assign the old Connection info to the reports current info
DatabaseController dbController = oReportClientDocument.getDatabaseController();
oldConnectionInfo = dbController.getConnectionInfos(null).getConnectionInfo(0);
// If this connection needed parameters, we would use this field.
Fields pFields = null;
// Create a new propertybag for the new location
PropertyBag boPropertyBag1 = new PropertyBag();
// Set new table logon properties
boPropertyBag1.put("JDBC Connection String", CONNECTION_STRING);
boPropertyBag1.put("Trusted_Connection", TRUSTEDCON);
boPropertyBag1.put("PreQEServerName", PREQESERVERNAME);
boPropertyBag1.put("Server Type", SERVERTYPE);
boPropertyBag1.put("Database DLL", DATABASE_DLL);
boPropertyBag1.put("Database", DATABASE);
boPropertyBag1.put("Database Class Name", DBCLASSNAME);
boPropertyBag1.put("Use JDBC", USEJDBC);
boPropertyBag1.put("Database Name", DATABASE_NAME);
boPropertyBag1.put("Server Name", SERVERNAME);
boPropertyBag1.put("Connection URL", CONNECTIONURL);
boPropertyBag1.put("Server", SERVER);
// Assign the properties to the connection info
newConnectionInfo.setAttributes(boPropertyBag1);
// Set the DB Username and Pwd
newConnectionInfo.setUserName(DBUSERNAME);
newConnectionInfo.setPassword(DBPASSWORD);
// The Kind of connectionInfos is SQL
newConnectionInfo.setKind(ConnectionInfoKind.SQL);
// set the parameters to replace.
// The 4 options are:
// _doNotVerifyDB
// _ignoreCurrentTableQualifiers
// _mapFieldByRowsetPosition
// _useDefault
int replaceParams = DBOptions._ignoreCurrentTableQualifiers + DBOptions._doNotVerifyDB;
// Now replace the connections
dbController.replaceConnection(oldConnectionInfo, newConnectionInfo, pFields, replaceParams);
%>
<%
//Report can be opened from the relative location specified in the CRConfig.xml, or the report location
//tag can be removed to open the reports as Java resources or using an absolute path (absolute path not recommended
//for Web applications).
final String DBUSERNAME = "sa";
final String DBPASSWORD = "password";
final String CONNECTION_STRING = "!com.microsoft.jdbc.sqlserver.SQLServerDriver!jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=;user=;password=";
final String TRUSTEDCON = "false";
final String PREQESERVERNAME = "jdbc:microsoft:sqlserver://localhost:1433";
final String SERVERTYPE = "JDBC (JNDI)";
final String DATABASE_DLL = "crdb_jdbc.dll";
final String DATABASE = "bssc";
final String DBCLASSNAME = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
final String USEJDBC = "true";
final String DATABASE_NAME = "bssc";
final String SERVERNAME = "jdbc:microsoft:sqlserver://localhost:1433";
final String CONNECTIONURL = "jdbc:microsoft:sqlserver://localhost:1433";
final String SERVER = "localhost";
%>
<%
final Logger logger = Logger.getLogger(ReportAction.class.getName());
final String REPORT_NAME = "../reports/Krt.rpt";
try {
ReportClientDocument oReportClientDocument = new ReportClientDocument();
oReportClientDocument.open(REPORT_NAME, 0);
// Create the two connectioninfo objects to use
IConnectionInfo oldConnectionInfo = new ConnectionInfo();
IConnectionInfo newConnectionInfo = new ConnectionInfo();
// Assign the old Connection info to the reports current info
DatabaseController dbController = oReportClientDocument.getDatabaseController();
oldConnectionInfo = dbController.getConnectionInfos(null).getConnectionInfo(0);
// If this connection needed parameters, we would use this field.
Fields pFields = null;
// Create a new propertybag for the new location
PropertyBag boPropertyBag1 = new PropertyBag();
// Set new table logon properties
boPropertyBag1.put("JDBC Connection String", CONNECTION_STRING);
boPropertyBag1.put("Trusted_Connection", TRUSTEDCON);
boPropertyBag1.put("PreQEServerName", PREQESERVERNAME);
boPropertyBag1.put("Server Type", SERVERTYPE);
boPropertyBag1.put("Database DLL", DATABASE_DLL);
boPropertyBag1.put("Database", DATABASE);
boPropertyBag1.put("Database Class Name", DBCLASSNAME);
boPropertyBag1.put("Use JDBC", USEJDBC);
boPropertyBag1.put("Database Name", DATABASE_NAME);
boPropertyBag1.put("Server Name", SERVERNAME);
boPropertyBag1.put("Connection URL", CONNECTIONURL);
boPropertyBag1.put("Server", SERVER);
// Assign the properties to the connection info
newConnectionInfo.setAttributes(boPropertyBag1);
// Set the DB Username and Pwd
newConnectionInfo.setUserName(DBUSERNAME);
newConnectionInfo.setPassword(DBPASSWORD);
// The Kind of connectionInfos is SQL
newConnectionInfo.setKind(ConnectionInfoKind.SQL);
// set the parameters to replace.
// The 4 options are:
// _doNotVerifyDB
// _ignoreCurrentTableQualifiers
// _mapFieldByRowsetPosition
// _useDefault
int replaceParams = DBOptions._ignoreCurrentTableQualifiers + DBOptions._doNotVerifyDB;
// Now replace the connections
dbController.replaceConnection(oldConnectionInfo, newConnectionInfo, pFields, replaceParams);
%>
I am not sure why it is not able to get the Driver since the required jar is there in lib folder? Am I missing something ?
Edited by: sb-onward on Jul 30, 2009 6:01 PMHi,
Make sure you have set the Classpath in CRConfig.xml for the jdbc jar.
Place the CrConfig.xml in the classes directory of your application.
Please let me know the results.
Regards,
Neeraj -
Error with JNDI when creating new data source
Hi :
This weekend, while adding new applications to the production environment we ran into a problem where the JNDI tree of the new managed servers was unreachable.
The error message we saw was:
<1364066840022> <BEA-149231> <Unable to set the activation state to true for the application 'EOI'.
weblogic.application.ModuleException:
at weblogic.jdbc.module.JDBCModule.activate(JDBCModule.java:349)
at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:107)
at weblogic.application.internal.flow.DeploymentCallbackFlow$2.next(DeploymentCallbackFlow.java:411)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:74)
at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:66)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:16)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:162)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)
at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doPrepare(DeploymentAdapter.java:42)
at weblogic.management.deploy.internal.DeploymentAdapter.prepare(DeploymentAdapter.java:187)
at weblogic.management.deploy.internal.AppTransition$1.transitionApp(AppTransition.java:21)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
at weblogic.management.deploy.internal.ConfiguredDeployments.prepare(ConfiguredDeployments.java:165)
at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:122)
at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
weblogic.common.ResourceException: is already bound
at weblogic.jdbc.common.internal.RmiDataSource.start(RmiDataSource.java:387)
at weblogic.jdbc.common.internal.DataSourceManager.createAndStartDataSource(DataSourceManager.java:136)
at weblogic.jdbc.common.internal.DataSourceManager.createAndStartDataSource(DataSourceManager.java:97)
at weblogic.jdbc.module.JDBCModule.activate(JDBCModule.java:346)
at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:107)
at weblogic.application.internal.flow.DeploymentCallbackFlow$2.next(DeploymentCallbackFlow.java:411)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:74)
at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:66)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:16)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:162)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)
at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doPrepare(DeploymentAdapter.java:42)
at weblogic.management.deploy.internal.DeploymentAdapter.prepare(DeploymentAdapter.java:187)
at weblogic.management.deploy.internal.AppTransition$1.transitionApp(AppTransition.java:21)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
at weblogic.management.deploy.internal.ConfiguredDeployments.prepare(ConfiguredDeployments.java:165)
at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:122)
at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
We traced the issue to a new data source that was added were we found that along with the the expected jndi name entry in the jdbc xml file, there were two blank entries:
<jndi-name>weblogic.jdbc.DataSource.EOI</jndi-name>
<jndi-name></jndi-name>
<jndi-name></jndi-name>
The data source was deleted, consoles restarted, the data source recreated and the issue occured again. To get by the issue we had to manually remove the blank tags from the xml file.
We created 2 new data sources, and it only happened on the one. The same data source each time. Additionally, this issue did not occur when these changes were made in our lower (development, qa) regions.
The version is the same in all three regions.
WebLogic Version:
WebLogic Server Temporary Patch for 9324911 Wed Feb 03 22:38:01 PST 2010
WebLogic Server 10.3 Fri Jul 25 16:30:05 EDT 2008 1137967
Is this a known issue? And if so, is there a way to avoid it, other than to start constantly checking the newly created XML files?
Thank you
tedYes, this is a common issue and documented in Oracle Docs:
WebLogic Server: Getting "weblogic.common.ResourceException: is already bound" exception with JDBC JNDI name (Doc ID 1154250.1)
The only fix is that you need to remove the empty value entries.
Cheers!!
AJ -
Can not deploy a report using JDBC connection on CR2008 Server
Hi Group,
I have a report created with JDBC connection. When I tried to add it to CR2008 server, it gives an error - "An unexpected error has occurred ". Basically I want to add a report to a public folder via CMC. I am using adminstrator account.
Then I thought I need to add JDBC driver into CR2008 server. so I put oracle jdbc jar into CR2008 server classpath and add JDBC connection info into CRConfig.xml. but I still got the same error.
I also tried:
- Change the report to use native Oracle driver rather than JDBC. The deployment succeeded (but this is not what I want)
- Add a data source connection via Business View Manager, but no luck.
I know how to use/change jdbc connection with programtic way, but I just want to know if I want to use built-in components in CR2008 server without any coding the reports can be deployed and managed.
Thanks in advance.
DennisHello Will,
Crystal Reports supports connections to JDBC/JNDI out of the box, and have done so for a while, whether stand-alone or published to Enterprise.
To specify where the server would search for the JDBC driver jar files, you'd change the classpath tag found in the CRConfig.xml file found on the machine where the Crystal Reports Page or Job Server is running.
For early Crystal Enterprise 10 and before, it used Java Native Interface (JNI) to start the Java process to retrieve the data from the JDBC connection.
For later Crystal Enterprise 10 and later, it starts off a "Java Server" process, and communicates to the Crystal Reports process via CORBA TCP/IP connection.
Commonissues that may arise: (1) CRConfig.xml not configured properly, (2) unable to start or communicate to the "Java Server" because of permissions or firewall.
Note that this is a separate connectivity map from using ADO or ADO.NET.
Sincerely,
Ted Ueda
Maybe you are looking for
-
IPod Not syncing in iTunes. 7.6 - stuck on do not disconnect as below
Re-posting as a separate message as it may not have been noticed as a reply. I'm having a similar problem to the one noted in 7.5 but it appears I have iTunes 7.6 and a 5th generation 80g iPod. Been syncing it to my new MacBook with OS 10.5.2. Origin
-
Netapp All-Flash FAS (AFF) – What Does This Mean?
by NetApp A-Team Member Glenn Dekhayser, Practice Lead, Office of the CTO, Red8 A bunch of my contemporaries have published excellent technical blogs on NetApp's recent release of their All-Flash FAS systems and simultaneous massive reduction in the
-
Personal domain hosted at MobileMe - but not showing up.
You guys have already helped me out so much on this forum, so thank you. Here's the problem. Several days ago, I transferred my domain to MobileMe and changed the CNAME info at Network Solutions (my domain registrar). But for some reason, when I visi
-
Condition type & tax code & does not exist
Hi, I have a problem to find out the reason why i can not process documents which came via IDocs from Sales SAP system. The error is "Condition type & tax code & does not exist". Following places i have already checked : 1. FTXP - tax code for which
-
How to configurw n/w in SUSE Linux
Hi all, i have to install oracle 10g on suse linux server, i have installed suse linux on m/c , iwant ot configure n/w in the same ,but i couldn't... i have used yast but still couldn't able to configure the n/w