Page 1 of 1

Two services in two different classes

PostPosted: Sat Mar 06, 2021 1:11 pm
by DavidBo
Believe it or not, now I have problems implementing two services in two different classes but in the same package.
The main class which is responsible for creating ComponentFactory and registry the services is StarterProjectImpl.java. The file is uploaded but I have noticed that __writeRegistryServiceInfo is never called by adding some logging in the method as seen. Why is it never called?

Code: Select all   Expand viewCollapse view
    public static boolean __writeRegistryServiceInfo( XRegistryKey xRegistryKey ) {
        boolean a=Factory.writeRegistryServiceInfo(m_implementationName,
                                                m_serviceNames,
                                                xRegistryKey);
        boolean b=Factory.writeRegistryServiceInfo(ProtocolHandlerImpl.class.getName(),
              ProtocolHandlerImpl.getServiceNames(),
                xRegistryKey);
        String x=ProtocolHandlerImpl.getServiceNames()[0]+" "+Boolean.toString(b);
        LOGGER.log(Level.SEVERE, x);
        return a && b;
    }

The other class which is responsible for the service "org.libreoffice.example.ProtocolHandler" is ProtocolHandlerImpl.java
The project is a modified StarterProject with use of the LOEclipse tools.

Re: Two services in two different classes

PostPosted: Sat Mar 06, 2021 4:09 pm
by DavidBo
Actually, I do get some logging if I manually install the *.oxt file instead of letting LOEclipse do it all.
Code: Select all   Expand viewCollapse view
<?xml version="1.0" encoding="windows-1252" standalone="no"?>
<!DOCTYPE log SYSTEM "logger.dtd">
<log>
<record>
  <date>2021-03-06T13:43:48.759766600Z</date>
  <millis>1615038228759</millis>
  <nanos>766600</nanos>
  <sequence>0</sequence>
  <logger>org.libreoffice.example.comp.StarterProjectImpl</logger>
  <level>SEVERE</level>
  <class>org.libreoffice.example.comp.StarterProjectImpl</class>
  <method>__writeRegistryServiceInfo</method>
  <thread>19</thread>
  <message>org.libreoffice.example.ProtocolHandler true</message>
</record>

But when I manual installs my oxt file I get this error message:
"No factory object for org.libreoffice.example.comp.ProtocolHandlerImpl"
why? I have now also uploaded my ProtocolHandlerImpl.java