Issue 67333 - dtrans: CannotRegisterImplementationException
Summary: dtrans: CannotRegisterImplementationException
Status: CLOSED FIXED
Alias: None
Product: porting
Classification: Code
Component: MacOSX (show other issues)
Version: current
Hardware: PowerPC (PPC) Mac OS X, all
: P3 Trivial (vote)
Target Milestone: DevTools
Assignee: ebischoff
QA Contact: issues@porting
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-13 16:35 UTC by pavel
Modified: 2017-05-20 09:13 UTC (History)
6 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
small changes... (585 bytes, patch)
2006-08-07 18:57 UTC, hjs
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description pavel 2006-07-13 16:35:04 UTC
Current aquavcl breaks in dtrans. It is not needed for vcl, but very often it
builds before vcl -> breaks my builds:

=============
Building project dtrans
=============
/Volumes/Build/oo/AQUA/BuildDir/ooo_SRC680_m176_src/dtrans/source/generic
dmake: Executing shell macro: xml2cmp -types stdout
$(MISC)$/$(COMP1TYPELIST)$($(WINVERSIONNAMES)_MAJOR).xml
-------------
/Volumes/Build/oo/AQUA/BuildDir/ooo_SRC680_m176_src/dtrans/source/cnttype
dmake: Executing shell macro: xml2cmp -types stdout
$(MISC)$/$(COMP1TYPELIST)$($(WINVERSIONNAMES)_MAJOR).xml
-------------
/Volumes/Build/oo/AQUA/BuildDir/ooo_SRC680_m176_src/dtrans/source/X11
dmake: Executing shell macro: xml2cmp -types stdout
$(MISC)$/$(COMP1TYPELIST)$($(WINVERSIONNAMES)_MAJOR).xml
Nothing to build for Mac OS X
/Volumes/Build/oo/AQUA/BuildDir/ooo_SRC680_m176_src/dtrans/source/aqua
dmake: Executing shell macro: xml2cmp -types stdout
$(MISC)$/$(COMP1TYPELIST)$($(WINVERSIONNAMES)_MAJOR).xml
-------------
regcomp -register -r ../../unxmacxp.pro/bin/dtransaqua.rdb -c dtransaqua680mxp
terminate called after throwing an instance of
'com::sun::star::registry::CannotRegisterImplementationException'
Abort
dmake:  Error code 134, while making 'ALL'
'---* tg_merge.mk *---'

ERROR: Error 65280 occurred while making
/Volumes/Build/oo/AQUA/BuildDir/ooo_SRC680_m176_src/dtrans/source/aqua

This is what I found during some investigation:

> I have compiled cppuhelper with debug and even extended it a bit and
> probably found some trace of error. Hope it helps you to track this issue
> further. I have added debugging to cppuhelper/source/shlib.cxx's
> makeComponentPath:
> 
>> implementation com.sun.star.security.comp.stoc.AccessController supports:
com.sun.star.security.AccessController
> PJ: makeComponentPath (security.uno.dylib,
file:///Volumes/Build/oo/AQUA/BuildDir/ooo_SRC680_m172_src/solver/680/unxmacxp.pro/lib)
> Thread:      1 :component
path=file:///Volumes/Build/oo/AQUA/BuildDir/ooo_SRC680_m172_src/solver/680/unxmacxp.pro/lib/security.uno.dylib
> 
> PJ: leaving makeComponentPath.
>> implementation com.sun.star.security.comp.stoc.FilePolicy supports:
com.sun.star.security.Policy
> PJ: makeComponentPath (dtransaqua680mxp, )
> Error: File
/Volumes/Build/oo/AQUA/BuildDir/ooo_SRC680_m172_src/cppuhelper/source/shlib.cxx,
Line 254: dtransaqua680mxp
> Thread:      1 :component path=libdtransaqua680mxp.dylib
> 
> PJ: leaving makeComponentPath.
> terminate called after throwing an instance of
'com::sun::star::registry::CannotRegisterImplementationException'
> Abort
> dmake:  Error code 134, while making 'ALL'
> 
> It somehow fails on dtransaqua680mxp, because this lib is not yet delivered
> into the solver. I copied it to the solver and it was then registered
> successfully. Looks like this is somehow connected to bootstrapping
> mechanisms or something similar? What is also interesting is that the
> library is not called how it is stored in the filesystem
> (libdtrans....dylib) but it is called as dtransaqua680mxp in
> makeComponentPath.

ause asked jsc how the components are loaded.

Juergen replied with:

   > The component itself is simply loaded via osl_loadModule and have to be 
   > specified with a full qualified path or an appropriate LD_LIBRARY_PATH. 
   > Especially the later one is important to find dependent libraries if no 
   > correct rpath option is used. But of course under Unix we use a correct 
   > rpath option nowadays.

I tried it:

macmini:~/AQUA/BuildDir/ooo_SRC680_m176_src/dtrans/source/aqua oo$ export
LD_LIBRARY_PATH=../../unxmacxp.pro/lib/
macmini:~/AQUA/BuildDir/ooo_SRC680_m176_src/dtrans/source/aqua oo$ dmake
dmake: Executing shell macro: xml2cmp -types stdout
$(MISC)$/$(COMP1TYPELIST)$($(WINVERSIONNAMES)_MAJOR).xml
-------------
regcomp -register -r ../../unxmacxp.pro/bin/dtransaqua.rdb -c dtransaqua680mxp
register component 'dtransaqua680mxp' in registry
'../../unxmacxp.pro/bin/dtransaqua.rdb' succesful!
macmini:~/AQUA/BuildDir/ooo_SRC680_m176_src/dtrans/source/aqua oo$ 

- it works.

So the question is:

- should we set LD_LIBRARY_PATH before the regcomp call

or

- is there any other problem we are workarounding by this change (connected to
bad rpath or ?)
Comment 1 pavel 2006-07-13 17:30:45 UTC
I changed

-        +regcomp -register -r $(BIN)$/$(COMP1TYPELIST).rdb -c $(SHL1TARGET)
+        +regcomp -register -r $(BIN)$/$(COMP1TYPELIST).rdb -c $(SHL1TARGETN)

in the makefile.mk and regcomp finishes OK. The question is, if it is OK.

Juergen also wrote on IRC, that in this case, full path of the library will be
written to the rdb file...
Comment 2 pavel 2006-07-13 17:47:35 UTC
ause had other idea:

macmini:~/AQUA/BuildDir/ooo_SRC680_m176_src/dtrans oo$ cd unxmacxp.pro/lib/
macmini:~/AQUA/BuildDir/ooo_SRC680_m176_src/dtrans/unxmacxp.pro/lib oo$ regcomp
-register -r ../../unxmacxp.pro/bin/dtransaqua.rdb -c dtransaqua680mxp
register component 'dtransaqua680mxp' in registry
'../../unxmacxp.pro/bin/dtransaqua.rdb' succesful!
macmini:~/AQUA/BuildDir/ooo_SRC680_m176_src/dtrans/unxmacxp.pro/lib oo$ 

Works too. What is correct?
Comment 3 jsc 2006-07-14 07:25:15 UTC
The last one from ause with the relative name is definitely the better approach
and we should make it this way.
Comment 4 pavel 2006-07-15 14:05:55 UTC
OK, I'll see.
Comment 5 pavel 2006-07-30 16:01:22 UTC
ause: so what about the following?

--- ooo_SRC680_m179_src.orig/dtrans/source/aqua/makefile.mk	2006-07-13
22:40:07.000000000 +0200
+++ ooo_SRC680_m179_src/dtrans/source/aqua/makefile.mk	2006-07-13
22:40:28.000000000 +0200
@@ -93,9 +93,8 @@
 # --- Targets ------------------------------------------------------
 
 ALL : ALLTAR
-# hjs - do *not* call deliver out of makefiles
-#	+deliver.pl
-	+regcomp -register -r $(BIN)$/$(COMP1TYPELIST).rdb -c $(SHL1TARGET)
+	+cd $(LB)
+	+regcomp -register -r $(BIN)$/$(COMP1TYPELIST).rdb -c $(SHL1TARGETN)
 
 .INCLUDE :	target.mk
 
OK?
Comment 6 ebischoff 2006-08-05 12:26:30 UTC
I stumbled into the same problem and fixed it in CWS aquavcl01 with a very 
similar patch. I described the problem at the end of related issue #36841. 
 
Then Pavel pointed me to this issue report. 
 
So I resynchronized my patch with the one described here, and I have set the 
issue to FiXED, as Pavel suggested me. 
 
Comment 7 pavel 2006-08-06 16:39:59 UTC
.
Comment 8 hjs 2006-08-07 18:57:45 UTC
Created attachment 38323 [details]
small changes...
Comment 9 hjs 2006-08-07 19:02:03 UTC
"cd" on a seperate line doesn't do anything. on the same line, SHL1TARGET should
be sufficient.
also changed the way $(COMP1TYPELIST).rdb is found as the previous version did
just work by luck (same directory depth of <platform>/lib and source/aqua).

untested...
Comment 10 ebischoff 2006-08-07 19:32:52 UTC
Applied last "small changes" patch in CWS aquavcl01. 
 
Hrmpf... We're almost back to my original patch! 
 
Tested, it still works.