Re: [mdr-users] lookup / classloader problem

Jaroslav Drazan <[email protected]> Thu, 02 Feb 2006 13:35:01 +0100 (CET)
Newsgroups gmane.comp.java.netbeans.modules.mdr.user
Message-ID <[email protected]>
Hi,
try to use Thread.currentThread().setContextClassLoader (yourClassLoader) before launching MDR;

Kind Regards
Jarda

>  ------------ Původní zpráva ------------
>  Od: Aurélie MERLIN <[email protected]>
>  Předmět: [mdr-users] lookup / classloader problem
>  Datum: 02.2.2006 13:08:37
>  ----------------------------------------
>  Hello, I'm using MDR standalone to import XMI files in our application. 
>  My first tests imported only UML1.4 and everything was OK.
>  As we want to import both UML 1.3 and UML 1.4, we use a ClassLoader
>  because of uml1.3 and uml1.4 packages incompatibility. Now an exception
>  is occurring every time the Lookup is called. 
>  
>  When I do this :
>  	NBMDRManagerImpl  manager = new NBMDRManagerImpl();
>  	NBMDRepositoryImpl rep = (NBMDRepositoryImpl)
>  manager.getDefaultRepository();
>  	rep.beginTrans(true);
>  
>  
>  I have the following Exception :
>  org.netbeans.mdr.util.DebugException: Boot failed.
>  	at
>  org.netbeans.mdr.NBMDRepositoryImpl.installPureMof(NBMDRepositoryImpl.ja
>  va:1357)
>  	at
>  org.netbeans.mdr.NBMDRepositoryImpl.boot(NBMDRepositoryImpl.java:1323)
>  	at
>  org.netbeans.mdr.NBMDRepositoryImpl.initCheck(NBMDRepositoryImpl.java:75
>  6)
>  	at
>  org.netbeans.mdr.NBMDRepositoryImpl.beginTrans(NBMDRepositoryImpl.java:2
>  25)
>  	...
>  	...
>  
>  
>  The problem is coming from the Lookup to get the reader in
>  installPureMof method :
>  	XmiReader xmiReader = (XmiReader)
>  Lookup.getDefault().lookup(XmiReader.class);
>  
>  We'd not like to change the MDR code. Do I have to create my own
>  MDRepsitoryImpl and to instantiate directly the reader with
>  XMISaxReaderImpl ? Is there another solution ?
>  
>  Thanks for all,
>  Aurélie.
>  
>  
>  
>  
>  --
>   	Aurélie Merlin 
>  Ingénieur d'études et de développement 	
>  LYRIA S.A.
>  3, rue Galvani
>  91741 MASSY Cedex 	
>  E-mail : [email protected]	
>  Tél.	 : +33 (0)1 64 53 18 26	
>  Fax	 : +33 (0)1 69 32 05 13	
>    _____  
>  
>  Téléchargez la version gratuite de Leonardi sur notre site
>  www.lyria.com. 	
>  
>  
>  
>  
>