About JDBC and JNDI
in my Program i wrote :
public class Connect {
String stat = "Not Connected";
public void init()
try {
Context ctx= new InitialContext();
if(ctx == null)
throw new Exception("no Context");
DataSource ds =(DataSource)ctx.lookup
("java:comp/env/jdbc/BooksDB");
if(ds != null)
Connection conn= ds.getConnection();
if (conn !=null)
So, when i run this program i get the following error message:
unreachable statement:
DataSource ds =(DataSource)ctx.lookup
("java:comp/env/jdbc/BooksDB");
Can anybody pls tell me why i am getting this error and how can i solve it.
throw new Exception("no Context");
rce ds =(DataSource)ctx.lookup
"java:comp/env/jdbc/BooksDB");When you throw the excpetion, the line following will be bypassed so it can never be reached!
Similar Messages
-
A very surprise problem about JDBC and connection pool
I occur a very problem about JDBC and connection pool on Weblogic Platform
8.1.
There is a table in Oracle
Table
Name: t1
id varchar2(5);
content clob;
id is primary key.
If I use a connection pool to connect to Oracle,like following program:
InitialContext ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup("cgOracleDataSource");
con = ds.getConnection();
then following program will throw a ClassCastException
String sql = "select content from t1 where id = ?";
PreparedStatement pst = con.prepareStatement(sql);
pst.setString(1,"001");
oracle.sql.CLOB clob = (oralce.sql.CLOB)rs.getClob("content") //this
statement will throw ClassCastException
but if I use JNDI to connect to Oracle,like following program, then those
program above is ok
private String dbdriver="oracle.jdbc.driver.OracleDriver";
private String dburl="jdbc:oracle:thin:@192.168.7.148:1521:ep";
private String username="ep";
private String password="epuser";
Class.forName(dbdriver);
conn = DriverManager.getConnection(dburl, username, password);
conn.setAutoCommit(false);
On the contrary, if I use JNDI to connect to Oracle, following program will
throw ClassCastException
weblogic.jdbc.vendor.oracle.OracleThinClob clob =
(weblogic.jdbc.vendor.oracle.OracleThinClob)rs.getClob("content");
but it is fine if I use connection pool to connect to Oracle.
I am confused this problem, who can tell me why?
DanielWhen you are getting connection using datasource lookup from weblogic
connection pool, this connection is internally wrapped and hence you have to
cast it to weblogic.jdbc.vendor.oracle.OracleThinClob which you do and so it
works.
But when you get connection by loading driver straight, you are getting naked
oracle connection. In this case when you cast it to oracle.sql.Clob it works,
as you have seen in your test case.
I hope this explains what is going on with your code.
Thanks,
Mitesh
Daniel wrote:
I occur a very problem about JDBC and connection pool on Weblogic Platform
8.1.
There is a table in Oracle
Table
Name: t1
id varchar2(5);
content clob;
id is primary key.
If I use a connection pool to connect to Oracle,like following program:
InitialContext ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup("cgOracleDataSource");
con = ds.getConnection();
then following program will throw a ClassCastException
String sql = "select content from t1 where id = ?";
PreparedStatement pst = con.prepareStatement(sql);
pst.setString(1,"001");
oracle.sql.CLOB clob = (oralce.sql.CLOB)rs.getClob("content") //this
statement will throw ClassCastException
but if I use JNDI to connect to Oracle,like following program, then those
program above is ok
private String dbdriver="oracle.jdbc.driver.OracleDriver";
private String dburl="jdbc:oracle:thin:@192.168.7.148:1521:ep";
private String username="ep";
private String password="epuser";
Class.forName(dbdriver);
conn = DriverManager.getConnection(dburl, username, password);
conn.setAutoCommit(false);
On the contrary, if I use JNDI to connect to Oracle, following program will
throw ClassCastException
weblogic.jdbc.vendor.oracle.OracleThinClob clob =
(weblogic.jdbc.vendor.oracle.OracleThinClob)rs.getClob("content");
but it is fine if I use connection pool to connect to Oracle.
I am confused this problem, who can tell me why?
Daniel -
hi, i found this error while im generating a report
for my system, "Aging of Accounts Receivables"
hope someone might give me a hint to what should i do.
here's my StackTrace:
***Exception:
org.postgresql.util.PSQLException: The connection attempt failed because Exception: java.net.BindException: Address already in use: connect
Stack Trace:
java.net.BindException: Address already in use: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:179)
at org.postgresql.core.PGStream.<init>(PGStream.java:47)
at org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:197)
at org.postgresql.Driver.connect(Driver.java:139)
org.postgresql.util.PSQLException: The connection attempt failed because Exception: java.net.BindException: Address already in use: connect
Stack Trace:
java.net.BindException: Address already in use: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:179)
at org.postgresql.core.PGStream.<init>(PGStream.java:47)
at org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:197)
at org.postgresql.Driver.connect(Driver.java:139)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at org.postgresql.jdbc2.optional.BaseDataSource.getConnection(BaseDataSource.java:72)
at org.postgresql.jdbc2.optional.BaseDataSource.getConnection(BaseDataSource.java:55)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at org.postgresql.jdbc2.optional.BaseDataSource.getConnection(BaseDataSource.java:72)
at org.postgresql.jdbc2.optional.BaseDataSource.getConnection(BaseDataSource.java:55)
at org.postgresql.jdbc3.Jdbc3ConnectionPool.getPooledConnection(Jdbc3ConnectionPool.java:39)
at org.postgresql.jdbc3.Jdbc3ConnectionPool.getPooledConnection(Jdbc3ConnectionPool.java:39)
at org.postgresql.jdbc2.optional.PoolingDataSource.getPooledConnection(PoolingDataSource.java:406)
at org.postgresql.jdbc2.optional.PoolingDataSource.getConnection(PoolingDataSource.java:338)
at csfwdbillingmodules.dbConnect.<init>(dbConnect.java:73)
at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.processAccountAR(frmAgingOfAccounts.java:794)
at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.genDetailedReport(frmAgingOfAccounts.java:1102)
at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.doInBackground(frmAgingOfAccounts.java:406)
at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.doInBackground(frmAgingOfAccounts.java:400)
at javax.swing.SwingWorker$1.call(SwingWorker.java:279)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at javax.swing.SwingWorker.run(SwingWorker.java:319)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
End of Stack Trace
at org.postgresql.jdbc2.optional.PoolingDataSource.getPooledConnection(PoolingDataSource.java:406)
at org.postgresql.jdbc2.optional.PoolingDataSource.getConnection(PoolingDataSource.java:338)
at csfwdbillingmodules.dbConnect.<init>(dbConnect.java:73)
at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.processAccountAR(frmAgingOfAccounts.java:794)
at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.genDetailedReport(frmAgingOfAccounts.java:1102)
at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.doInBackground(frmAgingOfAccounts.java:406)
at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.doInBackground(frmAgingOfAccounts.java:400)
at javax.swing.SwingWorker$1.call(SwingWorker.java:279)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:208)
at org.postgresql.Driver.connect(Driver.java:139)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at org.postgresql.jdbc2.optional.BaseDataSource.getConnection(BaseDataSource.java:72)
at org.postgresql.jdbc2.optional.BaseDataSource.getConnection(BaseDataSource.java:55)
at org.postgresql.jdbc3.Jdbc3ConnectionPool.getPooledConnection(Jdbc3ConnectionPool.java:39)
at org.postgresql.jdbc2.optional.PoolingDataSource.getPooledConnection(PoolingDataSource.java:406)
at org.postgresql.jdbc2.optional.PoolingDataSource.getConnection(PoolingDataSource.java:338)
at csfwdbillingmodules.dbConnect.<init>(dbConnect.java:73)
at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.processAccountAR(frmAgingOfAccounts.java:794)
at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.genDetailedReport(frmAgingOfAccounts.java:1102)
at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.doInBackground(frmAgingOfAccounts.java:406)
at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.doInBackground(frmAgingOfAccounts.java:400)
at javax.swing.SwingWorker$1.call(SwingWorker.java:279)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at javax.swing.SwingWorker.run(SwingWorker.java:319)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
java.lang.NullPointerException
at csfwdbillingmodules.dbConnect.query(dbConnect.java:96)
at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.processAccountAR(frmAgingOfAccounts.java:798)
at csfwdbillingmodules.frmAgingOfAccounts$genAgingOfAccounts.genDetailedReport(frmAgingOfAccounts.java:1102)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at javax.swing.SwingWorker.run(SwingWorker.java:319)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
End of Stack Trace
here's my dbConnect.class:
* dbConnect.java
* Created on November 14, 2006, 5:06 PM
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
* @author darkoasis
package csfwdbillingmodules;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketAddress;
import java.net.SocketException;
import java.net.SocketImpl;
import java.sql.*; // All we need for JDBC
import javax.naming.NamingException;
import org.postgresql.jdbc3.Jdbc3PoolingDataSource;
public class dbConnect
extends java.lang.Object
private Socket socket;
private SocketImpl socketImpl;
private int refPosition = 0;
private Jdbc3PoolingDataSource source = new Jdbc3PoolingDataSource();
private DriverManager drvMgr;
private Connection db = null; // A connection to the database
private Statement sql; // Our statement to run queries with
private ResultSet results; // A result container
private DatabaseMetaData dbmd; // This is basically info the driver delivers
// about the DB it just connected to. I use
// it to get the DB version to confirm the
// connection in this example.
/** Creates a new instance of dbConnect */
public dbConnect()
try
this.source.setServerName("10.10.10.10");
this.source.setDatabaseName("myDB");
this.source.setUser("xxxx");
this.source.setPassword("xxxx");
this.db = this.source.getConnection();
this.socket = new Socket();
dbmd = this.db.getMetaData(); //get MetaData to confirm connection
sql = this.db.createStatement(); //create a statement that we can use later
catch (Exception ex)
System.out.println("***Exception:\n"+ex);
ex.printStackTrace();
public ResultSet query(String strSQL)
throws SQLException
this.results = this.sql.executeQuery(strSQL);
return this.results;
public void update(String strSQL)
throws SQLException
this.sql.executeUpdate(strSQL);
public void close()
throws Exception
this.db.close();
this.socket.close();
this.source.close();
public boolean isClosed()
throws SQLException
return this.db.isClosed();
i ran into some forums and found this:
Hi Graham
I'm making a bit of progress. I found a website that suggested the following
This is a problem of the used sockets with Windows NT. You can request the active sockets with the command netstat. The problem is a function of:
MaxUserPort (default 5000)
KeepAliveTime (default 120)
it suggested the workaround was connection pooling
I have run netstat to look at the number of connections when the problem occurs and waited for the timeout to reset the os back to the minimum and on each occasion my report has run
Does this sound logical?
If so
do you have any examples on connection pooling
it seems that even if i have closed my database connection it still doesn't free my port that was used, that's why i get this error
i am looking for a way to close my db connection and free its socket or port used at the same time, hope you can help,
thanks in advanceLet me modestly point you at mine: http://www.telekinesis.com.au/wipv3_6/FundamentalNetworkingInJava.A21
-
A question about JDBC and MySQL
hello dear friends,ask a question:
if in MySQL database, i have defined a clumon as TEXT data type.
when i use JDBC, i use which kind of java data type to hold TEXT,
i mean which getXXX() method i should use.
is it possible i just use getObject() and cast it to a binarystream??
thanks in advanced.use this:
declare it 1st
String x ="";
then u can now get the value of the field...
x = getString("<fieldName>");is there length limitation?
for example, i want store a String which is got from a JTextArea, i also treat it as String and insert into the column with TEXT datatype like
insert table_name (text_column) values( string_1)
this works in JSP, should work in JAVA too...
hope i helped... ^_^ -
hello..!
I want to learn webservices using java and MySql. can anybody tell me how can I set up jdbc connection in my w/s? I am using tomcat and axis.
Thank you.
.MohitAxis and JDBC aren't really related technologies. Learn how to write a JDBC program. Learn how to write an Axis program. Er... that's it.
-
Question about JDBC and Oracle 10g AL32UTF8
Hey all,
Currently I have a Java program that uses lib: ojdbc14.zip. It works fine for our Oracle 10g database, but when we converted our character set to AL32UTF8, our program seems to have stopped working properly. For instance, I grab a count(*), to see how many rows an ID has in a table. Then I take that list and display and count(*) that are greater than 0. Well, my first getString works properly to generate the select count(*) statements for all the tables in the database. But then when I execute those select count(*) I can grab out the number greater than 0. That's column 1. Then the owner name is displayed in column 2. and the table name is displayed in column 3. When I do a getString(2) we only get the first letter (sometimes) of the owner of the table. Same with the table name.
For instance, before AL32UTF8
getString(2): SCOTT
getString(3): PEOPLE
After
getString(2): S
getString(3): P
Now to open my connection I use:
static Connection conn;
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn = DriverManager.getConnection(connection_string, username, password);
And to create query I use:
Statement query_1 = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
Any help will be greatly appreciated. Thanks
Sincerely,
Melorkun wrote:
I was wondering whether it was a correct way :
-retrieving data with resultset and putting them to an arraylist, then getting to jsf datatable.Your question/problem statement is unclear, but just lookup the DAO pattern.
Is there any better way I can speed up retrieving data from databse ?Performance is a matter of good code and datamodel and decent hardware. -
Question about jdbc and jsf datatable
hello
I was wondering whether it was a correct way :
-retrieving data with resultset and putting them to an arraylist, then getting to jsf datatable.
or
Is there any better way I can speed up retrieving data from databse ?
regardsorkun wrote:
I was wondering whether it was a correct way :
-retrieving data with resultset and putting them to an arraylist, then getting to jsf datatable.Your question/problem statement is unclear, but just lookup the DAO pattern.
Is there any better way I can speed up retrieving data from databse ?Performance is a matter of good code and datamodel and decent hardware. -
Which tutorials may you suggest for JDBC and servlets?
Hello, i would to learn about JDBC and servlets.
May you please suggest me a good tutorial(e.g.post me a link) in order to study for JDBC and servlets?
e.g. How to make a servlet etc.
Thanks, in advance!I agree with PhHein, it's best to learn one technology and then the other. (Just my two cents, but start with JDBC from a simple standalone application, then when that is working, try to tackle Servlets, since you will need to also learn how to get them working in a container like Tomcat).
Here is a tutorial that has both concepts in it at the same time. Site is down now, but is usually up. http://www.roseindia.net/jdbc/jdbcconnectivity.shtml
Also, you will eventually want to download a J2EE container such as Tomcat or Jboss.
- Saish -
Question about Java RMI/JNDI/IIOP and Linux IPCHAINS.
IPChains only recognises, per se, three protocols
-TCP
-UDIP
-ICMP
as I grasp things. Can one mention IIOP
directly in an IPCHAINS firewall,
or is one forced to allow one particular IP,
by protocol and Port number?
What is recommended for RMI
and JNDI here?Zac1234 wrote:
IPChains only recognises, per se, three protocolsipchains? Blimey, I thought iptables took over from that ages ago.
-TCP
-UDIP
-ICMP
as I grasp things. Can one mention IIOP
directly in an IPCHAINS firewall,doubt it; although you could set up a rule for it called IIOP
or is one forced to allow one particular IP,
by protocol and Port number?that'd be where I'd start
What is recommended for RMI
and JNDI here?Well according to [this page|http://en.wikipedia.org/wiki/General_Inter-ORB_Protocol]:
+"IIOP (Internet Inter-Orb Protocol) is the implementation of GIOP for TCP/IP."+
so I suspect you'll only have to worry about TCP packets. However, details of the protocol itself are something you should Google for if you want definitive answers. Alternatively, consult someone who's used to maintaining firewalls.
Winston
Edited by: YoungWinston on Apr 17, 2010 3:54 AM
PS: This is a Java forum -
Problem with creating Connection pool and JNDI, driver is not detected
Hi,
I have an issue with creating Connection Pool and JNDI.
I'm using:
- JDK 1.6
- OS: Linux(ubuntu 8.10)
- Netbeans IDE 6.5.1
- Java EE 5.0
- Apache Tomcat 6.0.18 Its lib directory contains all necessary jar files for Oracle database driver
- Oracle 11g Enterprise
My problem is that the Oracle database driver is not detected when I want to create a pool (it works pretty well and is detected without any problem when I create ordinary connection by DriverManager)
Therefore after running:
InitialContext ic = new InitialContext();
Context context = (Context)ic.lookup("java:comp/env");
DataSource dataSource = (DataSource)context.lookup("jdbc/oracle11g");
Connection connection = dataSource.getConnection();and right after dataSource.getConnection() I have the following exception:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'oracle.jdbc.OracleDriver'
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1136)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at servlets.Servlet1.doPost(Servlet1.java:47)
at servlets.Servlet1.doGet(Servlet1.java:29)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1130)
... 17 more
My application context file (context.xml) is:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/WebApplication3">
<Resource auth="Container"
driverClassName="oracle.jdbc.OracleDriver"
maxActive="8"
maxIdle="4"
name="jdbc/oracle11g"
username="scott"
password="tiger"
type="javax.sql.DataSource"
url="jdbc:oracle:thin:@localhost:1521:database01" />
</Context>and my web.xml is:
<resource-ref>
<description>Oracle Datasource example</description>
<res-ref-name>jdbc/oracle11g</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
...I found similar threads in different forums including sun, such as
http://forums.sun.com/thread.jspa?threadID=567630&start=0&tstart=0
http://forums.sun.com/thread.jspa?threadID=639243&tstart=0
http://forums.sun.com/thread.jspa?threadID=5312178&tstart=0
, but no solution.
As many suggest, I also tried to put context directly in the server.xml (instead of my application context) and referencing it by <ResourceLink /> inside my application context but it didn't work and instead it gave me the following message:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class ' ' for connect URL 'null'
Has anyone succeeded in creating a connection pool with JNDI by using Tomcat 6 or higher ? If yes, could kindly explain about the applied method.
Regards,Hello again,
Finally I managed to run my application also with Tomcat 6.0.18. There was only two lines that had to be modified
in the context.xml file (the context of my application project and not server's)
Instead of writing
<Context antiJARLocking="true" path="/WebApplication2">
type="javax.sql.DataSource"
factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
</Context>we had to write:
<Context antiJARLocking="true" path="/WebApplication2">
type="oracle.jdbc.pool.OracleDataSource"
factory="oracle.jdbc.pool.OracleDataSourceFactory"
</Context>- No modification was needed to be done at server level (niether server.xml nor server context.xml)
- I just added the ojdbc6.jar in $CATALINA_HOME/lib (I didn't even need to add it in WEB-INF/lib of my project)
- The servlet used to do the test was the same that I presented in my precedent post.
For those who have encountered my problem and are interested in the format of the web.xml and context.xml
with Tomcat 6.0, you can find them below:
Oracle server: Oracle 11g Enterprise
Tomcat server version: 6.0.18
Oracle driver: ojdbc.jar
IDE: Netbeans 6.5.1
The context.xml file of the web application
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/WebApplication2">
<Resource name="jdbc/oracle11g"
type="oracle.jdbc.pool.OracleDataSource"
factory="oracle.jdbc.pool.OracleDataSourceFactory"
url="jdbc:oracle:thin:@localhost:1521:database01"
driverClassName="oracle.jdbc.OracleDriver"
userName="scott"
password="tiger"
auth="Container"
maxActive="100"
maxIdle="30"
maxWait="10000"
logAbandoned="true"
removeAbandoned="true"
removeAbandonedTimeout="60" />
</Context>The web.xml of my web application
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<resource-ref>
<description>Oracle Database 11g DataSource</description>
<res-type>oracle.jdbc.pool.OracleDataSource</res-type>
<res-auth>Container</res-auth>
<res-ref-name>jdbc/oracle11g</res-ref-name>
</resource-ref>
<servlet>
<servlet-name>Servlet1</servlet-name>
<servlet-class>servlets.Servlet1</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Servlet1</servlet-name>
<url-pattern>/Servlet1</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>Ok, now I'm happy as the original problem is completely solved
Regards -
Hi
I'm a beginner in JNDI
i'm used to connect the Oracle DB using JDBC ,
now i want to use the JNDI to get a connection pooling
i've read alot of Documentation about this field and i need to know how to set the LookUp Name to my database
thank youI am not sure how to add configuration in Oracle App Server. But this how you have to do.
Create a connection object in the app server in the name jdbc/Test . (jdbc/Test is the name of the connection which will be used to get refernece from the JNDI). In the App server you have to create the connection with you userid, password and URL for the connection.
URL - jdbc:oracle:thin:@servername:1521:databasename
You may need to have the connection from EJB or may be from the JSP or bean class. If the connection is required in EJB, then EJB container will get the reference. For JSP or Bean the web container will get the reference. You need to make specific entries in ejb-jar.xml and oracle-ejb-jar.xml (I hope there will be file in this name. Beacause for me I have sun-ejb-jar.xml for Sun App server.) for EJB container and in web.xml and oracle-web.xml for web container.
Here are the entries for web Container -
In web.xml put this entry -
<resource-ref>
<res-ref-name>jdbc/Test</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
In oracle-web.xml put this entry -
<resource-ref>
<res-ref-name>jdbc/asta</res-ref-name>
<jndi-name>jdbc/asta</jndi-name>
</resource-ref>
Here is how you will get the connection -
Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/Test");
Connection conn = ds.getConnection();
Thanks -
Crystal Report JRC and JNDI problem
I need to convert one of our internal web application from using Crystal Report Server 10 RAS to using Crystal Report XI Java Component (JRC). I found several examples from SAP/BusinessObjects but am stuck with a database connectivity problem.
The basic enviornment info:
JBoss 4.0.3 SP1
Crystal Report JRC XI
Windows XP/Server 2003
JDK 1.5.x
MS SQL Server 2005
The error I am getting is "Error finding JNDI name (xxx)", although the application is already using the same JNDI and was able to display data on the web.
I added debug code:
Context initialContext = null;
try {
initialContext = new InitialContext();
DataSource ds = (DataSource) initialContext.lookup("java:MYAPP");
String t = ds.toString();
log.debug(t);
} catch (NamingException e) {
log.error(e);
I was able to get the data source successfully. The actual report file uses JDBC with JNDI named as "MYAPP". When I call the viewer, it gives
Error finding JNDI name (MYAPP)
message.
Any comment or help would be appreciated.
Thanks.How are you setting your connection info?
This is what we do:
IConnectionInfo connectionInfo = new ConnectionInfo();
PropertyBag propertyBag = new PropertyBag();
propertyBag.put("JNDI Datasource Name", reportJndiName);
propertyBag.put("Database DLL", DATABASE_DLL); // required!!! (but we don't actually provide a DLL, or even run in windows)
connectionInfo.setAttributes(propertyBag);
connectionInfo.setKind(ConnectionInfoKind.SQL);
ConnectionInfos connectionInfos = databaseController.getConnectionInfos(null);
IConnectionInfo oldConnectionInfo = connectionInfos.getConnectionInfo(0);
databaseController.replaceConnection(oldConnectionInfo, connectionInfo, null, DBOptions._useDefault ); -
JDBC and FTP sender channels stop polling
Hi,
We have a great volume of sender JDBC and FTP sender channels.
For this reason there is nothing unusual to have temporary error connections.
Several months ago, with an XI 3.0 system, sender channels recover its functionality automatically when temporary error connection is solved.
But now, he have migrate to a PI 7.1 sytem, and in the same scenario and configuration, sender channel stop polling after a temporary error . In cc monitor this channels remains in green status and there were no signs of stopped interfaces.
Timeouts are correctly defined and there is no difference between channel configuration in our Xi and PI system.
How to solve this problem?
Thanks, in advance.
Carme.Thanks for your fast response, Stefan.
After writing this post, i ask the same question to our basis team and we are in the latest sp.
¿do you know if there is any note or can you provide me some additional information?
I'm not able to find any note about this issue...
Regards,
Carme. -
Error with data source and jndi
Dave,
I am using weblogic 6.1 now and I am still getting the same problem.
Error:
The DataSource name with the JNDI name: Organization can not be located. Please
ensure that the DataSource has been deployed successfully and that the JNDI name
in your EJB Deployment descriptor is correct.
The Entity Bean files that I have used for JBoss are:
* GangsterBean.java
* Copyright (c) 2002 Sempire, Inc.
* All rights reserved.
* This software is the confidential and proprietary information
* of Sempire, Inc
* @ version 1.0
package com.sempire.builder.business_component;
import java.util.Collection;
import java.util.Set;
import javax.ejb.CreateException;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.FinderException;
public abstract class GangsterBean implements EntityBean
private static int idgen = 1;
private EntityContext context;
public Integer ejbCreate( String Name, String Nickname, Integer Badness) throws
CreateException
setID(new Integer(idgen++));
setName(Name);
setNickname(Nickname);
setBadness(Badness);
return null;
public void ejbPostCreate( String Name, String Nickname, Integer Badness)
throws CreateException
// CMP Field Accessors -----------------------------------------------------
public abstract Integer getID();
public abstract void setID(Integer ID);
public abstract String getName();
public abstract void setName(String Name);
public abstract String getNickname();
public abstract void setNickname(String Nickname);
public abstract Integer getBadness();
public abstract void setBadness(Integer Badness);
// CMR Field Accessors -----------------------------------------------------
public abstract Collection getJobs();
public abstract void setJobs(Collection Jobs);
public abstract Organization getOrganization();
public abstract void setOrganization(Organization Organization);
// EJB callbacks -----------------------------------------------------------
public void setEntityContext(EntityContext ctx)
context = ctx;
public void unsetEntityContext()
context = null;
public void ejbRemove() {}
public void ejbLoad() {}
public void ejbStore() {}
public void ejbPassivate() {}
public void ejbActivate() {}
What are the changes to be made in this file so that the files work in weblogic
too?
Also, my ejb-jar.xml file has been changed to:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<display-name>Business Component CMP 2.0</display-name>
<enterprise-beans>
<entity>
<display-name>Gangster Entity Bean</display-name>
<ejb-name>GangsterEJB</ejb-name>
<local-home>com.sempire.builder.business_component.GangsterHome</local-home>
<local>com.sempire.builder.business_component.Gangster</local>
<ejb-class>com.sempire.builder.business_component.GangsterBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>GangsterEJB</abstract-schema-name>
<cmp-field><field-name>iD</field-name></cmp-field>
<cmp-field><field-name>name</field-name></cmp-field>
<cmp-field><field-name>nickname</field-name></cmp-field>
<cmp-field><field-name>badness</field-name></cmp-field>
<primkey-field>iD</primkey-field>
<resource-ref>
<res-ref-name>jdbc/GangsterDataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params></method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM GangsterEJB AS a]]>
</ejb-ql>
</query>
</entity>
<entity>
<display-name>Organization Entity Bean</display-name>
<ejb-name>OrganizationEJB</ejb-name>
<local-home>com.sempire.builder.business_component.OrganizationHome</local-home>
<local>com.sempire.builder.business_component.Organization</local>
<ejb-class>com.sempire.builder.business_component.OrganizationBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>OrganizationEJB</abstract-schema-name>
<cmp-field><field-name>iD</field-name></cmp-field>
<cmp-field><field-name>name</field-name></cmp-field>
<cmp-field><field-name>description</field-name></cmp-field>
<primkey-field>iD</primkey-field>
<resource-ref>
<res-ref-name>jdbc/OrganizationDataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params></method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM OrganizationEJB AS a]]>
</ejb-ql>
</query>
</entity>
<entity>
<display-name>Job Entity Bean</display-name>
<ejb-name>JobEJB</ejb-name>
<local-home>com.sempire.builder.business_component.JobHome</local-home>
<local>com.sempire.builder.business_component.Job</local>
<ejb-class>com.sempire.builder.business_component.JobBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>JobEJB</abstract-schema-name>
<cmp-field><field-name>iD</field-name></cmp-field>
<cmp-field><field-name>name</field-name></cmp-field>
<cmp-field><field-name>score</field-name></cmp-field>
<cmp-field><field-name>setupCost</field-name></cmp-field>
<primkey-field>iD</primkey-field>
<resource-ref>
<res-ref-name>jdbc/JobDataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params></method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM JobEJB AS a]]>
</ejb-ql>
</query>
</entity>
</enterprise-beans>
<relationships>
<ejb-relation>
<ejb-relation-name>organization-memberGangsters</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>organization---memberGangsters</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>OrganizationEJB</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>memberGangsters</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>memberGangsters---organization</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<cascade-delete/>
<relationship-role-source>
<ejb-name>GangsterEJB</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>organization</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
</ejb-relation>
<ejb-relation>
<ejb-relation-name>gangsters-jobs</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>gangsters---jobs</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>GangsterEJB</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>jobs</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>jobs---gangsters</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>JobEJB</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>gangsters</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
</ejb-relation>
<ejb-relation>
<ejb-relation-name>organization-theBoss</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>organization---theBoss</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>OrganizationEJB</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>theBoss</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>theBoss---organization</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>GangsterEJB</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
</relationships>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>GangsterEJB</ejb-name>
<method-name>*</method-name>
</method>
<method>
<ejb-name>OrganizationEJB</ejb-name>
<method-name>*</method-name>
</method>
<method>
<ejb-name>JobEJB</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
My weblogic-ejb-jar.xml file has been changed to:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN'
'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>GangsterEJB</ejb-name>
<entity-descriptor>
<persistence>
<persistence-type>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-type>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
</persistence-use>
</persistence>
</entity-descriptor>
<reference-descriptor>
<resource-description>
<res-ref-name>jdbc/GangsterDataSource</res-ref-name>
<jndi-name>jdbc.GangsterDB</jndi-name>
</resource-description>
</reference-descriptor>
<local-jndi-name>Gangster</local-jndi-name>
</weblogic-enterprise-bean>
<weblogic-enterprise-bean>
<ejb-name>OrganizationEJB</ejb-name>
<entity-descriptor>
<persistence>
<persistence-type>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-type>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
</persistence-use>
</persistence>
</entity-descriptor>
<reference-descriptor>
<resource-description>
<res-ref-name>jdbc/OrganizationDataSource</res-ref-name>
<jndi-name>jdbc.Organization</jndi-name>
</resource-description>
</reference-descriptor>
<local-jndi-name>Organization</local-jndi-name>
</weblogic-enterprise-bean>
<weblogic-enterprise-bean>
<ejb-name>JobEJB</ejb-name>
<entity-descriptor>
<persistence>
<persistence-type>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-type>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
</persistence-use>
</persistence>
</entity-descriptor>
<reference-descriptor>
<resource-description>
<res-ref-name>jdbc/JobDataSource</res-ref-name>
<jndi-name>jdbcJob</jndi-name>
</resource-description>
</reference-descriptor>
<local-jndi-name>Job</local-jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
Please do let me know all the changes I need to make so that my application can
deploy in weblogic.
Thank You
RonakDave,
I am using weblogic 6.1 now and I am still getting the same problem.
Error:
The DataSource name with the JNDI name: Organization can not be located. Please
ensure that the DataSource has been deployed successfully and that the JNDI name
in your EJB Deployment descriptor is correct.
The Entity Bean files that I have used for JBoss are:
* GangsterBean.java
* Copyright (c) 2002 Sempire, Inc.
* All rights reserved.
* This software is the confidential and proprietary information
* of Sempire, Inc
* @ version 1.0
package com.sempire.builder.business_component;
import java.util.Collection;
import java.util.Set;
import javax.ejb.CreateException;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.FinderException;
public abstract class GangsterBean implements EntityBean
private static int idgen = 1;
private EntityContext context;
public Integer ejbCreate( String Name, String Nickname, Integer Badness) throws
CreateException
setID(new Integer(idgen++));
setName(Name);
setNickname(Nickname);
setBadness(Badness);
return null;
public void ejbPostCreate( String Name, String Nickname, Integer Badness)
throws CreateException
// CMP Field Accessors -----------------------------------------------------
public abstract Integer getID();
public abstract void setID(Integer ID);
public abstract String getName();
public abstract void setName(String Name);
public abstract String getNickname();
public abstract void setNickname(String Nickname);
public abstract Integer getBadness();
public abstract void setBadness(Integer Badness);
// CMR Field Accessors -----------------------------------------------------
public abstract Collection getJobs();
public abstract void setJobs(Collection Jobs);
public abstract Organization getOrganization();
public abstract void setOrganization(Organization Organization);
// EJB callbacks -----------------------------------------------------------
public void setEntityContext(EntityContext ctx)
context = ctx;
public void unsetEntityContext()
context = null;
public void ejbRemove() {}
public void ejbLoad() {}
public void ejbStore() {}
public void ejbPassivate() {}
public void ejbActivate() {}
What are the changes to be made in this file so that the files work in weblogic
too?
Also, my ejb-jar.xml file has been changed to:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<display-name>Business Component CMP 2.0</display-name>
<enterprise-beans>
<entity>
<display-name>Gangster Entity Bean</display-name>
<ejb-name>GangsterEJB</ejb-name>
<local-home>com.sempire.builder.business_component.GangsterHome</local-home>
<local>com.sempire.builder.business_component.Gangster</local>
<ejb-class>com.sempire.builder.business_component.GangsterBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>GangsterEJB</abstract-schema-name>
<cmp-field><field-name>iD</field-name></cmp-field>
<cmp-field><field-name>name</field-name></cmp-field>
<cmp-field><field-name>nickname</field-name></cmp-field>
<cmp-field><field-name>badness</field-name></cmp-field>
<primkey-field>iD</primkey-field>
<resource-ref>
<res-ref-name>jdbc/GangsterDataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params></method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM GangsterEJB AS a]]>
</ejb-ql>
</query>
</entity>
<entity>
<display-name>Organization Entity Bean</display-name>
<ejb-name>OrganizationEJB</ejb-name>
<local-home>com.sempire.builder.business_component.OrganizationHome</local-home>
<local>com.sempire.builder.business_component.Organization</local>
<ejb-class>com.sempire.builder.business_component.OrganizationBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>OrganizationEJB</abstract-schema-name>
<cmp-field><field-name>iD</field-name></cmp-field>
<cmp-field><field-name>name</field-name></cmp-field>
<cmp-field><field-name>description</field-name></cmp-field>
<primkey-field>iD</primkey-field>
<resource-ref>
<res-ref-name>jdbc/OrganizationDataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params></method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM OrganizationEJB AS a]]>
</ejb-ql>
</query>
</entity>
<entity>
<display-name>Job Entity Bean</display-name>
<ejb-name>JobEJB</ejb-name>
<local-home>com.sempire.builder.business_component.JobHome</local-home>
<local>com.sempire.builder.business_component.Job</local>
<ejb-class>com.sempire.builder.business_component.JobBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>JobEJB</abstract-schema-name>
<cmp-field><field-name>iD</field-name></cmp-field>
<cmp-field><field-name>name</field-name></cmp-field>
<cmp-field><field-name>score</field-name></cmp-field>
<cmp-field><field-name>setupCost</field-name></cmp-field>
<primkey-field>iD</primkey-field>
<resource-ref>
<res-ref-name>jdbc/JobDataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params></method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM JobEJB AS a]]>
</ejb-ql>
</query>
</entity>
</enterprise-beans>
<relationships>
<ejb-relation>
<ejb-relation-name>organization-memberGangsters</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>organization---memberGangsters</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>OrganizationEJB</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>memberGangsters</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>memberGangsters---organization</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<cascade-delete/>
<relationship-role-source>
<ejb-name>GangsterEJB</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>organization</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
</ejb-relation>
<ejb-relation>
<ejb-relation-name>gangsters-jobs</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>gangsters---jobs</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>GangsterEJB</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>jobs</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>jobs---gangsters</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>JobEJB</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>gangsters</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
</ejb-relation>
<ejb-relation>
<ejb-relation-name>organization-theBoss</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>organization---theBoss</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>OrganizationEJB</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>theBoss</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>theBoss---organization</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>GangsterEJB</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
</relationships>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>GangsterEJB</ejb-name>
<method-name>*</method-name>
</method>
<method>
<ejb-name>OrganizationEJB</ejb-name>
<method-name>*</method-name>
</method>
<method>
<ejb-name>JobEJB</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
My weblogic-ejb-jar.xml file has been changed to:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN'
'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>GangsterEJB</ejb-name>
<entity-descriptor>
<persistence>
<persistence-type>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-type>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
</persistence-use>
</persistence>
</entity-descriptor>
<reference-descriptor>
<resource-description>
<res-ref-name>jdbc/GangsterDataSource</res-ref-name>
<jndi-name>jdbc.GangsterDB</jndi-name>
</resource-description>
</reference-descriptor>
<local-jndi-name>Gangster</local-jndi-name>
</weblogic-enterprise-bean>
<weblogic-enterprise-bean>
<ejb-name>OrganizationEJB</ejb-name>
<entity-descriptor>
<persistence>
<persistence-type>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-type>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
</persistence-use>
</persistence>
</entity-descriptor>
<reference-descriptor>
<resource-description>
<res-ref-name>jdbc/OrganizationDataSource</res-ref-name>
<jndi-name>jdbc.Organization</jndi-name>
</resource-description>
</reference-descriptor>
<local-jndi-name>Organization</local-jndi-name>
</weblogic-enterprise-bean>
<weblogic-enterprise-bean>
<ejb-name>JobEJB</ejb-name>
<entity-descriptor>
<persistence>
<persistence-type>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-type>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
</persistence-use>
</persistence>
</entity-descriptor>
<reference-descriptor>
<resource-description>
<res-ref-name>jdbc/JobDataSource</res-ref-name>
<jndi-name>jdbcJob</jndi-name>
</resource-description>
</reference-descriptor>
<local-jndi-name>Job</local-jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
Please do let me know all the changes I need to make so that my application can
deploy in weblogic.
Thank You
Ronak -
Adapter Limitations Of Sender JDBC and Mail Adapter
hi All,
could you tell me the limitations of JDBC and Mail Adapter .i need to document these details .
Regards
Vidya SagarHI Vidya,
If i was you, i would do a list of things that i would need about these adapters, o i would search the SAP.help documentation for a first view and later ask about this possibility. Another way is to read the SCN doubts about these adapters and you can find some problems. You should think about the PI version as well.
Regards.
Maybe you are looking for
-
Using URL Parameters in a PDF Form
I built a form in LiveCycle Designer ES and I would like a couple of fields auto populated. The only way I could see doing this without having to purchase the LiveCycle Forms Server or another solution, is to embed the information in the URL. I found
-
How do I view and manage certain files that I have stored in iCloud? I know that I can delete an entire backup, but is it possible to delete certain photos/contacts/notes etc. from that backup?
-
Compound path text & shape mode problem
Hi there, I'm working with some text that I've outlined and converted to a compound path. Then I'm applying a subtractive shape mode onto, but I'm noticing that it's actually changing the weight of the type. Can someone tell me why this is happening
-
550 Requested action not taken : mailbox unavailable
would you like to help me to solve my problem? i receive bounce back email like this : From: Mail Delivery System [mailto:[email protected]] Sent: Monday, November 03, 2014 2:57 PM To: [email protected] Subject: Mail delivery failed: returning messag
-
Every 60 seconds a blip like static comes in my BOSE earphones only when connected to DELL laptop Windows 7. Started about 6 weeks ago.