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 Joerg Lensing <in...@softcon-lensing.de> on 2003/05/09 21:24:40 UTC
bug or feature? RepositoryPersistor.buildRepository() returns Object
without any values from xml-files
hi all,
this method works without any errors. repository.xml can be found by ojb
- BUT, the returned
object has no values from xml-file(s). I use rc3 from cvs-screenshot.
Can someone give me a hint?
joerg
Re: bug or feature? RepositoryPersistor.buildRepository() returns
Object without any values from xml-files
Posted by Joerg Lensing <in...@softcon-lensing.de>.
hi armin,
thanx for your help!
shame on me!!!!
the problem occurs, if i omit some necessary values in repository.xml .
It seems that it
runs right now
nice weekend
joerg
Re: bug or feature? RepositoryPersistor.buildRepository() returns Object without any values from xml-files
Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Joerg,
I re-activate the uncommented test. The
test passed well (check out current CVS)
Below you could find the test.
Could you add a new test to RepositoryPersistorTest
test case to reproduce your problem, or does the
problem only occur within tomcat?
regards,
Armin
/** Test storing/read repository.*/
public void testStoreReadConnectionRepository() throws Exception
{
String filename = "test_repository_database.xml";
DescriptorRepository repository =
MetadataManager.getInstance().getRepository();
ConnectionRepository conRepository =
MetadataManager.getInstance().connectionRepository();
int connectionCount = conRepository.getAllDescriptor().size();
FileOutputStream fos = new FileOutputStream(filename);
RepositoryPersistor persistor = new RepositoryPersistor();
persistor.writeToFile(repository, conRepository, fos);
ConnectionRepository second =
persistor.readConnectionRepository(filename);
##### use HashMap jcdMap
int connectionCount2 = second.getAllDescriptor().size();
##### use Hashtable jcdAliasToPBKeyMap
PBKey defaultKey =
second.getStandardPBKeyForJcdAlias(TestHelper.DEF_JCD_ALIAS);
assertNotNull(defaultKey);
assertEquals(TestHelper.DEF_KEY, defaultKey);
#### jcdMap is not empty
assertTrue(connectionCount2 > 0);
assertEquals("read in persisted connection repository should
have same number of classes",
connectionCount, connectionCount2);
}
----- Original Message -----
From: "Joerg Lensing" <in...@softcon-lensing.de>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Saturday, May 10, 2003 12:19 PM
Subject: Re: bug or feature? RepositoryPersistor.buildRepository()
returns Object without any values from xml-files
> Hi Armin,
> I debugged to the point
>
RepositoryPersistor.readConnectionRepository(String).buildRepository(..)
.
> This
> method returns the Object result[ConnectionRepository]. Both fields
> (HashMap jcdMap,Hashtable jcdAliasToPBKeyMap)
> are empty.
>
> joerg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
Re: bug or feature? RepositoryPersistor.buildRepository() returns
Object without any values from xml-files
Posted by Joerg Lensing <in...@softcon-lensing.de>.
Hi Armin,
I debugged to the point
RepositoryPersistor.readConnectionRepository(String).buildRepository(..).
This
method returns the Object result[ConnectionRepository]. Both fields
(HashMap jcdMap,Hashtable jcdAliasToPBKeyMap)
are empty.
joerg
Re: bug or feature? RepositoryPersistor.buildRepository() returns
Object without any values from xml-files
Posted by Joerg Lensing <in...@softcon-lensing.de>.
Hi Armin,
the testcase you mentioned doesn't run the part for reading the
repository_database.xml. It is commented out.
joerg
Re: bug or feature? RepositoryPersistor.buildRepository() returns
Object without any values from xml-files
Posted by Joerg Lensing <in...@softcon-lensing.de>.
Armin Waibel schrieb:
>Hi Joerg,
>
>this method is private and was used by e.g
>public methods
>
>ConnectionRepository readConnectionRepository(String filename)
>DescriptorRepository readDescriptorRepository(String filename)
>
>further on we have a test case RepositoryPersistorTest
>use one of this methods. If buildRepository(...) returns no values
>this test should fail.
>Could you describe a little more detailed when
>this method returns no values?
>
>regards,
>Armin
>
>
Hi Armin,
i start with
>Implementation odmg = OJB.getInstance();
at the start of Tomcat (PlugIn-Interface)
later in MetadataManager.init():
>globalRepository = new
RepositoryPersistor().readDescriptorRepository(repository);
joerg
Re: bug or feature? RepositoryPersistor.buildRepository() returns Object without any values from xml-files
Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Joerg,
this method is private and was used by e.g
public methods
ConnectionRepository readConnectionRepository(String filename)
DescriptorRepository readDescriptorRepository(String filename)
further on we have a test case RepositoryPersistorTest
use one of this methods. If buildRepository(...) returns no values
this test should fail.
Could you describe a little more detailed when
this method returns no values?
regards,
Armin
----- Original Message -----
From: "Joerg Lensing" <in...@softcon-lensing.de>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Friday, May 09, 2003 9:24 PM
Subject: bug or feature? RepositoryPersistor.buildRepository() returns
Object without any values from xml-files
> hi all,
> this method works without any errors. repository.xml can be found by
ojb
> - BUT, the returned
> object has no values from xml-file(s). I use rc3 from cvs-screenshot.
>
> Can someone give me a hint?
>
> joerg
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>