Datasource without J2EE/JNDI - just J2SE
I'm writing a small program that work quite well with ResultSet but I would like to add pooling conections and a serialized RowSet, so I would like to replace DriverManager with DataSource.
But every thing in the doc's drive me to JDNI and J2EE and I don't want to.
I'm working with J2SE and my appa should be capable to run in very small machines (Pentium 200 MHz, 32MB, 6 GB).
I don't want to start an JDNI SPI (just like RMI, LDAP or anything else)
So, can be made javax.sql.Datasource to work without using JNDI?
Absolutely.
Like yourself I write non-web/j2ee apps and would like to use the DataSource/ConnectionPoolDataSource interfaces.
All that a JNDI implementation does is to call a object factory (passing DataSource configuration details like driver,url,logid,password...) which instantiates a DataSource instance, configures it and passes it back to you. Now you can do all that in your code.
I use Sybases DataSource and am in the process of developing my own Connection pool using Jakarta Pool and the Sybase Pooling classes.
Heres what I have to do to create a DataSource instance:
DataSource ds = new SybDataSource();
ds.setServerName(machine);
ds.setDatabaseName(database);
ds.setUser(logid);
ds.setPassword(password);
ds.setPortNumber(Integer.parseInt(port));
return ds;
Connection c = ds.getConnection();I typically develop Tomcat apps and so to keep my coding techniques similar, I decided to retain JNDI for non-web apps. This involves writing a JNDI SPI, which is no big deal. The benefit is that I have the same configuration techniques (XML files) the same ServiceLocator pattern to get DataSources by name, and the same code in web or non-web apps.
Dave
Similar Messages
-
The DataSource with the JNDI name: MyDataSource could not be located.
hi,
I created a connection pool myconnectionpool and i create a data source MyDataSource with jndi name as mydsn.
in my weblogic-cmp-rdbms-jar.xml i gave
<data-source-name>MyDataSource</data-source-name> and
When i deploy the bean i am getting following exception.
Unable to deploy EJB: containerManaged from cmp7.jar:
weblogic.ejb20.WLDeploymentException: The DataSource with the JNDI name: MyDataSource could not be located. Please ensure that the DataSource has been deployed successfully and that the JNDI name in your EJB Deployment descriptor is correct.
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.setup(RDBMSPersistenceManager.java:128)
at weblogic.ejb20.manager.BaseEntityManager.setupPM(BaseEntityManager.java:213)
at weblogic.ejb20.manager.BaseEntityManager.setup(BaseEntityManager.java:185)
at weblogic.ejb20.manager.DBManager.setup(DBManager.java:160)
at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.deploy(ClientDrivenBeanInfoImpl.java:928)
at weblogic.ejb20.deployer.EJBDeployer.activate(EJBDeployer.java:1216)
at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:850)
at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:70)
at weblogic.j2ee.Application.addComponent(Application.java:253)
at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:144)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:364)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(DeploymentTarget.java:301)
at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeployments(DeploymentTarget.java:255)
at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(DeploymentTarget.java:206)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:716)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:698)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:380)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at weblogic.management.internal.RemoteMBeanServerImpl.invoke(RemoteMBeanServerImpl.java:902)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:480)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:208)
at $Proxy34.updateDeployments(Unknown Source)
at weblogic.management.configuration.ServerMBean_CachingStub.updateDeployments(ServerMBean_CachingStub.java:3724)
at weblogic.management.deploy.slave.SlaveDeployer.updateServerDeployments(SlaveDeployer.java:1584)
at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.java:337)
at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resume(DeploymentManagerServerLifeCycleImpl.java:233)
at weblogic.t3.srvr.ServerLifeCycleList.resume(ServerLifeCycleList.java:61)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:852)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:273)
at weblogic.Server.main(Server.java:33)
Where i went wrong?
Thanks in advance
phaniHi ,
I have the same problem .when i look into JNDI tree view the jndi name is listed. but it saying error below listed.
my
ejb-name:=containerManaged
datasourcename=EX_DataSource
jndi-name=EX_JNDI
<Feb 14, 2005 3:10:08 PM IST> <Error> <Deployer> <149231> <The slave deployer was unable to set the activatio
true for the application EX_Container
weblogic.management.ApplicationException: activate failed forEX_Container
Module Name: EX_Container, Error: Exception activating module: EJBModule(EX_Container,status=PREPARED)
Unable to deploy EJB: containerManaged from EX_Container.jar:
The DataSource with the JNDI name: EX_DataSource could not be located. Please ensure that the DataSource has
ed successfully and that the JNDI name in your EJB Deployment descriptor is correct.
TargetException:
Unable to deploy EJB: containerManaged from EX_Container.jar:
The DataSource with the JNDI name: EX_DataSource could not be located. Please ensure that the DataSource has
ed successfully and that the JNDI name in your EJB Deployment descriptor is correct.
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:1093)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:1022)
at weblogic.management.deploy.slave.SlaveDeployer.setActivationStateForAllApplications(SlaveDeployer.
at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.java:376)
at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resume(DeploymentManagerServerLife
ava:235)
at weblogic.t3.srvr.ServerLifeCycleList.resume(ServerLifeCycleList.java:65)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:832)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:300)
at weblogic.Server.main(Server.java:32)
my weblogic-ejb-jar.xml
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB//EN'
'http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>containerManaged</ejb-name>
<entity-descriptor>
<persistence>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>7.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-use>
</persistence>
</entity-descriptor>
<jndi-name>EX_JNDI</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
<?xml version="1.0"?>
<!DOCTYPE weblogic-rdbms-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB RDBMS Persistence//EN'
'http://www.bea.com/servers/wls700/dtd/weblogic-rdbms20-persistence-700.dtd'>
weblogic-cmp-rdbms-jar.xml file
<weblogic-rdbms-jar>
<weblogic-rdbms-bean>
<ejb-name>containerManaged</ejb-name>
<data-source-name>EX_DataSource</data-source-name>
<table-map>
<table-name>ejbAccounts</table-name>
<field-map>
<cmp-field>accountId</cmp-field>
<dbms-column>id</dbms-column>
</field-map>
<field-map>
<cmp-field>balance</cmp-field>
<dbms-column>bal</dbms-column>
</field-map>
<field-map>
<cmp-field>accountType</cmp-field>
<dbms-column>type</dbms-column>
</field-map>
</table-map>
</weblogic-rdbms-bean>
<create-default-dbms-tables>DropAndCreateAlways</create-default-dbms-tables>
</weblogic-rdbms-jar>
ejb-jar.xml
<?xml version="1.0"?>
<!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>
<enterprise-beans>
<entity>
<ejb-name>containerManaged</ejb-name>
<home>containerBN.EX.AccountHome</home>
<remote>containerBN.EX.Account</remote>
<ejb-class>containerBN.EX.AccountBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>AccountBean</abstract-schema-name>
<cmp-field>
<field-name>accountId</field-name>
</cmp-field>
<cmp-field>
<field-name>balance</field-name>
</cmp-field>
<cmp-field>
<field-name>accountType</field-name>
</cmp-field>
<primkey-field>accountId</primkey-field>
<query>
<query-method>
<method-name>findBigAccounts</method-name>
<method-params>
<method-param>double</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM AccountBean AS a WHERE a.balance > ?1]]>
</ejb-ql>
</query>
<query>
<query-method>
<method-name>findAccount</method-name>
<method-params>
<method-param>double</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM AccountBean AS a WHERE a.balance = ?1]]>
</ejb-ql>
</query>
<query>
<query-method>
<method-name>findNullAccounts</method-name>
<method-params>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM AccountBean AS a WHERE a.accountType IS NULL]]>
</ejb-ql>
</query>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>containerManaged</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
<ejb-client-jar>EX_Container.jar</ejb-client-jar>
</ejb-jar>
pls lhelp me .
my email id: [email protected]
thanks in advance.
Sudhakar.M -
DataSource without a Pool?
Can I use a DataSource without a pool? I can't use a pool because the
username/password is user-specific, but I'd like the login timeout that the
DataSource provides.
Thanks,
BobCan't use DriverManager. It has synchronization problems and deadlocks under
heavy loads. :( It's a known issue to which the solution is to either use
the Driver directly or a DataSource. Driver does not have setLoginTimeout(),
but DataSource does, so I thought I'd try the DataSource route rather than
rolling my own Connection timeout-managing Thread.
Bob
"Slava Imeshev" <[email protected]> wrote in message
news:[email protected]...
>
============================================================================
=
DriverManager.setLoginTimeout
public static void setLoginTimeout(int seconds)
Sets the maximum time in seconds that a driver will wait while attemptingto
connect to a database.
Parameters:
seconds - the login time limit in seconds
============================================================================
==
There are some problems associated with using driver manager though.
You could search for "DriverManager" in this news group to find
more. http://search.bea.com/weblogic/gonews
Slava
"Bob Lee" <[email protected]> wrote in message
news:[email protected]...
It's not something I have control over. The data is highly sensitive and
user-level security is implemented at the database level. No way aroundit.
The question is, how do I set a login timeout on connecting to thedatabase
so that I can fail over to a backup database in a timely manner?
Thanks,
Bob
"Slava Imeshev" <[email protected]> wrote in message
news:[email protected]...
Hi Bob,
Getting a connection is a pretty expensive operation,
Using connection pool does reduce time necessary to
get a connection. This is what the pools are.
The open question is how to handle different access
right. I'd create a report user that is capable of accessing
data required for all reports. If it's a serverside app, actual
users won't be able to access DB directly anyways.
Slava
"Bob Lee" <[email protected]> wrote in message
news:[email protected]...
My goal is to find a way to reduce the timeout time for making aconnection.
I'm not sure using a dynamic pool would facilitate this.
Bob
"Joseph Weinstein" <[email protected]> wrote in message
news:[email protected]...
Bob Lee wrote:
Transaction control is not required. This is simply a query and
report
application. Can you point me in the right direction to
implement
these
dynamic pools?It's in our docs, under dynamic pool API.
Is it plausible to create/destroy a pool within an HTTP
request context?Well, if you have confidence that the pool will likely be re-used.
it
would
be good to make them when they're needed and not there yet. I
would
try to synchronize the code that tested/made the pool, to avoidtwo
threads trying to make the same-named pool...
Joe
Thanks,
Bob
"Joseph Weinstein" <[email protected]> wrote in message
news:[email protected]...
Have you considered a pool per user, with only one connection?
You can have as many pools as you want, and the dynamic pool
API will allow you to create and destroy pools in a running
server.
Do you require weblogic transactional control?
Joe
Bob Lee wrote:
The data we are accessing has user-level permissions
implemented
in
the
database. :(
I guess I could implement a connection timeout thread that
could
manually
interrupt connections. Do you have a better suggestion?
Thanks,
Bob
"Slava Imeshev" <[email protected]> wrote in message
news:[email protected]...
Hi Bob,
DataSource can not be used without a connection pool.
In fact, DS is just a standard facade for a connection
producing
facility, which is a connection pool in case of weblogic.
BTW, why would you need to have different loginnames/passwords
for a serverside application?
Regards,
Slava Imeshev
"Bob Lee" <[email protected]> wrote in message
news:[email protected]...
Can I use a DataSource without a pool? I can't use a
pool
because
the
username/password is user-specific, but I'd like the
login
timeout
that
the
DataSource provides.
Thanks,
Bob -
Help|| Is there any tool available to register Oracle datasource objects into JNDI
Is there any tool available to register Oracle datasource objects into JNDI.If so please tell me where can I download.
Thanks
shivaI'd like to know the answer to this also.
I just started reading about JNDI 2 days ago and have never used it. I'd like to use DataSource in my application with JNDI. If I can use the database as my JNDI "server", then I'd prefer to do that instead of having a seperate external server. -
I have an iTunes with music and videos. My wife has an iPhone with music and apps. How do I get both on our iPad2?
Without syncing to just one account?
We each have our own laptops.Hmm.
Probably easier for me to put all my stuff on my wife's computer I suppose.
Rebuilding all those iTunes playlists is not very fun though.
And of course anything new that I want on my laptop I will have to duplicate on her laptop in the future.
Not sure how iCloud works just yet.
So you can't have two laptops and manually sync both people's stuff to one iPad? -
J2EE JNDI-00009 EJB Reference "ejb/SessionEJBCalled" could not be resolved
When load (run) the following EJB (JDev 10.1.3.1.0 embedded server) loads with no problem:
package project2;
import javax.ejb.Stateless;
@Stateless
public class SessionEJBCalledBean implements SessionEJBCalledLocal {
public SessionEJBCalledBean() { }
public void display() { System.out.println("In called - Project2"); }
When load the following, only difference is name attribute for the @Stateless annotation:
package project2;
import javax.ejb.Stateless;
@Stateless(name="SessionEJBCalled")
public class SessionEJBCalledBean implements SessionEJBCalledLocal {
public SessionEJBCalledBean() { }
public void display() { System.out.println("In called - Project2"); }
Get the following error message - Why?
2006-08-24 15:48:54.640 WARNING J2EE JNDI-00009 EJB Reference "ejb/SessionEJBCalled" could not be resolved. Allowing J2EEContext creation to continue anyway
Finally - If I specify the name as per the following all is well:
package project2;
import javax.ejb.Stateless;
@Stateless(name="SessionEJBCalledBean")
public class SessionEJBCalledBean implements SessionEJBCalledLocal {
public SessionEJBCalledBean() { }
public void display() { System.out.println("In called - Project2"); }
Would be appreciated if someone could tell me what is going on?
Thanks - KenWhen load (run) the following EJB (JDev 10.1.3.1.0 embedded server) loads with no problem:
package project2;
import javax.ejb.Stateless;
@Stateless
public class SessionEJBCalledBean implements SessionEJBCalledLocal {
public SessionEJBCalledBean() { }
public void display() { System.out.println("In called - Project2"); }
When load the following, only difference is name attribute for the @Stateless annotation:
package project2;
import javax.ejb.Stateless;
@Stateless(name="SessionEJBCalled")
public class SessionEJBCalledBean implements SessionEJBCalledLocal {
public SessionEJBCalledBean() { }
public void display() { System.out.println("In called - Project2"); }
Get the following error message - Why?
2006-08-24 15:48:54.640 WARNING J2EE JNDI-00009 EJB Reference "ejb/SessionEJBCalled" could not be resolved. Allowing J2EEContext creation to continue anyway
Finally - If I specify the name as per the following all is well:
package project2;
import javax.ejb.Stateless;
@Stateless(name="SessionEJBCalledBean")
public class SessionEJBCalledBean implements SessionEJBCalledLocal {
public SessionEJBCalledBean() { }
public void display() { System.out.println("In called - Project2"); }
Would be appreciated if someone could tell me what is going on?
Thanks - Ken -
The DataSource with the JNDI name: contentDataSource could not be located
Hello,
We try to deploy our system/application to the servers that structed as
Machine one has:
1 administration domain
1 managed domain
Machine two has :
1 managed domain which is administrated by machine one.
I was trying to deploy the UI(portal application) to managed domain under Machine one. I got
error message as following:
Exception:weblogic.management.ApplicationException: activate failed for content.jar Module: content.jar Error: Exception activating module: EJBModule(content.jar,status=PREPARED) Unable to deploy EJB: ValueBean from content.jar: [EJB:011028]The DataSource with the JNDI name: contentDataSource could not be located. Please ensure that the DataSource has been deployed successfully and that the JNDI name in your EJB Deployment descriptor is correct.
I have portalFrameworkPool Data Sources deployed to both managed domains.
when I deploy the application to the server that has one one domain(both adminstrator domain and application domain are in one), it is fine.
Can some one with same experience, or BEA people provide some help on this? Very appreciate any help on this issue.
Thanks in advance.
Christina:-p
If you go to each Managed Server on the console, you can see the Service tab and then go to JDBC. Under JDBC you can see all the pool connections. Instead of localhost they should be pointing to the specific hostname or ip address of the adminserver and the pointbase port on that server (9093 by default) so the EAR files can be correctly deployed and then the JNDI Tree will look exactly the same on both servers. Change all the connection pools to use the specific hostname instead of localhost. Hope this works for you. -
How to list the datasources without use a tnsnames.ora file?
Hi,
I want to use the OracleDataSourceEnumerator class of ODP.Net to list the datasources on which the user can connect.
It's work with a tnsnames.ora on the local station, so good.
But I want use the easy connect naming methode so i have edited the sqlnet.ora file with this:
NAMES.DIRECTORY_PATH= (EZCONNECT, TNSNAMES)
then i have deleted the content of the tnsnames.ora
so my code don't work : none datasource is returned by the OracleDataSourceEnumerator
So my question : is it a way to list the datasources without use a tnsnames.ora file?
Edited by: user13499556 on 17 déc. 2010 08:21You can check
DataConnectionFile.EnumerateDependants method
This post is my own opinion and does not necessarily reflect the opinion or view of Slalom. -
an email without an address just disappeared and is not in the draft...... where is it?
Yes, I looked in the camera roll -- they're just not showing up anywhere!
-
Considering only the development tools & APIs from J2SE SDK (taking out the JRE), are those components (java, security, JPDA, etc) also part of the J2EE SDK?
How can I go about using java.util.regex? Can/Would
this regex
support be packaged into some extended javax packages
for JDK 1.3?No, the jre/jdk license prohibit taking its parts alone.
If I use J2SE SDK 1.4 and download all javax packges
that are
in J2EE but not J2SE, and compile my application,
wouldn't it end up with
run-time exceptions...?Hm..dunno.
Take a look at http://jregex.sourceforge.net
BestRegards -
How to run setup for new datasources without breaking old datasources?
Hi,
I am wondering how to install some more data sources (2LIS_05_Q0NOTIF, 2LIS_17_10NOTIF and 2LIS_18_10NOTIF) without breaking the delta mechanism for other data sources when I start to use the new datasources.
I have installed some QM cubes (0QM_C04, -05, -08 and -11) and delta loads run every night. Now I want to add two more cubes (0QM_C02 and -03). The new cubes use datasources that are not yet available.
If I now activate the needed datasources, delete the content of the setup tables again and run 'Application-Specific Setup of Statistical Data' for 'Quality Management', 'Plant Maintenance' and 'Service Management', I am afraid that I will re-initialize the delta queue for the datasources that are already in use... In other words: I am afraid of breaking all datasources in application 05, 17 and 18...
I cannot find documentation addressing this problem. Any input, anyone?
Best regards,
Christian FrierHi all,
if I understand you all correctly, I can use the following plan:
0) Wait until no documents are posted on the R/3 side.
1) Run the delta loads and check that the queues are empty (RSA7 and LBWQ).
2) Delete the setup tables.
3) Run the 'Application-Specific Setup of Statistical Data'
4) Create and execute infopackages for initial dataload (for the new datasources).
5) Create and execute infopackages for delta loads (for the new datasources).
6) Run the infopackages for delta load from the 'old' datasources without running a new initial dataload.
So basically 6) is the step I worry about.
That is that I can start to use 2LIS_05_ITEM, 2LIS_17_ITEM and 2LIS_18_ITEM without breaking the delta sequence for 2LIS_05_TASK, 2LIS_17_TASK and 2LIS_18_TASK.
regards,
Christian -
DataSource is getting created without desired JNDI Name using ANT task
Hi,
While referring to http://weblogic-wonders.com/weblogic/2010/07/24/datasource-creation-using-ant-task-wlconfig/ when we try to create a DataSource using ANT Task <taskdef name=”wlconfig” classname=”weblogic.ant.taskdefs.management.WLConfig”/>
We are unable to provide the Desired JNDI Name for our DataSource. It takes the DataSource Name itself as the JNDI Name of the DataSource. If we specify anyother JNDI Name then it doesnt reflect in the AdminConsole. But still the DataSource testing succeeds from the AmdinConsole.
Is there anything Missing in the Ant Script?
Thanks
Jay SenSharmaI think the attribute name should be JNDINames instead of JNDIName, this is also the name I always use in WLST (and is probably also used by wlconfig), for example,
videotheekDataSource = cmo.createJDBCSystemResource('VideotheekDataSource');
jdbcResource = videotheekDataSource.getJDBCResource();
names = ['jdbc/exampleDS'];
dataSourceParams = jdbcResource.getJDBCDataSourceParams();
dataSourceParams.setJNDINames(names);
Good luck and keep up the good work. -
Summary of problem: Get a javax.naming.NamingNotFoundException when selecting the DataSource (see the configuration below) in server JNDI tree in Admin Console
TheConnection Pool and a corresponding DataSource are configured as follows:
<JDBCDataSource
JNDIName="jdbc.PNStoreDB"
Name="PNStoreDB"
PoolName="PNStorePool"
Targets="serverA"
/>
<JDBCConnectionPool
CapacityIncrement="2"
DriverName="weblogic.jdbc.oci.Driver"
InitialCapacity="2"
LoginDelaySeconds="1"
MaxCapacity="10"
Name="PNStorePool"
Properties="user=rms;password=rms;server=ora81"
RefreshMinutes="10"
Targets="serverA"
TestTableName="dual"
URL="jdbc:weblogic:oracle"
/>
Can't figure out why this is happening. The following is output to the Admin Server command prompt:
<May 18, 2001 10:20:02 AM EDT> <Error> <HTTP> <[WebAppServletContext(6233000,console)] exception raised on '/console/panel
javax.naming.NameNotFoundException: Unable to resolve jdbc. Resolved: '' Unresolved:'jdbc' ; remaining name ''
<<no stack trace available>>
I tried using a different JNDI name for the DataSource (e.g. just PNStoreDB) with no success.
The weird thing is that it messes up other resources bound in the JNDI tree. For e.g. I have some EJB's bound under ejb/XXXX that I can click on and view in the Admin Console (JNDI tree) before I add the pool and DataSource. After I add them though, I see the same NameNotFoundException for these as well.
Thanks in advance for your help.
[att1.html]Are you sure that the connection pool and datasource deployed
successfully? (Check the logs for an error.)
Also, I suspect that you want a TxDataSource instead of a
JDBCDataSource.
-- Rob
Weblogic NewsGroups wrote:
Summary of problem: Get a javax.naming.NamingNotFoundException when
selecting the DataSource (see the configuration below) in server JNDI
tree in Admin Console
TheConnection Pool and a corresponding DataSource are configured as
follows:
<JDBCDataSource
JNDIName="jdbc.PNStoreDB"
Name="PNStoreDB"
PoolName="PNStorePool"
Targets="serverA"
/>
<JDBCConnectionPool
CapacityIncrement="2"
DriverName="weblogic.jdbc.oci.Driver"
InitialCapacity="2"
LoginDelaySeconds="1"
MaxCapacity="10"
Name="PNStorePool"
Properties="user=rms;password=rms;server=ora81"
RefreshMinutes="10"
Targets="serverA"
TestTableName="dual"
URL="jdbc:weblogic:oracle"
/>
Can't figure out why this is happening. The following is output to
the Admin Server command prompt:
<May 18, 2001 10:20:02 AM EDT> <Error> <HTTP>
<[WebAppServletContext(6233000,console)] exception raised on
'/console/panel
javax.naming.NameNotFoundException: Unable to resolve jdbc. Resolved:
'' Unresolved:'jdbc' ; remaining name ''
<<no stack trace available>>
I tried using a different JNDI name for the DataSource (e.g. just
PNStoreDB) with no success.
The weird thing is that it messes up other resources bound in the JNDI
tree. For e.g. I have some EJB's bound under ejb/XXXX that I can
click on and view in the Admin Console (JNDI tree) before I add the
pool and DataSource. After I add them though, I see the same
NameNotFoundException for these as well.
Thanks in advance for your help.--
Coming Soon: Building J2EE Applications & BEA WebLogic Server
by Michael Girdley, Rob Woollen, and Sandra Emerson
http://learnweblogic.com -
Added DataSource not in JNDI tree; WLS6.1SP1
I have added a new DataSource, but I don't see it in the JNDI tree? I have restarted the server after adding. (BTW if I check the examples server, not every name is in the JNDI tree either?! eg. examples-dataSource-demoPool is not in the tree; but examples-dataSource-demoXAPool is in the tree)
If possible please also reply to my email address... [email protected]Thanks for your suggestion. I did this after adding the pool. I should have mentioned
this in my first post.
I have tried again to add a ConnectionPool and a DataSource: to my supprise it
was in the JNDI tree. So everything seemed OK now, but read on...
Because I couldn't access other PC's in my network (Weblogic is installed on my
laptop, which I used during the day without network connection) I rebooted my
laptop and the JNDI name was gone??? Must be something with IP addresses or so.
I will investigate and reply when I have figured it out.
Deepak Vohra <[email protected]> wrote:
Ben
Set the Targets Server.
Click on JDBC node. Click on Data Sources Node. Click on the DataSource
node. click on Targets tab. Choose a Targets Server. click Apply. The
added DataSource should get a JNDI binding.
Deepak
Ben Verloop wrote:
I have added a new DataSource, but I don't see it in the JNDI tree?I have restarted the server after adding. (BTW if I check the examples
server, not every name is in the JNDI tree either?! eg. examples-dataSource-demoPool
is not in the tree; but examples-dataSource-demoXAPool is in the tree)
If possible please also reply to my email address... [email protected] -
Hello everyone,
actually I'm facing little difficulties on how to get an external function getting called from within CVI (Version 2009).
I was supplied with a .H file and a .LIB file to call an external function from within my CVI project. The .H file looks like this:
void exportedFunction(double *parameter);
As far as I know, the external function was written with MS Visual C++ 6.
So I tried to statically link to the extern al function like this:
- Add the .H file and the .LIB file to the CVI project
- #include the .H file where I needed to call the external function
- do the external function call
When building I get an unresolved external function call error from CVI so this seems not to be working.
I made some searches around and got up with two possible issues. Maybe one of you can help me get a bit further and get things working.
1) The "real" function code is located in the DLL file which was not delivered to me. Or is there a way to get things done (call external functions) just with a .H and a .LIB file (without any .DLL file included)?
2) The external function does not export according to "C-Style" rules. The function signature in the .H file shows no things like
extern "C" __declspec(dllexport) void __stdcall ...
Or maybe it's a combination of both issues (missing .DLL + wrong export style of function)?
I guess I could get around the wrong export style of the function when I manage to write a wrapper around the original function that actually uses C-Style exporting. But I guess I need the .DLL file for this try as well.
Thank you for your answers.
Best regards,
Bernd
Solved!
Go to Solution.There is no need for the dllexport stuff. There is also the option for a static library without any DLL. But the 'extern "C"' is essential, because it forces the C++ compiler, which was probably used to compile the library , to use C calling convention.
If you can't ask the provider of the library to provide a version which was compiled using C calling convention the way to go is to write a wrapper with VC++6 around that library which reexports the functions using C calling convertion. Something like
extern "C" type0 myfunc1(type1 arg1, ...) {
return func1( arg1,...);
for every function , you need to use.
BTW. "unresolved symbol" is the linker error message, you can expect if you try to link C code against a library build with C++ calling convention.
Maybe you are looking for
-
Restriction of Developers in BW7.0
Hello, We are working on the restriction of Developers in BW7.0 Can anybody tell me which trx and authorization infoObjects are critical or where i can find a list . for example BW developers use RSA1 and with authorization Object S_RS_ADMWB it is p
-
From where to start android programming ?
the question pretty much explains it. i have almost completed java programming. i have completed half of java essential classes from oracle java tutorials but what i mean is which ide should i download and from where should i learn it. for java progr
-
Mbox Micro or Mbox Mini w/ Logic
Anyone here had any experience w/ an Mbox Micro (or Mbox Mini) and Logic ? Are they in any way compatible ??? Our band has been doing some recordings in Pro Tools LE 8, and I want to be able to work on the mixes on my downtime. However for work and m
-
How simple is the Bluray authoring in Final Cut Studio?
Hello! I've been reading posts on Bluray authoring with Final Cut Pro. Just got the upgrade to Final Cut Studio and saw some video at the apple site about bluray. Frankly, I don't want to spend money with a Windows authoring software for Bluray. So,
-
I have a workflow that creates appointments in CRM 2011. The appointment is created setting a user as the organizer. The issue is that the appointment syncs to the Outlook client, and the user needs to open it on their Outlook calendar and click sen