Re: [JBoss-user] Need Help Connection Pools (can't see zip files)

2001-04-11 Thread Daren R. Sefcik

OK..I see what you mean, I was using some code generated from
Sun's deployment tool as a reference...my mistake.

Here is what ended up being all I needed:

jboss
enterprise-beans
 securefalse/secure
 entity
   ejb-nameLoginServletBean/ejb-name
   jndi-nameMyLoginServlet/jndi-name
 /entity
/enterprise-beans
resource-managers
resource-manager res-class="org.jboss.ejb.deployment.JDBCResource"
   res-namejdbc/JBossDB/res-name
   res-jndi-nameMSQLDB/res-jndi-name
/resource-manager
/resource-managers
/jboss

Thanks to everyone who helped me with this!

Daren


On Tue, 10 Apr 2001, Scott M Stark wrote:

 Because that is the format of the jboss.xml file according to the jboss.dtd.
 Where are you seeing that ejb is a valid child of the enterprise-beans element
 for a jboss.xml descriptor?

 - Original Message -
 From: "Daren R. Sefcik" [EMAIL PROTECTED]
 To: "Scott M Stark" [EMAIL PROTECTED]
 Sent: Tuesday, April 10, 2001 12:49 PM
 Subject: Re: [JBoss-user] Need Help Connection Pools (can't see zip files)


  On Tue, 10 Apr 2001, Scott M Stark wrote:
 
   The problem is that you need to use this:
   enterprise-beans
   session
   ejb-nameLoginServletBean/ejb-name
   resource-ref
   resource-nameMSQLJDBC/resource-name
   res-ref-namejdbc/MSQLDB/res-ref-name
   /resource-ref
   /session
   /enterprise-beans
  
   rather than:
  
   enterprise-beans
   ejb
   ejb-nameLoginServletBean/ejb-name
   resource-ref
   resource-nameMSQLJDBC/resource-name
   res-ref-namejdbc/MSQLDB/res-ref-name
   /resource-ref
   /ejb
   /enterprise-beans
  
   I'm not sure why the jboss.xml below works but it has to be the
   resource-managers element alone that is doing something. I'll have to
   look into what it is doing.
 
  Why do I need session rather then ejb..??
  The Bean itself is an Entity and the ejb is derived from the application.xml
  file.


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Need Help Connection Pools (can't see zip files)

2001-04-09 Thread Daren R. Sefcik

On Sat, 7 Apr 2001, Toby Allsopp wrote:

 Daren R. Sefcik wrote:

  I just got done battling that whole thing.
  I am using Jetty/JBoss and even though I can see thru
  the Admin/JNDIView page the java:comp env sees my env/MYDB entry
  it still will not work in my apps..I have to use the java:/MYDB
  namespace.
  Prerhaps I still don't have something configured properly,
  but I figured  that if thru the JNDIView page I get:
 
  java:comp namespace of the LoginServletBean bean:
 
+- env (class: org.jnp.interfaces.NamingContext)
|   +- jdbc (class: org.jnp.interfaces.NamingContext)
|   |   +- JBossDB (class: javax.naming.LinkRef)
 
 
  it should work when referenced like "java:comp/env/jdbc/JBossDB" but it doesn't.

 I suspect that this means that you have the configuration half right.
 You need to set up the mapping from jdbc/JBossDB to java:/MYDB in jboss.xml.

 Toby.

humm..I tried but it still does not work...here are my entries, could you
please see if you can spot the problem area..??..thanks.

/**jboss.xml**/
?xml version="1.0" encoding="ISO8859_1"?

jboss
  server-name/server-name
  rolemapping /
  web
display-nameLoginServletWAR/display-name
context-rootservlets/context-root
ejb-ref
  ejb-ref-nameejb/MyLoginServlet/ejb-ref-name
  jndi-nameMyLoginServlet/jndi-name
/ejb-ref
  /web
  enterprise-beans
ejb
  ejb-nameLoginServletBean/ejb-name
  jndi-nameMyLoginServlet/jndi-name
  resource-ref
 res-ref-namejdbc/JBossDB/res-ref-name
 jndi-namejava:/MSQLDB/jndi-name
  /resource-ref
  cmp
 table-create-sql/table-create-sql
 table-remove-sql/table-remove-sql
 create-table-deploytrue/create-table-deploy
 delete-table-undeploytrue/delete-table-undeploy
  /cmp
/ejb
  /enterprise-beans
/jboss


/ejb-jar.xml*/
ejb-jar
  descriptionno description/description
  display-nameLoginServletJar/display-name
  enterprise-beans
entity
  display-nameLoginServletBean/display-name
  ejb-nameLoginServletBean/ejb-name
  homeLoginHome/home
  remoteLogin/remote
  ejb-classLoginEJB/ejb-class
  persistence-typeBean/persistence-type
  prim-key-classjava.lang.Object/prim-key-class
  reentrantFalse/reentrant
  resource-ref
 res-ref-namejdbc/JBossDB/res-ref-name
 res-typejavax.sql.DataSource/res-type
 res-authContainer/res-auth
  /resource-ref
/entity
  /enterprise-beans

 !-- cut the rest from here cuz it didn't seem relevant --
/ejb-jar



___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Need Help Connection Pools (can't see zip files)

2001-04-09 Thread Toby Allsopp

On Mon, Apr 09, 2001 at 11:06:44AM -0700, Daren R. Sefcik wrote:
 On Sat, 7 Apr 2001, Toby Allsopp wrote:
 
  I suspect that this means that you have the configuration half right.
  You need to set up the mapping from jdbc/JBossDB to java:/MYDB in jboss.xml.
 
  Toby.
 
 humm..I tried but it still does not work...here are my entries, could you
 please see if you can spot the problem area..??..thanks.

Your jboss.xml is really screwed up. Have a look at the documentation. There
you can find the DTD for jboss.xml. Looking through the archives of this list
and its predecessor should turn up some examples.

Toby.

 /**jboss.xml**/
 ?xml version="1.0" encoding="ISO8859_1"?
 
 jboss
   server-name/server-name
   rolemapping /
   web
 display-nameLoginServletWAR/display-name
 context-rootservlets/context-root
 ejb-ref
   ejb-ref-nameejb/MyLoginServlet/ejb-ref-name
   jndi-nameMyLoginServlet/jndi-name
 /ejb-ref
   /web
   enterprise-beans
 ejb
   ejb-nameLoginServletBean/ejb-name
   jndi-nameMyLoginServlet/jndi-name
   resource-ref
res-ref-namejdbc/JBossDB/res-ref-name
jndi-namejava:/MSQLDB/jndi-name
   /resource-ref
   cmp
table-create-sql/table-create-sql
table-remove-sql/table-remove-sql
create-table-deploytrue/create-table-deploy
delete-table-undeploytrue/delete-table-undeploy
   /cmp
 /ejb
   /enterprise-beans
 /jboss

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Need Help Connection Pools (can't see zip files)

2001-04-09 Thread Daren R. Sefcik

On Tue, 10 Apr 2001, Toby Allsopp wrote:

 On Mon, Apr 09, 2001 at 11:06:44AM -0700, Daren R. Sefcik wrote:
  On Sat, 7 Apr 2001, Toby Allsopp wrote:
 
   I suspect that this means that you have the configuration half right.
   You need to set up the mapping from jdbc/JBossDB to java:/MYDB in jboss.xml.
  
   Toby.
 
  humm..I tried but it still does not work...here are my entries, could you
  please see if you can spot the problem area..??..thanks.

 Your jboss.xml is really screwed up. Have a look at the documentation. There
 you can find the DTD for jboss.xml. Looking through the archives of this list
 and its predecessor should turn up some examples.

 Toby.

I am still trying to work my way into using JBoss/EJB so forgive me, but could you
please explain to me what is screwed up..I have looked thru the archives
and searched the mailing list and see many different posts that are not the same.
The DTD for jboss.xml may be clear to someone who is experienced, but for a beginner 
(me)
it is not entirely clear.
This configuration works except for the jdbc/JBossDb entry...I can only
access the DB pool using "java:/MSQLDB"  not "java:comp/env/jdbc/JBossDB".

thanks
Daren

jboss.xml


jboss

  web
ejb-ref
 ejb-ref-nameejb/MyLoginServlet/ejb-ref-name
 jndi-nameMyLoginServlet/jndi-name
/ejb-ref
  /web

  enterprise-beans
ejb
  ejb-nameLoginServletBean/ejb-name
  jndi-nameMyLoginServlet/jndi-name
  resource-ref
res-ref-namejdbc/JBossDB/res-ref-name
resource-nameMSQLJDBC/resource-name
  /resource-ref
/ejb
  /enterprise-beans

  resource-managers
resource-manager res-class="org.jboss.ejb.deployment.JDBCResource"
   res-nameMSQLJDBC/res-name
   res-jndi-namejava:/MSQLDB/res-jndi-name
/resource-manager
  /resource-managers

/jboss


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Need Help Connection Pools (can't see zip files)

2001-04-09 Thread Toby Allsopp

On Mon, Apr 09, 2001 at 02:15:08PM -0700, Daren R. Sefcik wrote:
 On Tue, 10 Apr 2001, Toby Allsopp wrote:
 
   humm..I tried but it still does not work...here are my entries, could you
   please see if you can spot the problem area..??..thanks.
 
  Your jboss.xml is really screwed up. Have a look at the documentation. There
  you can find the DTD for jboss.xml. Looking through the archives of this list
  and its predecessor should turn up some examples.
 
  Toby.
 
 I am still trying to work my way into using JBoss/EJB so forgive me, but
 could you please explain to me what is screwed up..I have looked thru the
 archives and searched the mailing list and see many different posts that
 are not the same.
 The DTD for jboss.xml may be clear to someone who is experienced, but for
 a beginner (me) it is not entirely clear.

I strongly suggest that you learn how to read XML DTDs. All of the
configuration for J2EE uses XML, and being able to understand the DTDs
will make your life much easier.

 This configuration works except for the jdbc/JBossDb entry...I can only
 access the DB pool using "java:/MSQLDB"  not "java:comp/env/jdbc/JBossDB".

The only problem that jumps out at me is the ejb tag. The DTD calls for
either session or entity at that point.

Note that I have never done this myself - all of my knowledge comes from
looking at the source and reading the mailing lists.

Toby.

 thanks
 Daren
 
 jboss.xml
 
 
 jboss
 
   web
 ejb-ref
  ejb-ref-nameejb/MyLoginServlet/ejb-ref-name
  jndi-nameMyLoginServlet/jndi-name
 /ejb-ref
   /web
 
   enterprise-beans
 ejb
   ejb-nameLoginServletBean/ejb-name
   jndi-nameMyLoginServlet/jndi-name
   resource-ref
 res-ref-namejdbc/JBossDB/res-ref-name
 resource-nameMSQLJDBC/resource-name
   /resource-ref
 /ejb
   /enterprise-beans
 
   resource-managers
 resource-manager res-class="org.jboss.ejb.deployment.JDBCResource"
res-nameMSQLJDBC/res-name
res-jndi-namejava:/MSQLDB/res-jndi-name
 /resource-manager
   /resource-managers
 
 /jboss

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Need Help Connection Pools (can't see zip files)

2001-04-09 Thread Scott M Stark

This jboss.xml is not consistent with the one you previously showed so which
jboss.xml are you using? The one in this msg looks ok to me. In the previous
msg you did not have a resource-managers../resource-managers section
to map from the java:comp/env/jdbc/JBossDB value to java:/MSQLDB

 
 I am still trying to work my way into using JBoss/EJB so forgive me, but could you
 please explain to me what is screwed up..I have looked thru the archives
 and searched the mailing list and see many different posts that are not the same.
 The DTD for jboss.xml may be clear to someone who is experienced, but for a beginner 
(me)
 it is not entirely clear.
 This configuration works except for the jdbc/JBossDb entry...I can only
 access the DB pool using "java:/MSQLDB"  not "java:comp/env/jdbc/JBossDB".
 
 thanks
 Daren
 
 jboss.xml
 
 
 jboss
 
   web
 ejb-ref
  ejb-ref-nameejb/MyLoginServlet/ejb-ref-name
  jndi-nameMyLoginServlet/jndi-name
 /ejb-ref
   /web
 
   enterprise-beans
 ejb
   ejb-nameLoginServletBean/ejb-name
   jndi-nameMyLoginServlet/jndi-name
   resource-ref
 res-ref-namejdbc/JBossDB/res-ref-name
 resource-nameMSQLJDBC/resource-name
   /resource-ref
 /ejb
   /enterprise-beans
 
   resource-managers
 resource-manager res-class="org.jboss.ejb.deployment.JDBCResource"
res-nameMSQLJDBC/res-name
res-jndi-namejava:/MSQLDB/res-jndi-name
 /resource-manager
   /resource-managers
 
 /jboss
 
 
 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]
 http://lists.sourceforge.net/lists/listinfo/jboss-user
 


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Need Help Connection Pools (can't see zip files)

2001-04-09 Thread Daren R. Sefcik

On Tue, 10 Apr 2001, Toby Allsopp wrote:

 I strongly suggest that you learn how to read XML DTDs. All of the
 configuration for J2EE uses XML, and being able to understand the DTDs
 will make your life much easier.

Sort of my point..I am trying to learn, and from what I have it seems to me it
should work, but it does not.



  This configuration works except for the jdbc/JBossDb entry...I can only
  access the DB pool using "java:/MSQLDB"  not "java:comp/env/jdbc/JBossDB".

 The only problem that jumps out at me is the ejb tag. The DTD calls for
 either session or entity at that point.

This comes from my application.xml file which is:

application
  display-nameLoginServletApp/display-name
  descriptionApplication description/description
  module
web
  web-uriloginWAR.war/web-uri
  context-rootservlets/context-root
/web
  /module
  module
ejbloginJAR.jar/ejb
  /module
/application

Any further ideas would be great.

thanks,
Daren



 Note that I have never done this myself - all of my knowledge comes from
 looking at the source and reading the mailing lists.

 Toby.

  thanks
  Daren
 
  jboss.xml
  
 
  jboss
 
web
  ejb-ref
   ejb-ref-nameejb/MyLoginServlet/ejb-ref-name
   jndi-nameMyLoginServlet/jndi-name
  /ejb-ref
/web
 
enterprise-beans
  ejb
ejb-nameLoginServletBean/ejb-name
jndi-nameMyLoginServlet/jndi-name
resource-ref
  res-ref-namejdbc/JBossDB/res-ref-name
  resource-nameMSQLJDBC/resource-name
/resource-ref
  /ejb
/enterprise-beans
 
resource-managers
  resource-manager res-class="org.jboss.ejb.deployment.JDBCResource"
 res-nameMSQLJDBC/res-name
 res-jndi-namejava:/MSQLDB/res-jndi-name
  /resource-manager
/resource-managers
 
  /jboss

 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]
 http://lists.sourceforge.net/lists/listinfo/jboss-user


===
Daren Sefcik
Senior Engineer
Partners Data Systems Inc.
3954 Murphy Canyon Rd. St. D104
San Diego CA 92123
858-278-3005 ext-317
www.partnersdata.com
===


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] Need Help Connection Pools (can't see zip files)

2001-04-06 Thread Creighton Kirkendall



I want to thank you 
Vinoth.C for your quick response. However because I get these 
messages in a batch file I can't read zips.I can read them if you 
cut an passed one of the bean implementation into a 
message.

Creighton 
Kirkendall


RE: [JBoss-user] Need Help Connection Pools (can't see zip files)

2001-04-06 Thread Chidambara, Vinoth (CTS)


import javax.ejb.*;
import java.sql.*;
import javax.sql.*;
import java.awt.event.*;
import javax.naming.*;
import java.awt.*;
import java.util.*;
import java.rmi.*;

public class DatabaseBean implements SessionBean{

SessionContext ctx;

public void ejbCreate(){
}
public void ejbRemove(){

}
public void setSessionContext(SessionContext ctx)
{
this.ctx = ctx;
}
public void ejbActivate()
{
}
public void ejbPassivate()
{
}

public int connectDatabase(){

Connection con=null;
int i=0;
Context ctx =   null;

try {
ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:/TryDB");
con = ds.getConnection();
Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select * from model");
while(rs.next()){
i++;
}
}catch(Exception ne) {
System.out.println("naming exception "+ne);
} finally {
if(con != null)
try {con.close();} catch(SQLException e) {}
}
return i;
}

}

With Regards,
Vinoth.C

 -Original Message-
 From: Creighton Kirkendall [SMTP:[EMAIL PROTECTED]]
 Sent: Friday, April 06, 2001 6:48 PM
 To:   '[EMAIL PROTECTED]'
 Subject:  [JBoss-user] Need Help Connection Pools (can't see zip
 files)
 
 I want to thank you Vinoth.C for your quick response.  However because I
 get these messages in a batch file I can't read zips.  I can read them if
 you cut an passed one of the bean implementation into a message. 
  
 Creighton Kirkendall

This e-mail and any files transmitted with it are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or 
copying of this email or any action taken in reliance on this e-mail is strictly 
prohibited and may be unlawful.

Visit us at http://www.cognizant.com


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Need Help Connection Pools (can't see zip files)

2001-04-06 Thread Daren R. Sefcik

I just got done battling that whole thing.
I am using Jetty/JBoss and even though I can see thru
the Admin/JNDIView page the java:comp env sees my env/MYDB entry
it still will not work in my apps..I have to use the java:/MYDB
namespace.
Prerhaps I still don't have something configured properly,
but I figured  that if thru the JNDIView page I get:

java:comp namespace of the LoginServletBean bean:

  +- env (class: org.jnp.interfaces.NamingContext)
  |   +- jdbc (class: org.jnp.interfaces.NamingContext)
  |   |   +- JBossDB (class: javax.naming.LinkRef)


it should work when referenced like "java:comp/env/jdbc/JBossDB" but it doesn't.

Daren


On Sat, 7 Apr 2001, Toby Allsopp wrote:

 Chidambara, Vinoth (CTS) wrote:

  DataSource ds = (DataSource)ctx.lookup("java:/TryDB");

 You should be using the "java:comp/env/" namespace. See section 19.4.1.1
 of the spec.

 Toby.


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Need Help Connection Pools (can't see zip files)

2001-04-06 Thread Toby Allsopp

Daren R. Sefcik wrote:

 I just got done battling that whole thing.
 I am using Jetty/JBoss and even though I can see thru
 the Admin/JNDIView page the java:comp env sees my env/MYDB entry
 it still will not work in my apps..I have to use the java:/MYDB
 namespace.
 Prerhaps I still don't have something configured properly,
 but I figured  that if thru the JNDIView page I get:
 
 java:comp namespace of the LoginServletBean bean:
 
   +- env (class: org.jnp.interfaces.NamingContext)
   |   +- jdbc (class: org.jnp.interfaces.NamingContext)
   |   |   +- JBossDB (class: javax.naming.LinkRef)
 
 
 it should work when referenced like "java:comp/env/jdbc/JBossDB" but it doesn't.

I suspect that this means that you have the configuration half right.
You need to set up the mapping from jdbc/JBossDB to java:/MYDB in jboss.xml.

Toby.


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user