InstantDB Project
About InstantDB
Project Mail Lists
Short History
Reporting Bugs
Screen Shots
3rd Party Examples
FAQs

Software
Downloads
Documentation
CVS Repositories
Roadmap
License

About Enhydra.org
Who We Are
News, Articles & Events
Getting Involved
Contact Us

Community
Demos
Contributions
Resources
Case Studies
On The Edge! -NEW-
Commercial Vendors


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: InstantDB: IDB Driver name


Well, I have verified that it's not a classpath error. Consider the
following:

I am running this in a servlet. When instantiating the servlet, I need to
set up an Enhydra application (see java.txt for the relevant code snippet).
After getting the discRack.conf file, I call

	app.startup(conf)

and this is where I see the error message in question (see output.txt for
error message plus stack trace).

Now, what I've done in this example is gone and manually tried to
instantiate the idbDriver class right before I call app.startup(). If this
really is a classpath error I should get the error there as well.

But I don't.

I instantiate the driver both directly and via newInstance()...

   idbDriver driver = new idbDriver();
   Debug.println (this, 0, "Made it to here!!!!!");
   try {
	Class cl = Class.forName("org.enhydra.instantdb.jdbc.idbDriver");
	Debug.println (this, 0, "Got class");
	Object instance = cl.newInstance();
	Debug.println (this, 0, "Got instance");
   } catch (Exception e) {
	Debug.println (this, 0, "Got error:"+e);
   }

When I do this I get all the messages indicating success. So I know this
puppy is in my classpath, right? Or am I missing something here?

Any suggestions appreciated...

Christian
------------------------------------------------
Christian Cryder
Software Engineer, Rocks
Lutris Technologies, Inc.
christianc@lutris.com
------------------------------------------------
       "What a great time to be a Geek"
------------------------------------------------
 http://www.lutris.com ~ http://xmlc.enhydra.org


> -----Original Message-----
> From: owner-instantDB@enhydra.org [mailto:owner-instantDB@enhydra.org]On
> Behalf Of george stewart
> Sent: Thursday, November 16, 2000 7:50 AM
> To: instantDB@enhydra.org
> Subject: RE: InstantDB: IDB Driver name
>
>
> Hi Christian
> --- Christian Cryder <christian.cryder@lutris.com>
> wrote:
> > Hi Helge,
> >
> > Actually it should. The Servlet 2.2 spec states that
> > any .jar file in the
> > /lib directory will be loaded when the web app
> > starts. I have verified that
> > idb.jar is in this directory (and that the jar does
> > in fact contain the
> > driver class).
>
> I would try Helge's suggestion.  Either add to the
> classpath environment or modify the tomcat startup
> scipt to add InstantDB to the class path.  Tomcat will
> echo the classpath on startup.
>
> >I also have another jar file in the
> > lib directory, and it is
> > getting loaded, so I'm 99.9% sure it is in fact
> > already in the classpath.
> >
>
> It probably doesn't help to have the InstantDB jar in
> context.  My experience with Tomcat is Class.forName()
> fails for classes in the context unless you provide
> Tomcats's class loader.
>
> Regards, george
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Calendar - Get organized for the holidays!
> http://calendar.yahoo.com/
> ------------------------------------------------------------------
> -----------
> To unsubscribe from this mailing list, send email to majordomo@enhydra.org
> with the text "unsubscribe instantdb" in the body of the email.
> If you have other questions regarding this mailing list, send email to
> the list admin at owner-instantdb@enhydra.org.
	/**
	 * Set up an underlying Enhydra application for database
	 * related stuff (DODS needs this to function properly).
	 * We'll store a reference to the Application in the 
	 * ServletContext, so if anyone needs access to it, they
	 * can get it.
	 */	
	private void setUpEnhydraApplication(ServletConfig config) {
		ServletContext context =  config.getServletContext();
		Application app = (Application) context.getAttribute(ENHYDRA_APPLICATION);
		if (app==null) {
			try {
				Debug.println (this, 0, "Creating Underlying Application");
				app = new DiscRackApplication();
				app.setLogChannel(new StandardLogger(true).getChannel("")); 
				String configFile = config.getInitParameter(CONFIG_FILE);
				Debug.println (this, 0, "Config:"+configFile);
//				File f = new File(configFile);
//				Debug.println (this, 0, "Got file: exists = "+f.exists());

				idbDriver driver = new idbDriver();
				Debug.println (this, 0, "Made it to here!!!!!");
				try {
					Class cl = Class.forName("org.enhydra.instantdb.jdbc.idbDriver");
					Debug.println (this, 0, "Got class");
					Object instance = cl.newInstance();
					Debug.println (this, 0, "Got instance");
				} catch (Exception e) {
					Debug.println (this, 0, "Got error:"+e);
				}

				InputStream is = context.getResourceAsStream(configFile);
				Config conf = new ConfigFile(is).getConfig();
				Debug.println (this, 0, "Got Config file:"+conf);
				app.startup(conf);
				Debug.println (this, 0, "Started app:"+app);
//				app.startup(new ConfigFile(f).getConfig());
				context.setAttribute(ENHYDRA_APPLICATION, app);
			} catch(Exception e) {
				System.out.println("Error setting up Enhydra Application:"+e);
				e.printStackTrace();
			}
		}
		Debug.println (this, 0, "Registering Application with Enhydra");
		Enhydra.register(app);
	}
DiscRackGateway-->            Creating Underlying Application
DiscRackGateway-->            Config:discRack.conf
DiscRackGateway-->            Made it to here!!!!!
DiscRackGateway-->            Got class
DiscRackGateway-->            Got instance
DiscRackGateway-->            Got Config file:{DatabaseManager={Debug=false, DefaultDatabase=sid1, DB={sid1={Connection=
{Logging=false, User=disc, MaxPoolSize=30, Url=jdbc:idb:/enhydra/Projects/EnhydraOrg/Enhydra/output/enhydra3.1b1/example
s/DiscRack/output/discRack.prp, Password=csid, AllocationTimeout=10000}, ClassType=Standard, JdbcDriver=org.enhydra.inst
antdb.jdbc.idbDriver, ObjectId={CacheSize=20, MinValue=1000000}}}, Databases=[Ljava.lang.String;@c83c84fb}, AutoLogin={A
dmin=15, Member=-1}}
Enhydra Java Application Server
Copyright 1997-2000 Lutris Technologies, Inc.
All rights reserved.
Error setting up Enhydra Application:com.lutris.appserver.server.ApplicationException: Could not create logical database
 sid1: can't load JDBC driver class: org.enhydra.instantdb.jdbc.idbDriver: Could not create logical database sid1: can't
 load JDBC driver class: org.enhydra.instantdb.jdbc.idbDriver
com.lutris.appserver.server.ApplicationException: Could not create logical database sid1: can't load JDBC driver class:
org.enhydra.instantdb.jdbc.idbDriver: Could not create logical database sid1: can't load JDBC driver class: org.enhydra.
instantdb.jdbc.idbDriver
        at com.lutris.appserver.server.StandardApplication.createDatabaseManager(StandardApplication.java:358)
        at com.lutris.appserver.server.StandardApplication.startup(StandardApplication.java:245)
        at rocksDiscRack.DiscRackGateway.setUpEnhydraApplication(DiscRackGateway.java:108)
        at rocksDiscRack.DiscRackGateway.initializeLocal(DiscRackGateway.java:56)
        at org.enhydra.rocks.core.event.ApplicationGateway.init(ApplicationGateway.java:547)
        at org.apache.tomcat.core.ServletWrapper$2.method(ServletWrapper.java:286)
        at org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java, Compiled Code)
        at org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:283)
        at org.apache.tomcat.core.Context.loadServlets(Context.java, Compiled Code)
        at org.apache.tomcat.core.Context.init(Context.java, Compiled Code)
        at org.enhydra.servlet.servletManager.ServletManager.initContext(ServletManager.java, Compiled Code)
        at org.enhydra.servlet.servletManager.ServletManager.buildContext(ServletManager.java, Compiled Code)
        at org.enhydra.servlet.servletManager.ServletManager.start(ServletManager.java:1156)
        at org.enhydra.servlet.servletManager.ServletManager.startAllContexts(ServletManager.java, Compiled Code)
        at org.enhydra.servlet.ServletContainer.readConfigFile(ServletContainer.java, Compiled Code)
        at org.enhydra.servlet.ServletContainer.start(ServletContainer.java:261)
        at com.lutris.multiServer.MultiServer.start(MultiServer.java, Compiled Code)
        at com.lutris.multiServer.MultiServer.main(MultiServer.java:160)
*** Caused by:
com.lutris.appserver.server.sql.DatabaseManagerException: Could not create logical database sid1: can't load JDBC driver
 class: org.enhydra.instantdb.jdbc.idbDriver
        at com.lutris.appserver.server.sql.StandardDatabaseManager.loadLogicalDatabase(StandardDatabaseManager.java:237)

        at com.lutris.appserver.server.sql.StandardDatabaseManager.<init>(StandardDatabaseManager.java, Compiled Code)
        at com.lutris.appserver.server.StandardApplication.createDatabaseManager(StandardApplication.java:356)
        at com.lutris.appserver.server.StandardApplication.startup(StandardApplication.java:245)
        at rocksDiscRack.DiscRackGateway.setUpEnhydraApplication(DiscRackGateway.java:108)
        at rocksDiscRack.DiscRackGateway.initializeLocal(DiscRackGateway.java:56)
        at org.enhydra.rocks.core.event.ApplicationGateway.init(ApplicationGateway.java:547)
        at org.apache.tomcat.core.ServletWrapper$2.method(ServletWrapper.java:286)
        at org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java, Compiled Code)
        at org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:283)
        at org.apache.tomcat.core.Context.loadServlets(Context.java, Compiled Code)
        at org.apache.tomcat.core.Context.init(Context.java, Compiled Code)
        at org.enhydra.servlet.servletManager.ServletManager.initContext(ServletManager.java, Compiled Code)
        at org.enhydra.servlet.servletManager.ServletManager.buildContext(ServletManager.java, Compiled Code)
        at org.enhydra.servlet.servletManager.ServletManager.start(ServletManager.java:1156)
        at org.enhydra.servlet.servletManager.ServletManager.startAllContexts(ServletManager.java, Compiled Code)
        at org.enhydra.servlet.ServletContainer.readConfigFile(ServletContainer.java, Compiled Code)
        at org.enhydra.servlet.ServletContainer.start(ServletContainer.java:261)
        at com.lutris.multiServer.MultiServer.start(MultiServer.java, Compiled Code)
        at com.lutris.multiServer.MultiServer.main(MultiServer.java:160)
*** Caused by:
java.sql.SQLException: can't load JDBC driver class: org.enhydra.instantdb.jdbc.idbDriver
        at com.lutris.appserver.server.sql.standard.StandardLogicalDatabase.init(StandardLogicalDatabase.java:161)
        at com.lutris.appserver.server.sql.standard.StandardLogicalDatabase.<init>(StandardLogicalDatabase.java:116)
        at com.lutris.appserver.server.sql.StandardDatabaseManager.loadLogicalDatabase(StandardDatabaseManager.java:215)

        at com.lutris.appserver.server.sql.StandardDatabaseManager.<init>(StandardDatabaseManager.java, Compiled Code)
        at com.lutris.appserver.server.StandardApplication.createDatabaseManager(StandardApplication.java:356)
        at com.lutris.appserver.server.StandardApplication.startup(StandardApplication.java:245)
        at rocksDiscRack.DiscRackGateway.setUpEnhydraApplication(DiscRackGateway.java:108)
        at rocksDiscRack.DiscRackGateway.initializeLocal(DiscRackGateway.java:56)
        at org.enhydra.rocks.core.event.ApplicationGateway.init(ApplicationGateway.java:547)
        at org.apache.tomcat.core.ServletWrapper$2.method(ServletWrapper.java:286)
        at org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java, Compiled Code)
        at org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:283)
        at org.apache.tomcat.core.Context.loadServlets(Context.java, Compiled Code)
        at org.apache.tomcat.core.Context.init(Context.java, Compiled Code)
        at org.enhydra.servlet.servletManager.ServletManager.initContext(ServletManager.java, Compiled Code)
        at org.enhydra.servlet.servletManager.ServletManager.buildContext(ServletManager.java, Compiled Code)
        at org.enhydra.servlet.servletManager.ServletManager.start(ServletManager.java:1156)
        at org.enhydra.servlet.servletManager.ServletManager.startAllContexts(ServletManager.java, Compiled Code)
        at org.enhydra.servlet.ServletContainer.readConfigFile(ServletContainer.java, Compiled Code)
        at org.enhydra.servlet.ServletContainer.start(ServletContainer.java:261)
        at com.lutris.multiServer.MultiServer.start(MultiServer.java, Compiled Code)
        at com.lutris.multiServer.MultiServer.main(MultiServer.java:160)

discRack.conf