Two services in two different classes

The Application Programming Interface and the OASIS Open Document Format

Two services in two different classes

Postby DavidBo » Sat Mar 06, 2021 1:11 pm

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.
Attachments
StarterProjectImpl.txt
Java file but type changed to txt because of this forums rules
(3.06 KiB) Downloaded 59 times
Apache Open Office 4.1.9 Windows 10
DavidBo
 
Posts: 27
Joined: Thu Mar 12, 2009 3:57 pm

Re: Two services in two different classes

Postby DavidBo » Sat Mar 06, 2021 4:09 pm

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
Attachments
ProtocolHandlerImpl.txt
java file
(5.65 KiB) Downloaded 52 times
Apache Open Office 4.1.9 Windows 10
DavidBo
 
Posts: 27
Joined: Thu Mar 12, 2009 3:57 pm


Return to UNO API and ODF

Who is online

Users browsing this forum: No registered users and 1 guest