2017-05-20 4 views
1

マグノリア5.5.4用の非JCRカスタムコンテンツアプリで作業しています。sqlcontainer contentContainerを持つカスタム非JCRマグノリアコンテンツアプリ、ContentConnectorまたはEventBusをアクション定義に挿入できません

私はこのようなコンテナの初期化
public class ArticlesContainer extends SQLContainer { 

    public ArticlesContainer(QueryDelegate delegate) throws SQLException { 
     super(delegate); 
     // TODO Auto-generated constructor stub 
    } 
} 

とtreePresenter:今、すべての罰金まで

public Container initializeContainer() { 
     JDBCConnectionPool pool; 
     ArticlesContainer container = null; 
     try { 
      pool = new SimpleJDBCConnectionPool("com.mysql.jdbc.Driver", "jdbc:mysql://localhost:3306/pfeapp", "admindxbIwZL", "HduX7BJJaBAD"); 
      QueryDelegate tq = new TableQuery("articles", pool); 
      container = new ArticlesContainer(tq); 
     } catch (SQLException e) { 
      // TODO Auto-generated catch block 
      e.printStackTrace(); 
     } 
     return container; 
    } 

は、それが完璧に動作します。私はアクションを作成しようとすると、 問題は、例えば、私はこのようなアクションAddArticleActionを追加し、次のとおりです。

public class AddArticleAction<T extends AddArticleActionDefinition> extends AbstractAction<T>{ 

    private ContentConnector contentConnector; 

    private EventBus eventBus; 

    @Inject 
    public AddArticleAction(T definition, @Named(AdmincentralEventBus.NAME)EventBus eventBus) { 
     super(definition); 
     this.eventBus = eventBus; 
     // TODO Auto-generated constructor stub 
    } 

    @Override 
    public void execute() throws ActionExecutionException { 
     // TODO Auto-generated method stub 

    } 

} 

私は、ブラウザのアクションバーに追加記事のリンクをクリックしたとき、私はこの例外を取得します:

2017年5月20日00:28:22321 ERROR fo.magnolia.ui.contentapp.browser.BrowserPresenter:アクション[addArticle] info.magnolia.ui.api.actionの実行中にエラーが発生した 。 ActionExecutionException:アクションの実行 アクションに失敗しました:addArticle at info.m agnolia.ui.api.action.AbstractActionExecutor.execute info.magnolia.ui.contentapp.browser.BrowserPresenter.executeAction(BrowserPresenter.java:347)で(AbstractActionExecutor.java:64) info.magnolia.uiで 。 contentapp.browser.BrowserPresenter.onActionbarItemClicked(BrowserPresenter.java:306) でinfo.magnolia.ui.actionbar.ActionbarPresenter.onActionbarItemClicked(ActionbarPresenter.java:205) info.magnolia.ui.actionbar.ActionbarViewImpl $ 1.actionTriggerで(ActionbarViewImpl.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(ネイティブメソッド) sun.reflect.NativeMethodAccessorImpl.invoke(不明なソース) sun.reflect.DelegatingMethodAccess com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:508) のcom.vaadin.event.EventRouterの のjava.lang.reflect.Method.invoke(Unknown Source)のorImpl.invoke(不明なソース)。 com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:1008) info.magnoliaで でcom.vaadin.event.EventRouter.fireEvent(EventRouter.java:161)でfireEvent(EventRouter.java:198) .ui.vaadin.actionbar.Actionbar.access $ 000(Actionbar.java:59) ( )info.magnolia.ui.vaadin.actionbar.Actionbar $ 1.onActionTriggered(Actionbar.java:72) at sun.reflect.NativeMethodAccessorImpl。 invoke0(ネイティブメソッド)at sun.reflect.NativeMethodAccessorImpl.invok (不明な情報源) com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:158)で のsun.reflect.DelegatingMethodAccessorImpl.invoke(不明な情報源)から のjava.lang.reflect.Method.invoke com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:437) com.vaadin.serverで でcom.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:118) で) 。 communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:408) at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:273) at(UidlRequestHandler)。Javaの:90) でcom.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41) でcom.vaadin.server.VaadinService.handleRequest(VaadinService.java:1414)com.vaadin.serverで 。 javax.servlet.http.HttpServlet.serviceでVaadinServlet.service info.magnolia.ui.admincentral.AdmincentralVaadinServlet.service(AdmincentralVaadinServlet.java:131)で(VaadinServlet.java:365) (HttpServlet.java:742)でに info.magnolia.cms.filters.ServletDispatchingFilter.doFilter info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)で(ServletDispatchingFilter.java:148) info.magnolia.cms.filtersでinfo.magnolia.cms.filters.MgnlFilterChain.doFilter info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:81)で(MgnlFilterChain.java:79) .MgnlFilterChain.doFilter(MgnlFilterChain.java:81) でinfo.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:81) info.magnolia.cms.filters.CompositeFilter.doFilter(CompositeFilter.javaで:65) でinfo.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85) info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79)で info.magnolia.cmsで info.magnolia.cms.filters.VirtualUriFilter.doFilter info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)で(VirtualUriFilter.java:69) で10 info.magnolia.module.cache.executor.CompositeExecutorで.filters.MgnlFilterChain.doFilter info.magnolia.module.cache.executor.Bypass.processCacheRequest(Bypass.java:58)で(MgnlFilterChain.java:79) .processCacheRequest(CompositeExecutor.java:67) でinfo.magnolia.module.cache.filter.CacheFilter.doFilter(CacheFilter.java:220) info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(Abstraで info.magnolia.cms.filters.MgnlFilterChain.doFilter info.magnolia.cms.i18n.I18nContentSupportFilter.doFilter(I18nContentSupportFilter.java:74で(MgnlFilterChain.java:79) ) ATでctMgnlFilter.java:85) info.magnolia.cms.filtersで info.magnolia.cms.filters.AbstractMgnlFilter.doFilter info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79)で(AbstractMgnlFilter.java:85) info.magnoliaで.RangeSupportFilter.doFilter info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)で(RangeSupportFilter.java:77) info.magnolia.cms.filters.AbstractMgnlFilter.doFilterで.cms.filters.MgnlFilterChain.doFilter info.magnolia.cms.security.BaseSecurityFilter.doFilter(BaseSecurityFilter.java:57)で(MgnlFilterChain.java:79) info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:81)で info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79)で(AbstractMgnlFilter.java:85) info.magnolia.cms.security.SecurityCallbackFilter.doFilter(SecurityCallbackFilter.java:84) at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter。Javaの:59) info.magnolia.cms.security.LogoutFilter.doFilter(LogoutFilter.java:94で info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79) ) で 情報で info.magnolia.module.site.filtersで.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79)で(OncePerRequestAbstractMgnlFilter.java:59) info.magnolia.cで.SiteMergeFilter.doFilter info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)で(SiteMergeFilter.java:119) info.magnolia.cms.filters.AbstractMgnlFilter.doFilterでms.filters.MgnlFilterChain.doFilter info.magnolia.cms.filters.MultiChannelFilter.doFilter(MultiChannelFilter.java:83)で(MgnlFilterChain.java:79) ( AbstractMgnlFilter.java:85) info.magnolia.module.cache.filter.GZipFilter.doFilterで info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79) で (GZipFilter.java:73) info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79)で info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:59) で info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:81) でinfo.magnolia.cms.security.auth.login.LoginFilter.doFilter(LoginFilter.java:127) で 情報で。 info.magnolia.cms.filters.MgnlFilterChainでmagnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85) でinfo.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79) 。 info.magnolia.cms.filters.ContentTypeFilter.doFilter(ContentTypeFilter.java:155)でのdoFilter(MgnlFilterChain.java:81) でinfo.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:81) info.magnolia.cmsで info.magnolia.cms.filters.AbstractMgnlFilter.doFilter info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79)で(AbstractMgnlFilter.java:85) で.filters.ContextFilter.doFilter(ContextFilter.java:128) でinfo.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85) info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChainで.java:79) at info.magnolia.cms.filters.CompositeFilter.doFilter(CompositeFilter.java:65) at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnl info.magnolia.cms.filters.SafeDestroyMgnlFilterWrapper.doFilter info.magnolia.cms.filters.MgnlFilterDispatcher.doDispatch(MgnlFilterDispatcher.java:67で(SafeDestroyMgnlFilterWrapper.java:107) ) ATでFilter.java:85) info.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:108) でinfo.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:94) org.apache.catalina.coreで.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain。Javaの: で166) でorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) 組織で org.apache.catalina.valves.AbstractAccessLogValveで.apache.catalina.core.StandardHostValve.invoke org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)で(StandardHostValve.java:140) org.apache.catalina.cで.invoke org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)で(AbstractAccessLogValve.java:624) onnector.CoyoteAdapter.service(CoyoteAdapter.java:342) でorg.apache.coyote.http11.Http11Processor.service(Http11Processor.java:498) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.javaで: 66) org.apache.tomcat.util.net.NioEndpoint $ SocketProcessor.doRun(NioEndpoint.java:1368) での org.apache.coyote.AbstractProtocol $ ConnectionHandler.process(AbstractProtocol.java:796) で org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(不明なソース) at java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知の ソース) at org.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(不明なソース)原因: java.lang.NullPointerException at info.magnolia.objectfactory.ObjectManufacturer.resolveParametersで info.magnolia.objectfactory.CandidateParameterResolver.resolveParameter info.magnolia.objectfactory.ObjectManufacturer.resolveParameter(ObjectManufacturer.java:166)で(CandidateParameterResolver.java:78) (ObjectManufacturer .java:143) at info.magnolia.objectfactory.ObjectManufacturer.newInstance(ObjectManufacturer.java:86) at info。 info.magnolia.objectfactory.guice.GuiceComponentProvider.newInstance(GuiceComponentProvider.java:107) info.magnolia.ui.api.actionで でmagnolia.objectfactory.guice.GuiceComponentProvider.newInstanceWithParameterResolvers(GuiceComponentProvider.java:121) 。 AbstractActionExecutor.createAction info.magnolia.ui.api.action.AbstractActionExecutor.execute(AbstractActionExecutor.java:61)で(AbstractActionExecutor.java:90) ... 107もっと

私は本当にしないでください問題がどこにあるかを理解する。

答えて

1

AddArticleActionDefinitionには何を設定しますか?implementationClass?それはAddArticleActionを指し示す必要があります。私はそうは思わない、したがってCaused by: java.lang.NullPointerExceptionの例外。 Executorは設定されていないため、あなたのアクションを呼び出すことはできません。

関連する問題