db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lance J. Andersen" <Lance.Ander...@Sun.COM>
Subject Re: Sun 8.0.1 Appserver pooling
Date Tue, 28 Dec 2004 19:14:05 GMT


Nat Gross wrote:

> Lance J. Andersen wrote:
>
>> Nat,
>> I have had this working successfully with 8.0 and early beta of 8.1.
>
>
> Thanks. Music to my ears. I prefer Derby over HSQLDB, and this info 
> helps my decision.

Yes I have had no problems with derby and have been testing it extensively.

>
>>
>> Where did you install your derby classes?  Normally I put them in 
>> domains/domain1/lib/ext.
>
>
> I put them into "domains/domain1/lib". But even if that was wrong, I 
> also configured sjsaas (jvm options--->paths) to add derby.jar to the 
> classpath, which it correctly did, since it finally changed from the 
> 'class not found' error to the gui framework error. Also, it 
> automatically gave me Derby relevant properties to set, so I assume 
> that it did properly see the Derby classes.

nope that is fine to place it in domains/domain1/lib which is where I 
place it.  Key is to reboot after this.  the cli also has a ping command 
which is what i often use instead of the gui.

>
>>
>> Can you post your domain.xml entry that you used with the embedded 
>> driver?
>
>
> To be honest, I don't know what this is. But I am just finishing up 
> the install of sjsas8.1 RC, and will attempt everything again.
>
in domains/domain1/config, you will find the domain.xml.  This is the 
configuration of SJSAS.

>>   Are you sure you did not have another process that already had the 
>> DB open outside of SJSAS?
>
>
> Huh? What? WOA. Maybe this was it. I have Eclipse/MyEclipse with 
> dbExplorer connecting to it at times, and it *might* have been using a 
> connection as well. (But I also think, yes only think, that I tried it 
> many times with the Eclipse ide closed altogether.)
> BUT, does this mean, that I cannot use any type of db tool to 
> view/alter the database if I have that db open from appserver? <sigh>
> Or, can I administer/manage (my dba hat on now) the db via some tool 
> VIA a pooled connection from sjsas?
> Thanks a mill;
> -nat
>
With the embedded driver, only 1 process can have the DB open at once.  
If you need multiple processes, use the network server.  You could mange 
the db via SJSAS if you deploy and app to SJSAS which provides this 
functionality.

I would use the Network Driver with an appserver if you need multiple 
processes to access the DB, including an app client or another 
standalone app such as dbExplorer.

Lance

>>
>> Regards
>> Lance
>>
>> Nat Gross wrote:
>>
>>> myrnap wrote:
>>>
>>>> Nat Gross wrote:
>>>>
>>>>> myrnap wrote:
>>>>>
>>>>>> Nat Gross wrote:
>>>>>>
>>>>>>> Hi;
>>>>>>> Although I have no problems connecting to my new Derby, via 
>>>>>>> jdbc, I cannot get a 'ping' when setting up a j2ee pool and jndi

>>>>>>> connector in the Sun app server. I followed the instructions
on 
>>>>>>> the java.net blog,for embedded, the classpath is set, have tried

>>>>>>> various javax connectors, the xa version and non xa version,
to 
>>>>>>> no avail.
>>>>>>> Your help will be appreciated.
>>>>>>> Thanks
>>>>>>> -nat
>>>>>>>
>>>>>> Nat,
>>>>>>
>>>>>> What's the error you see?
>>>>>> What's in the server.log?
>>>>>> Does a derby.log get created? If so, is it where you expect it to

>>>>>> be?
>>>>>>
>>>>>> Myrna
>>>>>>
>>>>> Progress.... For some reason the sdk's bin directory wasn't in the 
>>>>> PATH. I didn't dream that the gui admin uses the cmdline stuff 
>>>>> behind the scenes. Anyhow, now there is a new error when pinging.
>>>>> The first exception sais that it couldn't open the database and 
>>>>> the next exception has the details why. But the next exception 
>>>>> list some gui framework error, for the ping button. Here it is.:
>>>>>
>>>> Hm, I like the classnot found problem more - at least then we know 
>>>> it's the classpath, somehow. :-)
>>>> I would've checked whether derby.jar was in the lib, or lib/ext dir...
>>>>
>>>> The 'Failed to start database ...' error can be caused by a number 
>>>> of situations...Unfortunately, I think the app server gobbles up 
>>>> the nested (i.e. 'next') exception...
>>>> Perhaps someone else knows more about the framework error...
>>>>
>>>> The situation I'm thinking you might be hitting is somehow 2 
>>>> jvms/processes trying to get hold of the same database.
>>>>
>>>> In that case, you would see a derby.log that looks completely fine 
>>>> and healthy (because of the first jvm starting the database), but 
>>>> still get this error. And of course, you'd see an extra (java or 
>>>> javaw) process after the ping.
>>>>
>>>> To see more, I suggest you add the following derby.properties file 
>>>> to the derby.system.home dir (practically speaking, that would be 
>>>> where derby.log gets created.):
>>>>    derby.infolog.append=true
>>>>    derby.language.logStatementText=true
>>>>    derby.stream.error.logSeverityLevel=0
>>>>
>>>> If it is the multiple jvm situation, then you will see a neat 
>>>> starting message in derby.log & still get this error. If it's 
>>>> something else, then possibly the database does not get opened at 
>>>> all, and your derby.log would be an empty file even after 
>>>> infolog.append is picked up from derby.properties.
>>>>
>>>> Now, why there would be 2 jvms trying to start the database - I 
>>>> don't know...Does the ping start a second process/jvm?
>>>>
>>>> Another area to look at is the policy files. This is really a wild 
>>>> guess....But make sure the following permissions are set for the 
>>>> derby database:
>>>> grant codeBase "file://<your domain/lib dir>/derby.jar" {
>>>> permission java.lang.RuntimePermission "createClassLoader";
>>>> permission java.util.PropertyPermission "derby.*", "read";
>>>> permission java.io.FilePermission "${derby.system.home}${/} -", 
>>>> "read,write,delete";
>>>>
>>>> I hope this helps any....
>>>>
>>>> Myrna
>>>>
>>>>
>>> Thank you much. I am sure that this is a bug on the Sun Appserver 
>>> 8.0.1. A search of the Sun forum revealed that many users have seen 
>>> the same Sun error with other products (non-Derby, or even db 
>>> related). So, I guess I'll try their RC of the next version, to 
>>> verify this. I am also thinking of using the Jonas (objectweb.org) 
>>> appserver, but I don't know how to embed Derby within it.
>>> If anyone has used Jonas replacing HSQLDB (that comes with it) with 
>>> Derby, please let me know.
>>> TA
>>> -nat
>>
>>
>>
>>
>

Mime
View raw message