• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Configuring a DataSource on WebSphere 5.1.0

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using WSAD 5.1.0 and when i tried to explore the JNDI with a simple Servlet, which connects to a MySQL database and displays some records.

After I start the WSAD, the mySQL_DS is binded to jdbc/mySQL_DS, in console :
*******************************************************************
Binding mySQL_DS as jdbc/mySQL_DS
*******************************************************************
*********** servlet code *********************************
InitialContext ctx = new InitialContext();

DataSource ds = (DataSource) ctx.lookup("jdbc/mySQL_DS");
conn = ds.getConnection("root", "fedfed");

stmt = conn.createStatement();
rs = stmt.executeQuery("SELECT * FROM USER");

*********************************************************************
When I access this servlet I get this error:
[11/26/04 18:52:41:761 GMT] 621e2e82 ConnectionFac E J2CA0036E: An exception occurred while invoking method setDataSourceProperties on com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl used by resource jdbc/mySQL_DS : java.lang.reflect.InvocationTargetException: com.ibm.ws.exception.WsException: DSRA8050W: Unable to find the DataStoreHelper class specified:
at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.<init>(DataStoreAdapterException.java:244)
at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.<init>(DataStoreAdapterException.java:171)
at com.ibm.ws.rsadapter.AdapterUtil.createDataStoreAdapterException(AdapterUtil.java:191)
at com.ibm.ws.rsadapter.DSConfigurationHelper.createDataStoreHelper(DSConfigurationHelper.java:604)
at com.ibm.ws.rsadapter.spi.WSRdbDataSource.<init>(WSRdbDataSource.java:298)
at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.setDataSourceProperties(WSManagedConnectionFactoryImpl.java:862)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.createMCFandPM(ConnectionFactoryBuilderImpl.java:1451)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.getObjectInstance(ConnectionFactoryBuilderImpl.java:1188)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:884)
at com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:1762)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1615)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1525)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1225)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at user.CreateUserServlet.f(CreateUserServlet.java:74)
at user.CreateUserServlet.doGet(CreateUserServlet.java:27)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
---- Begin backtrace for nested exception
java.lang.ClassNotFoundException:
at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java:351)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:261)
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
at com.ibm.ws.rsadapter.DSConfigurationHelper$3.run(DSConfigurationHelper.java:941)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.ws.rsadapter.DSConfigurationHelper.loadClass(DSConfigurationHelper.java:934)
at com.ibm.ws.rsadapter.DSConfigurationHelper.createDataStoreHelper(DSConfigurationHelper.java:593)
at com.ibm.ws.rsadapter.spi.WSRdbDataSource.<init>(WSRdbDataSource.java:298)
at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.setDataSourceProperties(WSManagedConnectionFactoryImpl.java:862)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.createMCFandPM(ConnectionFactoryBuilderImpl.java:1451)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.getObjectInstance(ConnectionFactoryBuilderImpl.java:1188)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:884)
at com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:1762)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1615)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1525)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1225)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at user.CreateUserServlet.f(CreateUserServlet.java:74)

Need your help on what is causing this.
Thanks and regards,
Tudor
 
Shiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic