web-dev-qa-db-ja.com

Hibernate:エンティティ内部クラスのデフォルトコンストラクターはありません

同様の質問がたくさんあることは承知していますが、これについては誰も助けてくれませんでした。

私はTynamoと呼ばれるCRUDフレームワークを使用しています。これは、ApacheTapestryとHibernateに依存しています。コンポジット/コンパウンド主キーを持つテーブルでCRUDに使用しようとする場合を除いて、これはすべて正常に機能します。

フレームワークではまったく機能しないようであるため、@EmbeddedIdルートを使用しないことにしました。そうは言っても、私は@IdClassメソッドを使用してきましたが、これはほとんど機能しています。私は成功から1、2行のコードだと思います。

問題は、リフレクションを使用してオブジェクトを構築し始めると、その内部クラスのパブリックな空のコンストラクターが実際に存在するにもかかわらず、爆発してorg.hibernate.InstantiationException: No default constructor for entity: ...と言うことです。

回答するときは、コードスニペットを避け、完全なクラスなどを使用して、このスレッドにアクセスする他のユーザーが何が起こっているのかをより完全に把握できるようにしてください。

あなたは私のクラスを以下に見ることができます:

package com.company.crud.entities;

import Java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;

import com.company.crud.entities.TransferExtension.TransferExtensionPK;

@Entity(name = "Transfer_Extensions")
@IdClass(TransferExtensionPK.class)
public class TransferExtension implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    // @NotNull(message = "Please supply a Script Code")
    // @Length(min = 3, max = 4)
    @Column(name = "Division", nullable = false)
    private String scriptCode;

    @Id
    // @NotNull(message = "Please supply a Transfer Type")
    // @Length(min = 3, max = 6)
    @Column(name = "Transfer_Type", nullable = false)
    private String transferType;

    @Column(name = "Extension", nullable = true)
    private String englishExtension;

    @Column(name = "Span_Extension", nullable = true)
    private String spanishExtension;

    @Column(name = "Call_Type", nullable = true)
    private String callType;

    @Column(name = "Call_Center", nullable = true)
    private String callCenter;

    public TransferExtension() {
    }

    public TransferExtension(String scriptCode, String transferType,
            String englishExtension, String spanishExtension, String callType,
            String callCenter) {

        this.callCenter = callCenter;
        this.callType = callType;
        this.englishExtension = englishExtension;
        this.scriptCode = scriptCode;
        this.spanishExtension = spanishExtension;
        this.transferType = transferType;
    }

    public String getScriptCode() {
        return this.scriptCode;
    }

    public void setScriptCode(String scriptCode) {
        this.scriptCode = scriptCode;
    }

    public String getTransferType() {
        return this.transferType;
    }

    public void setTransferType(String transferType) {
        this.transferType = transferType;
    }

    public String getEnglishExtension() {
        return this.englishExtension;
    }

    public void setEnglishExtension(String englishExtension) {
        this.englishExtension = englishExtension;
    }

    public String getSpanishExtension() {
        return this.spanishExtension;
    }

    public void setSpanishExtension(String spanishExtension) {
        this.spanishExtension = spanishExtension;
    }

    public String getCallType() {
        return this.callType;
    }

    public void setCallType(String callType) {
        this.callType = callType;
    }

    public String getCallCenter() {
        return this.callCenter;
    }

    public void setCallCenter(String callCenter) {
        this.callCenter = callCenter;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("TransferExtension [scriptCode=")
                .append(this.scriptCode).append(", transferType=")
                .append(this.transferType).append(", englishExtension=")
                .append(this.englishExtension).append(", spanishExtension=")
                .append(this.spanishExtension).append(", callType=")
                .append(this.callType).append(", callCenter=")
                .append(this.callCenter).append("]");
        return builder.toString();
    }

    public class TransferExtensionPK implements Serializable {
        private static final long serialVersionUID = 4L;

        private String scriptCode;
        private String transferType;

        public TransferExtensionPK() {
        }

        public TransferExtensionPK(String scriptCode, String transferType) {

            this.scriptCode = scriptCode;
            this.transferType = transferType;
        }

        public String getScriptCode() {
            return this.scriptCode;
        }

        public void setScriptCode(String scriptCode) {
            this.scriptCode = scriptCode;
        }

        public String getTransferType() {
            return this.transferType;
        }

        public void setTransferType(String transferType) {
            this.transferType = transferType;
        }

        @Override
        public String toString() {
            StringBuilder builder = new StringBuilder();
            builder.append("TransferExtensionPK [scriptCode=")
                    .append(this.scriptCode).append(", transferType=")
                    .append(this.transferType).append("]");
            return builder.toString();
        }

        @Override
        public int hashCode() {
            final int prime = 31;
            int result = 1;
            result = prime * result + getOuterType().hashCode();
            result = prime
                    * result
                    + ((this.scriptCode == null) ? 0 : this.scriptCode
                            .hashCode());
            result = prime
                    * result
                    + ((this.transferType == null) ? 0 : this.transferType
                            .hashCode());
            return result;
        }

        @Override
        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (obj == null) {
                return false;
            }
            if (!(obj instanceof TransferExtensionPK)) {
                return false;
            }
            TransferExtensionPK other = (TransferExtensionPK) obj;
            if (!getOuterType().equals(other.getOuterType())) {
                return false;
            }
            if (this.scriptCode == null) {
                if (other.scriptCode != null) {
                    return false;
                }
            } else if (!this.scriptCode.equals(other.scriptCode)) {
                return false;
            }
            if (this.transferType == null) {
                if (other.transferType != null) {
                    return false;
                }
            } else if (!this.transferType.equals(other.transferType)) {
                return false;
            }
            return true;
        }

        private TransferExtension getOuterType() {
            return TransferExtension.this;
        }
    }
}

スタックトレース:

Hibernate: 
    select
        count(*) as y0_ 
    from
        Transfer_Extensions this_
Hibernate: 
    select
        top 25 this_.Division as Division1_0_,
        this_.Transfer_Type as Transfer2_1_0_,
        this_.Call_Center as Call3_1_0_,
        this_.Call_Type as Call4_1_0_,
        this_.Extension as Extension1_0_,
        this_.Span_Extension as Span6_1_0_ 
    from
        Transfer_Extensions this_
[ERROR] pages.List Render queue error in SetupRender[List:grid]: No default constructor for entity: com.company.crud.entities.TransferExtension$TransferExtensionPK
org.Apache.tapestry5.ioc.internal.util.TapestryException: No default constructor for entity: com.company.crud.entities.TransferExtension$TransferExtensionPK [at context:List.tml, line 12]
    at org.Apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.Java:158)
    at org.Apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.render(ComponentPageElementImpl.Java:186)
    at org.Apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.Java:72)
    at org.Apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.Java:124)
    at $PageRenderQueue_f31f9af2bde.render(Unknown Source)
    at $PageRenderQueue_f31f9af2bdd.render(Unknown Source)
    at org.Apache.tapestry5.internal.services.MarkupRendererTerminator.renderMarkup(MarkupRendererTerminator.Java:37)
    at org.Apache.tapestry5.services.TapestryModule$31.renderMarkup(TapestryModule.Java:1994)
    at $MarkupRenderer_f31f9af2be1.renderMarkup(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$30.renderMarkup(TapestryModule.Java:1978)
    at $MarkupRenderer_f31f9af2be1.renderMarkup(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.Java:1960)
    at $MarkupRenderer_f31f9af2be1.renderMarkup(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.Java:1945)
    at $MarkupRenderer_f31f9af2be1.renderMarkup(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.Java:1931)
    at $MarkupRenderer_f31f9af2be1.renderMarkup(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.Java:1913)
    at $MarkupRenderer_f31f9af2be1.renderMarkup(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.Java:1894)
    at $MarkupRenderer_f31f9af2be1.renderMarkup(Unknown Source)
    at $MarkupRenderer_f31f9af2bdc.renderMarkup(Unknown Source)
    at org.Apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.Java:47)
    at $PageMarkupRenderer_f31f9af2bd5.renderPageMarkup(Unknown Source)
    at org.Apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.Java:67)
    at $PageResponseRenderer_f31f9af2bd7.advised$renderPageResponse_f31f9af2bd9(Unknown Source)
    at $PageResponseRenderer_f31f9af2bd7$Invocation_renderPageResponse_f31f9af2bd8.proceedToAdvisedMethod(Unknown Source)
    at org.Apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.Java:84)
    at org.tynamo.services.TynamoCoreModule$2.advise(TynamoCoreModule.Java:353)
    at org.Apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.Java:86)
    at $PageResponseRenderer_f31f9af2bd7.renderPageResponse(Unknown Source)
    at $PageResponseRenderer_f31f9af2bd0.renderPageResponse(Unknown Source)
    at org.Apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.Java:64)
    at org.Apache.tapestry5.services.TapestryModule$38.handle(TapestryModule.Java:2222)
    at $PageRenderRequestHandler_f31f9af2bd2.handle(Unknown Source)
    at $PageRenderRequestHandler_f31f9af2bcd.handle(Unknown Source)
    at org.Apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handlePageRender(ComponentRequestHandlerTerminator.Java:48)
    at org.Apache.tapestry5.services.InitializeActivePageName.handlePageRender(InitializeActivePageName.Java:47)
    at $ComponentRequestHandler_f31f9af2bce.handlePageRender(Unknown Source)
    at $ComponentRequestHandler_f31f9af2ac7.handlePageRender(Unknown Source)
    at org.tynamo.routing.services.RouterDispatcher.dispatch(RouterDispatcher.Java:26)
    at $Dispatcher_f31f9af2acb.dispatch(Unknown Source)
    at $Dispatcher_f31f9af2ac4.dispatch(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.Java:302)
    at org.Apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.Java:26)
    at $RequestHandler_f31f9af2ac5.service(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$3.service(TapestryModule.Java:902)
    at $RequestHandler_f31f9af2ac5.service(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$2.service(TapestryModule.Java:892)
    at $RequestHandler_f31f9af2ac5.service(Unknown Source)
    at org.Apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.Java:90)
    at $RequestHandler_f31f9af2ac5.service(Unknown Source)
    at org.Apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.Java:105)
    at org.Apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.Java:95)
    at org.Apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.Java:85)
    at org.Apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.Java:119)
    at $RequestHandler_f31f9af2ac5.service(Unknown Source)
    at $RequestHandler_f31f9af2ab9.service(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.Java:253)
    at org.Apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.Java:53)
    at $HttpServletRequestHandler_f31f9af2abb.service(Unknown Source)
    at org.Apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.Java:44)
    at $HttpServletRequestHandler_f31f9af2abb.service(Unknown Source)
    at org.Apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.Java:62)
    at $HttpServletRequestFilter_f31f9af2ab7.service(Unknown Source)
    at $HttpServletRequestHandler_f31f9af2abb.service(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$1.service(TapestryModule.Java:852)
    at $HttpServletRequestHandler_f31f9af2abb.service(Unknown Source)
    at $HttpServletRequestHandler_f31f9af2ab5.service(Unknown Source)
    at org.Apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.Java:171)
    at org.Eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.Java:1476)
    at org.Eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.Java:501)
    at org.Eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.Java:137)
    at org.Eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.Java:557)
    at org.Eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.Java:231)
    at org.Eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.Java:1086)
    at org.Eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.Java:429)
    at org.Eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.Java:193)
    at org.Eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.Java:1020)
    at org.Eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.Java:135)
    at org.Eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.Java:255)
    at org.Eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.Java:154)
    at org.Eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.Java:116)
    at org.Eclipse.jetty.server.Server.handle(Server.Java:370)
    at org.Eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.Java:494)
    at org.Eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.Java:971)
    at org.Eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.Java:1033)
    at org.Eclipse.jetty.http.HttpParser.parseNext(HttpParser.Java:644)
    at org.Eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.Java:235)
    at org.Eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.Java:82)
    at org.Eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.Java:696)
    at org.Eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.Java:53)
    at org.Eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.Java:608)
    at org.Eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.Java:543)
    at Java.lang.Thread.run(Thread.Java:744)
Caused by: org.hibernate.InstantiationException: No default constructor for entity: com.company.crud.entities.TransferExtension$TransferExtensionPK
    at org.hibernate.Tuple.PojoInstantiator.instantiate(PojoInstantiator.Java:107)
    at org.hibernate.Tuple.component.AbstractComponentTuplizer.instantiate(AbstractComponentTuplizer.Java:102)
    at org.hibernate.type.ComponentType.instantiate(ComponentType.Java:511)
    at org.hibernate.type.ComponentType.instantiate(ComponentType.Java:517)
    at org.hibernate.type.EmbeddedComponentType.instantiate(EmbeddedComponentType.Java:59)
    at org.hibernate.type.ComponentType.resolve(ComponentType.Java:609)
    at org.hibernate.loader.Loader.extractKeysFromResultSet(Loader.Java:722)
    at org.hibernate.loader.Loader.getRowFromResultSet(Loader.Java:606)
    at org.hibernate.loader.Loader.doQuery(Loader.Java:829)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.Java:274)
    at org.hibernate.loader.Loader.doList(Loader.Java:2533)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.Java:2276)
    at org.hibernate.loader.Loader.list(Loader.Java:2271)
    at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.Java:119)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.Java:1716)
    at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.Java:347)
    at org.tynamo.hibernate.services.HibernatePersistenceServiceImpl.getInstances(HibernatePersistenceServiceImpl.Java:349)
    at org.tynamo.hibernate.services.HibernatePersistenceServiceImpl.getInstances(HibernatePersistenceServiceImpl.Java:333)
    at org.tynamo.hibernate.services.HibernatePersistenceServiceImpl.getInstances(HibernatePersistenceServiceImpl.Java:172)
    at $HibernatePersistenceService_f31f9af2bf1.getInstances(Unknown Source)
    at $HibernatePersistenceService_f31f9af2b41.getInstances(Unknown Source)
    at org.tynamo.TynamoGridDataSource.prepare(TynamoGridDataSource.Java:58)
    at org.Apache.tapestry5.corelib.components.Grid$CachingDataSource.prepare(Grid.Java:313)
    at org.Apache.tapestry5.corelib.components.Grid.setupDataSource(Grid.Java:483)
    at org.Apache.tapestry5.corelib.components.Grid.setupRender(Grid.Java:447)
    at org.Apache.tapestry5.corelib.components.Grid.setupRender(Grid.Java)
    at org.Apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.invokeComponent(ComponentPageElementImpl.Java:179)
    at org.Apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.Java:148)
    ... 94 more
[INFO] InternalModule.PageResponseRenderer discarding all List page persistent field changes due to a RenderQueueException
[ERROR] TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Render queue error in SetupRender[List:grid]: No default constructor for entity: com.company.crud.entities.TransferExtension$TransferExtensionPK
org.Apache.tapestry5.internal.services.RenderQueueException: Render queue error in SetupRender[List:grid]: No default constructor for entity: com.company.crud.entities.TransferExtension$TransferExtensionPK [at context:List.tml, line 12]
    at org.Apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.Java:81)
    at org.Apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.Java:124)
    at $PageRenderQueue_f31f9af2bde.render(Unknown Source)
    at $PageRenderQueue_f31f9af2bdd.render(Unknown Source)
    at org.Apache.tapestry5.internal.services.MarkupRendererTerminator.renderMarkup(MarkupRendererTerminator.Java:37)
    at org.Apache.tapestry5.services.TapestryModule$31.renderMarkup(TapestryModule.Java:1994)
    at $MarkupRenderer_f31f9af2be1.renderMarkup(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$30.renderMarkup(TapestryModule.Java:1978)
    at $MarkupRenderer_f31f9af2be1.renderMarkup(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.Java:1960)
    at $MarkupRenderer_f31f9af2be1.renderMarkup(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.Java:1945)
    at $MarkupRenderer_f31f9af2be1.renderMarkup(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.Java:1931)
    at $MarkupRenderer_f31f9af2be1.renderMarkup(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.Java:1913)
    at $MarkupRenderer_f31f9af2be1.renderMarkup(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.Java:1894)
    at $MarkupRenderer_f31f9af2be1.renderMarkup(Unknown Source)
    at $MarkupRenderer_f31f9af2bdc.renderMarkup(Unknown Source)
    at org.Apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.Java:47)
    at $PageMarkupRenderer_f31f9af2bd5.renderPageMarkup(Unknown Source)
    at org.Apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.Java:67)
    at $PageResponseRenderer_f31f9af2bd7.advised$renderPageResponse_f31f9af2bd9(Unknown Source)
    at $PageResponseRenderer_f31f9af2bd7$Invocation_renderPageResponse_f31f9af2bd8.proceedToAdvisedMethod(Unknown Source)
    at org.Apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.Java:84)
    at org.tynamo.services.TynamoCoreModule$2.advise(TynamoCoreModule.Java:353)
    at org.Apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.Java:86)
    at $PageResponseRenderer_f31f9af2bd7.renderPageResponse(Unknown Source)
    at $PageResponseRenderer_f31f9af2bd0.renderPageResponse(Unknown Source)
    at org.Apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.Java:64)
    at org.Apache.tapestry5.services.TapestryModule$38.handle(TapestryModule.Java:2222)
    at $PageRenderRequestHandler_f31f9af2bd2.handle(Unknown Source)
    at $PageRenderRequestHandler_f31f9af2bcd.handle(Unknown Source)
    at org.Apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handlePageRender(ComponentRequestHandlerTerminator.Java:48)
    at org.Apache.tapestry5.services.InitializeActivePageName.handlePageRender(InitializeActivePageName.Java:47)
    at $ComponentRequestHandler_f31f9af2bce.handlePageRender(Unknown Source)
    at $ComponentRequestHandler_f31f9af2ac7.handlePageRender(Unknown Source)
    at org.tynamo.routing.services.RouterDispatcher.dispatch(RouterDispatcher.Java:26)
    at $Dispatcher_f31f9af2acb.dispatch(Unknown Source)
    at $Dispatcher_f31f9af2ac4.dispatch(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.Java:302)
    at org.Apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.Java:26)
    at $RequestHandler_f31f9af2ac5.service(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$3.service(TapestryModule.Java:902)
    at $RequestHandler_f31f9af2ac5.service(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$2.service(TapestryModule.Java:892)
    at $RequestHandler_f31f9af2ac5.service(Unknown Source)
    at org.Apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.Java:90)
    at $RequestHandler_f31f9af2ac5.service(Unknown Source)
    at org.Apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.Java:105)
    at org.Apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.Java:95)
    at org.Apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.Java:85)
    at org.Apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.Java:119)
    at $RequestHandler_f31f9af2ac5.service(Unknown Source)
    at $RequestHandler_f31f9af2ab9.service(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.Java:253)
    at org.Apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.Java:53)
    at $HttpServletRequestHandler_f31f9af2abb.service(Unknown Source)
    at org.Apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.Java:44)
    at $HttpServletRequestHandler_f31f9af2abb.service(Unknown Source)
    at org.Apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.Java:62)
    at $HttpServletRequestFilter_f31f9af2ab7.service(Unknown Source)
    at $HttpServletRequestHandler_f31f9af2abb.service(Unknown Source)
    at org.Apache.tapestry5.services.TapestryModule$1.service(TapestryModule.Java:852)
    at $HttpServletRequestHandler_f31f9af2abb.service(Unknown Source)
    at $HttpServletRequestHandler_f31f9af2ab5.service(Unknown Source)
    at org.Apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.Java:171)
    at org.Eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.Java:1476)
    at org.Eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.Java:501)
    at org.Eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.Java:137)
    at org.Eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.Java:557)
    at org.Eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.Java:231)
    at org.Eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.Java:1086)
    at org.Eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.Java:429)
    at org.Eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.Java:193)
    at org.Eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.Java:1020)
    at org.Eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.Java:135)
    at org.Eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.Java:255)
    at org.Eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.Java:154)
    at org.Eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.Java:116)
    at org.Eclipse.jetty.server.Server.handle(Server.Java:370)
    at org.Eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.Java:494)
    at org.Eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.Java:971)
    at org.Eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.Java:1033)
    at org.Eclipse.jetty.http.HttpParser.parseNext(HttpParser.Java:644)
    at org.Eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.Java:235)
    at org.Eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.Java:82)
    at org.Eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.Java:696)
    at org.Eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.Java:53)
    at org.Eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.Java:608)
    at org.Eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.Java:543)
    at Java.lang.Thread.run(Thread.Java:744)
Caused by: org.Apache.tapestry5.ioc.internal.util.TapestryException: No default constructor for entity: com.company.crud.entities.TransferExtension$TransferExtensionPK [at context:List.tml, line 12]
    at org.Apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.Java:158)
    at org.Apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.render(ComponentPageElementImpl.Java:186)
    at org.Apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.Java:72)
    ... 92 more
Caused by: org.hibernate.InstantiationException: No default constructor for entity: com.company.crud.entities.TransferExtension$TransferExtensionPK
    at org.hibernate.Tuple.PojoInstantiator.instantiate(PojoInstantiator.Java:107)
    at org.hibernate.Tuple.component.AbstractComponentTuplizer.instantiate(AbstractComponentTuplizer.Java:102)
    at org.hibernate.type.ComponentType.instantiate(ComponentType.Java:511)
    at org.hibernate.type.ComponentType.instantiate(ComponentType.Java:517)
    at org.hibernate.type.EmbeddedComponentType.instantiate(EmbeddedComponentType.Java:59)
    at org.hibernate.type.ComponentType.resolve(ComponentType.Java:609)
    at org.hibernate.loader.Loader.extractKeysFromResultSet(Loader.Java:722)
    at org.hibernate.loader.Loader.getRowFromResultSet(Loader.Java:606)
    at org.hibernate.loader.Loader.doQuery(Loader.Java:829)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.Java:274)
    at org.hibernate.loader.Loader.doList(Loader.Java:2533)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.Java:2276)
    at org.hibernate.loader.Loader.list(Loader.Java:2271)
    at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.Java:119)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.Java:1716)
    at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.Java:347)
    at org.tynamo.hibernate.services.HibernatePersistenceServiceImpl.getInstances(HibernatePersistenceServiceImpl.Java:349)
    at org.tynamo.hibernate.services.HibernatePersistenceServiceImpl.getInstances(HibernatePersistenceServiceImpl.Java:333)
    at org.tynamo.hibernate.services.HibernatePersistenceServiceImpl.getInstances(HibernatePersistenceServiceImpl.Java:172)
    at $HibernatePersistenceService_f31f9af2bf1.getInstances(Unknown Source)
    at $HibernatePersistenceService_f31f9af2b41.getInstances(Unknown Source)
    at org.tynamo.TynamoGridDataSource.prepare(TynamoGridDataSource.Java:58)
    at org.Apache.tapestry5.corelib.components.Grid$CachingDataSource.prepare(Grid.Java:313)
    at org.Apache.tapestry5.corelib.components.Grid.setupDataSource(Grid.Java:483)
    at org.Apache.tapestry5.corelib.components.Grid.setupRender(Grid.Java:447)
    at org.Apache.tapestry5.corelib.components.Grid.setupRender(Grid.Java)
    at org.Apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.invokeComponent(ComponentPageElementImpl.Java:179)
    at org.Apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.Java:148)
    ... 94 more
12
liltitus27

裏では、TransferExtensionPKは内部クラスであるため、実際にはデフォルトのコンストラクターはありません。内部クラスを構築するには、外部クラスのインスタンスが必要であるため、コンパイラーは、パラメーターなしのコンストラクターを、TransferExtensionのインスタンスを受け入れる1パラメーターのコンストラクターに変換しました。

この問題を修正するには、TransferExtensionPKを内部クラスではなく、単にネストされたクラス(静的)にします。

public static class TransferExtensionPK // etc
19
gknicker