org.apache.wicket.WicketRuntimeException: Can’t instantiate page using constructor ‘public com.inductiveautomation.ignition.gateway.web.pages.Config(org.apache.wicket.request.mapper.parameter.PageParameters)’ and argument ‘path=[DAS.DAS]’. Might be it doesn’t exist, may be it is not visible (public).
Can you tell us which config page is doing this? Copying the URL (omitting your gateway’s IP address) would do the trick. Thanks!
Is this related to the custom module you’re working on?
yes. it is related to the custom module. I think the problem has to do with the resourcebundle that passes the panel information. I am just a bit lost on that. I followed the example but it is still giving errors. thank you
its a custom module. I am trying to create a settings panel on the config page. thank you
Can you post your code/your config page in particular?
package com.bestpack.records;
import com.inductiveautomation.ignition.gateway.localdb.persistence.PersistentRecord;
import com.inductiveautomation.ignition.gateway.localdb.persistence.RecordMeta;
import com.inductiveautomation.ignition.gateway.localdb.persistence.StringField;
import simpleorm.dataset.SFieldFlags;
public class DASSettingsRecord extends PersistentRecord {
public static final RecordMeta<DASSettingsRecord> META = new RecordMeta<DASSettingsRecord>(
DASSettingsRecord.class, "DASSettingsRecord").setNounKey("DASSettingsRecord.Noun").setNounPluralKey(
"DASSettingsRecord.Noun.Plural");
public static final StringField HCIPAddress = new StringField(META, "IPAddress", SFieldFlags.SMANDATORY);
public void setHCIPAddress(String ip){
setString(HCIPAddress, ip);
}
public String getHCIPAddress() {
return getString(HCIPAddress);
}
@Override
public RecordMeta<?> getMeta() {
return META;
}
}
package com.bestpack.web;
import com.bestpack.GatewayHook;
import com.bestpack.records.DASSettingsRecord;
import com.inductiveautomation.ignition.gateway.model.IgnitionWebApp;
import com.inductiveautomation.ignition.gateway.web.components.RecordEditForm;
import com.inductiveautomation.ignition.gateway.web.models.LenientResourceModel;
import com.inductiveautomation.ignition.gateway.web.pages.IConfigPage;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.wicket.Application;
public class DASSettingsPage extends RecordEditForm {
public static final Pair<String, String> MENU_LOCATION =
Pair.of(GatewayHook.CONFIG_CATEGORY.getName(), "DAS");
public DASSettingsPage(final IConfigPage configPage) {
super(configPage, null, new LenientResourceModel("DAS.nav.settings.panelTitle"),
((IgnitionWebApp) Application.get()).getContext().getPersistenceInterface().find(DASSettingsRecord.META, 0L)
);
}
@Override
public Pair<String, String> getMenuLocation() {
return MENU_LOCATION;
}
}
DASSettingsRecord.properties
Noun=DAS Setting
Noun.Plural=DAS Settings
IPAddress.Name=IP Address of Machine
DAS.properties
nav.header=DAS
nav.settings.title=Settings
nav.settings.panelTitle=DAS Settings
nav.connections.title=Connections
nav.status.header=DAS
org.apache.wicket.WicketRuntimeException: Can’t instantiate page using constructor ‘public com.inductiveautomation.ignition.gateway.web.pages.Config(org.apache.wicket.request.mapper.parameter.PageParameters)’ and argument ‘path=[DAS.DAS]’. Might be it doesn’t exist, may be it is not visible (public).
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:193)
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:98)
at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:137)
at org.apache.wicket.core.request.handler.PageProvider.resolvePageInstance(PageProvider.java:278)
at org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:166)
at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:94)
at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:244)
at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:165)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:814)
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.HandlerList.handle(HandlerList.java:59)
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.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:170)
… 52 common frames omitted
Caused by: java.lang.RuntimeException: Unable to create config panel DAS.DAS
at com.inductiveautomation.ignition.gateway.web.models.DefaultConfigTab.getPanel(DefaultConfigTab.java:99)
at com.inductiveautomation.ignition.gateway.web.pages.Config.(Config.java:112)
… 57 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.inductiveautomation.ignition.gateway.web.models.DefaultConfigTab.getPanel(DefaultConfigTab.java:91)
… 58 common frames omitted
Caused by: simpleorm.utils.SException$Error: Too many key params 1 < {0}.length
at simpleorm.dataset.SRecordInstance.setPrimaryKeys(SRecordInstance.java:922)
at simpleorm.dataset.SDataSet.finder(SDataSet.java:83)
at simpleorm.dataset.SDataSet.findOrCreate(SDataSet.java:66)
at simpleorm.sessionjdbc.SSessionJdbcHelper.doFindOrCreate(SSessionJdbcHelper.java:45)
at simpleorm.sessionjdbc.SSessionJdbc.find(SSessionJdbc.java:598)
at com.inductiveautomation.ignition.gateway.localdb.PersistenceInterfaceImpl.find(PersistenceInterfaceImpl.java:125)
at com.inductiveautomation.ignition.gateway.localdb.PersistenceInterfaceImpl.find(PersistenceInterfaceImpl.java:116)
at com.bestpack.web.DASSettingsPage.(DASSettingsPage.java:18)
You're trying to retrieve a record by ID 0:
((IgnitionWebApp) Application.get()).getContext().getPersistenceInterface().find(DASSettingsRecord.META, 0L)
but your PersistentRecord
doesn't have an ID. Add an IdentityField
field to the DASSettingsRecord
.
yes. that fixed it. thank you so much!!