Ok, this is correct for datasource objects.
But I have other bean-specific information that I want deployers to let
parameter.
Defining them in a .properties file isn't a good solution (read-write
static fields in EJB should be avoided, so I/O access will be very
important). So, I want to define them in ejb-jar.xml file, as
env-entries.
What is the correct way to :
1.. define these properties, as far as JRun doesn't recognize values
when I deploy,
2.. retrieve these values from my Bean implementation.
I've defined 4 env-entries in my ejb-jar.xml : datasource, catalog,
schema, table. When I deploy, JRun displays this : (I've hilighted
env-entries in red)
ejipt.maxFreeContexts
ejipt.maxContexts
ejipt.storeName
ejipt.minFreeContexts
ejipt.isDataShared
ejb.sessionTimeout
table;schema;catalog;datasource;
ejb.beanHomeName
com.oxiasoft.frmwk.common.auth.data.impl.FwkUserData
ejb.allowedIdentities
all
You can see that properties are retrieved, but not values for these
properties. If I have to type them, which syntax ?
TABLE_NAME;schema;CATALOG;DATASOURCE; or
"TABLE_NAME";"schema";"CATALOG";"DATASOURCE"; ? or anything else ?
I've attached my ejb-jar.xml file.
Thanks a lot
PS : as You can imagine, it is a BMP entity bean... ;-))
----- Original Message -----
From: "Mark Phelps" <[EMAIL PROTECTED]>
To: "JRun-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, October 02, 2001 6:14 PM
Subject: RE: init-properties in ejb
> Here is another code snippet showing how we connect to our data
source.
> Note the "jdbc" in the JNDI name string.
> Also note that we are retrieving a DataSource object not a String.
>
> try
> {
> System.setSecurityManager( new RMISecurityManager() );
> InitialContext ctx = new InitialContext( );> DataSource ds=
> DataSource)ctx.lookup( "java:comp/env/jdbc/BYUDSSData" );
> }
> catch( Exception e )
> {
> System.out.println("Failed to retrieve DataSource!");
> }
>
> "BYUDSSData" is the name of the data source as we defined it in the
JRun
> Management Console.
>
> Once you have retrieved the DataSource object you can use it to
generate
> database connections.
>
> -----Original Message-----
> From: Christophe Marchand [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 02, 2001 10:50 AM
> To: JRun-Talk
> Subject: init-properties in ejb
>
>
> Hi all !
>
> In my ejb-jar.xml, I define this :
> <entity>
> ...
> <env-entry>
> <env-entry-name>datasource</env-entry-name>
> <env-entry-type>java.lang.String</env-entry-type>
> <env-entry-value>FRMWK</env-entry-value>
> </env-entry>
> ...
> </entity>
>
> When I deploy my JAR file, JRun doesn't recognize values for
> env-entries. Well, I can do it manually... next step :
>
> In my bean contrustor, I want to load this env-entries : here is my
code
> Context ctx = new InitialContext();
> datasourceName = (String)ctx.lookup("java:comp/env/datasource");
> This always throws a Naming exception...
> Do I forget something ?
>
> Thanks a lot in advance
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists