Hi Dan,

Just getting on to this now, thanks for the instructions, it works! :)

I don't have a solution but I can see, via a breakpoint at the following
line:

schemaAwareStoreManager.createSchemaForClasses(persistableClassNameSet,
asProperties(datanucleusProps));

in:

org.apache.isis.core.runtime.system.persistence.DataNucleusApplicationComponents#createSchema(...)

that the troublesome class is passed in for Schema creation in the
'persistableClassNameSet' param, however though its marked as
@PersistenceCapable its not a persisted class in the true sense as its
abstract with InheritanceStrategy.SUBCLASS_TABLE. So  I assume  DN then
gets confused as it cannot find a DB table to validate it against.

I'll work on this tomorrow to see if I can find out why this confusion
arises, but maybe off the top of your head you can see an issue. Should it
be in the set that gets passed into this call I wonder?

If that is wrong then the issue is upstream I suppose.

I am very close to a production system now, (learning all the way). Just
need to debug a few things that i have been putting off.

Cheers




On Mon, Dec 7, 2015 at 12:52 AM, Dan Haywood <[email protected]>
wrote:

> Hi Steve,
>
> You haven't said which IDE, and you haven't said how you are starting the
> app.
>
> For the IDE, I think I recall you use Eclipse, so presumably you are using
> the Eclipse DN enhancer plugin? [1]
>
> As to how you start the app, I presume you are using
> org.apache.isis.WebServer, which runs an embedded jetty.  These days we use
> an AppManifest, specified by the -m argument, eg per this screenshot [2].
> Hopefully you can adapt for Eclipse.
>
> With respect to the exception, I have two theories.
>
> 1. I suspect that the DN enhancer hasn't been run, or that the classes are
> getting recompiled and overwriting any enhancement that was done on the
> entity classes.  In 1.11.0-SNAPSHOT I've impemented ISIS-1245 [3] which
> will report on this and hopefully make this situation easier to debug.
>
> 2. the other time I've seen this happen is when we haven't located all the
> entities (annotated @PersistenceCapable) when we bootstrap and scan the
> classpath, and then later on DN gets confused because it tries to handle an
> entity that didn't know about.  I don't think you'd see exactly the error
> you are reporting, but in any case it's worth making sure that all the
> packages that your entities lived with are referenced by the packages that
> we scan (inferred from the packages of the classes returned by
> AppManifest#getModules(), subpackages automatically included).
>
> HTH
> Dan
>
>
>
>
> [1] http://isis.apache.org/guides/cg.html#_add_datanucleus_support
> [2] http://imgur.com/2OGqouu
> [3] https://issues.apache.org/jira/browse/ISIS-1245
>
>
>
> On 5 December 2015 at 07:21, Stephen Cameron <[email protected]>
> wrote:
>
> > Hi,
> >
> > I want to debug a problem related to security module but need to resolve
> > issues I've had to debug the simple way first, that is to run the
> > domainapp.webapp.DomainApplication class in the webapp project inside a
> > serverlet container. I've debugged by connecting to a running process in
> > the past, but that is a pain.
> >
> > At startup I get an error that I don't see normally using mvn jetty:run,
> > which is a datanucleus validation issue.
> >
> > The first error is
> > Caused by:
> > org.datanucleus.store.rdbms.exceptions.NoTableManagedException:
> Persistent
> > class "au.com.scds.chats.dom.module.general.names.ClassificationValue"
> has
> > no table in the database, but the operation requires it. Please check the
> > specification of the MetaData for this class.
> >
> > This is an simple abstract class, it is not logical here to have a table
> > for it, rather I want a table for each of subclasses. I don't really want
> > to change anything as I know it does work, so I'm wondering what is
> > different about this method of launching that might cause this error?
> >
> > @PersistenceCapable(identityType = IdentityType.APPLICATION)
> > @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
> > public abstract class ClassificationValue  {
> >
> >     public ClassificationValue(){}
> >
> >     public ClassificationValue(String name){
> >         this.name = name;
> >     }
> >
> >     private String name;
> >
> >     @PrimaryKey
> >     @Column(allowsNull="false")
> >     public String getName() {
> >         return name;
> >     }
> >
> >     public void setName(String name) {
> >         this.name = name;
> >     }
> >
> >     @Override
> >     public boolean equals(final Object obj) {
> >         if (obj == null) {
> >             return false;
> >         }
> >         if (obj == this) {
> >             return true;
> >         }
> >         if (!this.getClass().isInstance(obj)) {
> >             return false;
> >         }
> >         return ((ClassificationValue)
> > obj).getName().equals(this.getName());
> >     }
> >
> >     @Override
> >     public String toString() {
> >         return this.getClass().getSimpleName() + ":" + this.getName();
> >     }
> > }
> >
> >
> >
> >
> > The full stack-trace is as follows:
> >
> > 2015-12-05 17:56:23.003:WARN:oejw.WebAppContext:Failed startup of context
> >
> >
> o.e.j.w.WebAppContext{/,file:/D:/temp/isis-chats/webapp/src/main/webapp/},D:\temp\isis-chats\webapp\src\main\webapp
> > javax.servlet.ServletException: com.google.inject.ProvisionException:
> Guice
> > provision errors:<|<|1) Error in custom provider,
> > org.datanucleus.store.rdbms.exceptions.NoTableManagedException:
> Persistent
> > class "au.com.scds.chats.dom.module.general.names.ClassificationValue"
> has
> > no table in the database, but the operation requires it. Please check the
> > specification of the MetaData for this class.<|  at
> >
> >
> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:139)<|
> > at
> >
> >
> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:139)<|
> > while locating org.apache.isis.core.runtime.system.IsisSystem<|    for
> > field at
> >
> >
> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.system(IsisWicketApplication.java:151)<|
> > while locating domainapp.webapp.DomainApplication<|<|1 error
> >     at
> > org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:453)
> >     at
> > org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:351)
> >     at
> > org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:118)
> >     at
> >
> >
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
> >     at
> >
> >
> org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:768)
> >     at
> >
> >
> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
> >     at
> >
> >
> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
> >     at
> >
> >
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
> >     at
> > org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
> >     at
> >
> >
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
> >     at
> >
> >
> org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
> >     at org.eclipse.jetty.server.Server.doStart(Server.java:282)
> >     at
> >
> >
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
> >     at
> >
> >
> net.sourceforge.eclipsejetty.starter.embedded.JettyEmbeddedAdapter.start(JettyEmbeddedAdapter.java:67)
> >     at
> >
> >
> net.sourceforge.eclipsejetty.starter.common.AbstractJettyLauncherMain.launch(AbstractJettyLauncherMain.java:84)
> >     at
> >
> >
> net.sourceforge.eclipsejetty.starter.embedded.JettyEmbeddedLauncherMain.main(JettyEmbeddedLauncherMain.java:42)
> > Caused by:
> > com.google.inject.ProvisionException: Guice provision errors:<|<|1) Error
> > in custom provider,
> > org.datanucleus.store.rdbms.exceptions.NoTableManagedException:
> Persistent
> > class "au.com.scds.chats.dom.module.general.names.ClassificationValue"
> has
> > no table in the database, but the operation requires it. Please check the
> > specification of the MetaData for this class.<|  at
> >
> >
> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:139)<|
> > at
> >
> >
> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:139)<|
> > while locating org.apache.isis.core.runtime.system.IsisSystem<|    for
> > field at
> >
> >
> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.system(IsisWicketApplication.java:151)<|
> > while locating domainapp.webapp.DomainApplication<|<|1 error
> >     at
> >
> >
> com.google.inject.internal.Errors.throwProvisionExceptionIfErrorsExist(Errors.java:451)
> >     at
> >
> >
> com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:65)
> >     at
> >
> >
> com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:944)
> >     at
> >
> >
> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:265)
> >     at domainapp.webapp.DomainApplication.init(DomainApplication.java:64)
> >     at
> org.apache.wicket.Application.initApplication(Application.java:823)
> >     at
> > org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:427)
> >     at
> > org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:351)
> >     at
> > org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:118)
> >     at
> >
> >
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
> >     at
> >
> >
> org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:768)
> >     at
> >
> >
> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
> >     at
> >
> >
> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
> >     at
> >
> >
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
> >     at
> > org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
> >     at
> >
> >
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
> >     at
> >
> >
> org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
> >     at org.eclipse.jetty.server.Server.doStart(Server.java:282)
> >     at
> >
> >
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
> >     at
> >
> >
> net.sourceforge.eclipsejetty.starter.embedded.JettyEmbeddedAdapter.start(JettyEmbeddedAdapter.java:67)
> >     at
> >
> >
> net.sourceforge.eclipsejetty.starter.common.AbstractJettyLauncherMain.launch(AbstractJettyLauncherMain.java:84)
> >     at
> >
> >
> net.sourceforge.eclipsejetty.starter.embedded.JettyEmbeddedLauncherMain.main(JettyEmbeddedLauncherMain.java:42)
> > Caused by:
> > org.datanucleus.store.rdbms.exceptions.NoTableManagedException:
> Persistent
> > class "au.com.scds.chats.dom.module.general.names.ClassificationValue"
> has
> > no table in the database, but the operation requires it. Please check the
> > specification of the MetaData for this class.
> >     at
> >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager.getDatastoreClass(RDBMSStoreManager.java:698)
> >     at
> >
> >
> org.datanucleus.store.rdbms.table.ClassTable.initializePK(ClassTable.java:1003)
> >     at
> >
> >
> org.datanucleus.store.rdbms.table.ClassTable.preInitialize(ClassTable.java:250)
> >     at
> >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTable(RDBMSStoreManager.java:3194)
> >     at
> >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTables(RDBMSStoreManager.java:2993)
> >     at
> >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2872)
> >     at
> >
> >
> org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:119)
> >     at
> >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager.createSchemaForClasses(RDBMSStoreManager.java:3842)
> >     at
> >
> >
> org.apache.isis.core.runtime.system.persistence.DataNucleusApplicationComponents.createSchema(DataNucleusApplicationComponents.java:191)
> >     at
> >
> >
> org.apache.isis.core.runtime.system.persistence.DataNucleusApplicationComponents.createPmfAndSchemaIfRequired(DataNucleusApplicationComponents.java:150)
> >     at
> >
> >
> org.apache.isis.core.runtime.system.persistence.DataNucleusApplicationComponents.initialize(DataNucleusApplicationComponents.java:105)
> >     at
> >
> >
> org.apache.isis.core.runtime.system.persistence.DataNucleusApplicationComponents.<init>(DataNucleusApplicationComponents.java:98)
> >     at
> >
> >
> org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory.createDataNucleusApplicationComponents(PersistenceSessionFactory.java:92)
> >     at
> >
> >
> org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory.init(PersistenceSessionFactory.java:73)
> >     at
> > org.apache.isis.core.runtime.system.IsisSystem.init(IsisSystem.java:203)
> >     at
> >
> >
> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:140)
> >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >     at
> >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> >     at
> >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >     at java.lang.reflect.Method.invoke(Method.java:601)
> >     at
> > com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:104)
> >     at
> >
> >
> com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
> >     at
> >
> >
> com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
> >     at
> >
> >
> com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
> >     at
> >
> >
> com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
> >     at com.google.inject.Scopes$1$1.get(Scopes.java:65)
> >     at
> >
> >
> com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
> >     at
> >
> >
> com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
> >     at
> >
> >
> com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
> >     at
> >
> >
> com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:75)
> >     at
> >
> >
> com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:73)
> >     at
> >
> >
> com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
> >     at
> >
> >
> com.google.inject.internal.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:73)
> >     at
> >
> >
> com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:60)
> >     at
> >
> >
> com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:944)
> >     at
> >
> >
> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:265)
> >     at domainapp.webapp.DomainApplication.init(DomainApplication.java:64)
> >     at
> org.apache.wicket.Application.initApplication(Application.java:823)
> >     at
> > org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:427)
> >     at
> > org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:351)
> >     at
> > org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:118)
> >     at
> >
> >
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
> >     at
> >
> >
> org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:768)
> >     at
> >
> >
> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
> >     at
> >
> >
> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
> >     at
> >
> >
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
> >     at
> > org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
> >     at
> >
> >
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
> >     at
> >
> >
> org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
> >     at org.eclipse.jetty.server.Server.doStart(Server.java:282)
> >     at
> >
> >
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
> >     at
> >
> >
> net.sourceforge.eclipsejetty.starter.embedded.JettyEmbeddedAdapter.start(JettyEmbeddedAdapter.java:67)
> >     at
> >
> >
> net.sourceforge.eclipsejetty.starter.common.AbstractJettyLauncherMain.launch(AbstractJettyLauncherMain.java:84)
> >     at
> >
> >
> net.sourceforge.eclipsejetty.starter.embedded.JettyEmbeddedLauncherMain.main(JettyEmbeddedLauncherMain.java:42)
> > 2015-12-05 17:56:23.071:INFO:oejs.AbstractConnector:Started
> > [email protected]:8080
> > -------------------------------------------------
> >
>

Reply via email to