You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by "Charles N. Harvey III" <ch...@alloy.com> on 2005/03/18 01:49:20 UTC

bizarro errors

Hello.
I turned my logging to DEBUG with db-ojb-1.0.1.jar and get the following
strangeness when I startup my webapp.

1) I can see the MetadataManager starting up
2) I see the RepositoryPersistor starting up
3) It is reading my repository.xml from my WEB-INF/classes/ directory
4) It then prints out every single line of the DescriptorRepository
   (ignoring "unused" elements connection-pool, sequence-manager,
   jdbc-connection-descriptor).
5) Then, after every single class-descriptor is printed out, I get this
   error:

    (MetadataManager.java:155) - No repository.xml file found, starting
    with empty metadata and connection configuration
    (MetadataManager.java:566) - No 'default-connection' attribute set in
    jdbc-connection-descriptors, thus it's currently not possible to use
    'defaultPersistenceBroker()' convenience method to lookup 
PersistenceBroker
    instances. But it's possible to enable this at runtime using 
'setDefaultKey'
    method.

Why would it do that?  Why would it tell me that it can't find a 
repository.xml
when it just printed out the entire thing?

Even better, this doesn't happen all the time.  And I can't figure out
what makes it work or not work.  Very frustrating.  Any help you can provide
is very welcome.  Thanks.


Charlie

  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: bizarro errors

Posted by "Charles N. Harvey III" <ch...@alloy.com>.
Well, it started working.

I did not have the DTD in the directory.  But I wasn't looking for it
either.  My repository.xml file is pointing at http://db.apach.org....
Maybe it wasn't being read correctly from the server?  Maybe we have
some weird firewall stuff going on?

And, I didn't have any of those xml jars.  Now I have 3:
xerces-2.4.0.jar, xercesImpl-2.4.0.jar and xml-apis.2.0.2.jar.

So one of those two things fixed the problem.  Whichever one it was,
I really don't care.  All I care about is that I can go home now.

Thanks so much for your help Martin, it made all the difference.


Charlie



Martin Kalén said the following on 3/17/2005 8:26 PM:

> Charles N. Harvey III wrote:
>
>> I am using the binary release of OJB 1.0.1.  And I don't know which
>> XML parser I am using.  I don't even know where to specify that.
>> The only xml processing jar in my classpath is dom4j.  Should something
>> else be there?
>>
>> I just put xerces-2.4.0 in the WEB-INF/lib/ to no avail.  Same error.
>>
>> And I am running in DEBUG because it was failing, not the other way 
>> around
>> ;)
>
>
> I just did a local test of what happens when i rip repository.dtd out 
> of my JAR in Tomcat. Same error message, which might be the source of 
> recent confusion...
>
> So; do you have the repository.dtd handy in your CLASSPATH?
>
> If not:
> java.io.FileInputStream.<init>(FileInputStream.java:66)
>     at 
> sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:69) 
>
>     at 
> sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:156) 
>
>     at 
> org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown 
> Source)
>
> But unfortunately the error reported from OJB is:
>  "MetadataException: Can not read repository repository_database.xml"
>
> Regards,
>  Martin
>
> P.S. OJB does not use dom4j, I assume you have Xerces in a 
> common/endorsed lib location and/or in your JDK. It should not matter 
> too much which version though, just interesting for trying to 
> reproduce your particular set-up.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: bizarro errors

Posted by Martin Kalén <mk...@apache.org>.
Charles N. Harvey III wrote:
> I am using the binary release of OJB 1.0.1.  And I don't know which
> XML parser I am using.  I don't even know where to specify that.
> The only xml processing jar in my classpath is dom4j.  Should something
> else be there?
> 
> I just put xerces-2.4.0 in the WEB-INF/lib/ to no avail.  Same error.
> 
> And I am running in DEBUG because it was failing, not the other way around
> ;)

I just did a local test of what happens when i rip repository.dtd out of 
my JAR in Tomcat. Same error message, which might be the source of 
recent confusion...

So; do you have the repository.dtd handy in your CLASSPATH?

If not:
java.io.FileInputStream.<init>(FileInputStream.java:66)
	at 
sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:69)
	at 
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:156)
	at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown 
Source)

But unfortunately the error reported from OJB is:
  "MetadataException: Can not read repository repository_database.xml"

Regards,
  Martin

P.S. OJB does not use dom4j, I assume you have Xerces in a 
common/endorsed lib location and/or in your JDK. It should not matter 
too much which version though, just interesting for trying to reproduce 
your particular set-up.

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: bizarro errors

Posted by "Charles N. Harvey III" <ch...@alloy.com>.
I am using the binary release of OJB 1.0.1.  And I don't know which
XML parser I am using.  I don't even know where to specify that.
The only xml processing jar in my classpath is dom4j.  Should something
else be there?

I just put xerces-2.4.0 in the WEB-INF/lib/ to no avail.  Same error.

And I am running in DEBUG because it was failing, not the other way around
;)


Charlie



Martin Kalén said the following on 3/17/2005 8:00 PM:

> Charles N. Harvey III wrote:
>  >    (MetadataManager.java:155) - No repository.xml file found, starting
>
>>    with empty metadata and connection configuration
>
>
> See also 
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=ojb-user@db.apache.org&msgNo=16025 
>
>
> This has been known to be working (see my reply to Markus). Are you 
> using the binary release of OJB 1.0.1? Which XML-parser and version 
> are you using?
>
>> Why would it do that?  Why would it tell me that it can't find a 
>> repository.xml when it just printed out the entire thing?
>
>
> As stated on the other thread, the error reporting is poor in this 
> area - a FileNotFoundException is caught causing this generic error to 
> be logged without a stacktrace (so no indication of exact point of 
> failure during file load or parse).
>
>> Even better, this doesn't happen all the time.
>
>
> Is it related to you turning on DEBUG or did you just do this to trace 
> the problem after it happened in the first place?
>
> Regards,
>  Martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: bizarro errors

Posted by Martin Kalén <mk...@apache.org>.
Charles N. Harvey III wrote:
  >    (MetadataManager.java:155) - No repository.xml file found, starting
>    with empty metadata and connection configuration

See also 
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=ojb-user@db.apache.org&msgNo=16025

This has been known to be working (see my reply to Markus). Are you 
using the binary release of OJB 1.0.1? Which XML-parser and version are 
you using?

> Why would it do that?  Why would it tell me that it can't find a 
> repository.xml when it just printed out the entire thing?

As stated on the other thread, the error reporting is poor in this area 
- a FileNotFoundException is caught causing this generic error to be 
logged without a stacktrace (so no indication of exact point of failure 
during file load or parse).

> Even better, this doesn't happen all the time.

Is it related to you turning on DEBUG or did you just do this to trace 
the problem after it happened in the first place?

Regards,
  Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org