Unable to load hook class for report-datasource example

Hi,

I’m trying to run the report-datasource example module but the module status indicates that it has faulted out.
The fault says "Unable to load hook class “com.inductiveautomation.ignition.examples.reporting.datasource.common.gateway.GatewayHook” for module “com.inductiveautomation.ignition.examples.report-datasource”.

Here is what the configuration file looks like:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <artifactId>report-datasource</artifactId>
        <groupId>com.inductiveautomation.ignition.examples</groupId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>

    <artifactId>report-datasource-build</artifactId>

    <dependencies>
        <dependency>
            <groupId>com.inductiveautomation.ignition.examples</groupId>
            <artifactId>report-datasource-designer</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.inductiveautomation.ignition.examples</groupId>
            <artifactId>report-datasource-gateway</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.inductiveautomation.ignition.examples</groupId>
            <artifactId>report-datasource-common</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.inductiveautomation.ignitionsdk</groupId>
                <artifactId>ignition-maven-plugin</artifactId>
                <version>1.1.0</version>

                <executions>
                    <execution>
                        <id>modl</id>
                        <phase>package</phase>
                        <goals>
                            <goal>modl</goal>
                        </goals>
                    </execution>
                </executions>

                <configuration>
                    <projectScopes>
                        <projectScope>
                            <name>report-datasource-common</name>
                            <scope>DG</scope>
                        </projectScope>
                        <projectScope>
                            <name>report-datasource-designer</name>
                            <scope>D</scope>
                        </projectScope>
                        <projectScope>
                            <name>report-datasource-gateway</name>
                            <scope>G</scope>
                        </projectScope>
                    </projectScopes>

                    <moduleId>com.inductiveautomation.ignition.examples.report-datasource</moduleId>
                    <moduleName>${module-name}</moduleName>
                    <moduleDescription>${module-description}</moduleDescription>
                    <moduleVersion>${project.version}</moduleVersion>
                    <requiredIgnitionVersion>${ignition-platform-version}</requiredIgnitionVersion>

                    <depends>
                        <depend>
                            <scope>G</scope>
                            <moduleId>rept</moduleId>
                        </depend>
                        <depend>
                            <scope>D</scope>
                            <moduleId>rept</moduleId>
                        </depend>
                    </depends>

                    <hooks>
                        <hook>
                            <scope>D</scope>
                            <hookClass>com.inductiveautomation.ignition.examples.reporting.datasource.designer.DesignerHook</hookClass>
                        </hook>
                        <hook>
                            <scope>G</scope>
                            <hookClass>com.inductiveautomation.ignition.examples.reporting.datasource.common.gateway.GatewayHook</hookClass>
                        </hook>
                    </hooks>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

I’d greatly appreciate any help in resolving this problem here. Thanks!

Please post the complete traceback for the fault.

Is this the information you were looking for?

com.inductiveautomation.ignition.common.modules.ModuleLoadException: Unable to load hook class "com.inductiveautomation.ignition.examples.reporting.datasource.common.gateway.GatewayHook" for module "com.inductiveautomation.ignition.examples.report-datasource".
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$LoadedModule.loadHook(ModuleManagerImpl.java:2362)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$LoadedModule.load(ModuleManagerImpl.java:2035)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.startupModule(ModuleManagerImpl.java:1221)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$4.call(ModuleManagerImpl.java:881)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.executeModuleOperation(ModuleManagerImpl.java:947)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.restartModuleInternal(ModuleManagerImpl.java:861)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.restartModule(ModuleManagerImpl.java:853)
	at com.inductiveautomation.ignition.gateway.web.pages.config.ModulePage$RestartAction.execute(ModulePage.java:575)
	at com.inductiveautomation.ignition.gateway.web.components.ConfirmationPanel$1.onClick(ConfirmationPanel.java:50)
	at org.apache.wicket.markup.html.link.Link.onLinkClicked(Link.java:190)
	at jdk.internal.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:258)
	at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:216)
	at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:240)
	at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:226)
	at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:830)
	at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
	at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:253)
	at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:210)
	at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:281)
	at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
	at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:245)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:590)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1607)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1297)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1577)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1212)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:322)
	at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:59)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:500)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: com/inductiveautomation/reporting/gateway/api/ReportDataSource
	at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
	at java.base/java.lang.Class.getConstructor0(Unknown Source)
	at java.base/java.lang.Class.getDeclaredConstructor(Unknown Source)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$LoadedModule.loadHook(ModuleManagerImpl.java:2335)
	... 59 more
Caused by: java.lang.ClassNotFoundException: com.inductiveautomation.reporting.gateway.api.ReportDataSource
	at java.base/java.net.URLClassLoader.findClass(Unknown Source)
	at com.inductiveautomation.ignition.gateway.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:37)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	at com.inductiveautomation.ignition.gateway.modules.ModuleClassLoader.loadClass(ModuleClassLoader.java:85)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	... 64 more

8.1.2 (b2021020311)
Azul Systems, Inc. 11.0.9

Ah, probably have to update the reporting module dependancy–the module name is no long “rept”.

2 Likes

Try com.inductiveautomation.reporting, instead of rept.

2 Likes

This worked and the module is running now. Thank you!