cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a Custom Dialog

alessioa_
Champ in-the-making
Champ in-the-making
Hi to all the folks,
i tryied to add the example custom dialog following the steps in the documentation: http://wiki.alfresco.com/w/index.php?title=Adding_a_Custom_Dialog.
After the click on the "Add Aspect" link i receive this error:
javax.faces.FacesException: Bean: org.alfresco.web.bean.actions.RunActionWizard, property: aspects
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:421)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.apache.jasper.JasperException: Bean: org.alfresco.web.bean.actions.RunActionWizard, property: aspects
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
at org.apache.jsp.jsp.dialog.container_jsp._jspService(org.apache.jsp.jsp.dialog.container_jsp:530)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
… 20 more

Someone can help me explaining what i missed?

Thank you very much
Best Regards
Alessio A.
21 REPLIES 21

gavinc
Champ in-the-making
Champ in-the-making
The following line tells me that your dialog configuration is not being picked up:

11:09:14,752 DEBUG [web.app.AlfrescoNavigationHandler] Passing outcome 'addAspect' to original navigation handler

Is your file called web-client-config-custom.xml? Does it live in the alfresco/extension folder within your JAR file?

More importantly do you have another web-client-config-custom.xml file somewhere else i.e. in <tomcat>/shared/classes/alfresco/extension or in another JAR file?

If you have 2 of these files only one will get picked and loaded so it maybe that yours is being ignored.

rcortesr
Star Contributor
Star Contributor
Hi,

I had a problem with my web-client-config.xml.
Now when my dialog is being picked up appears the following error:
javax.faces.el.EvaluationException: Cannot get value for expression '#{AddAspectDialog}'
at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:397)
at org.alfresco.web.app.servlet.FacesHelper.getManagedBean(FacesHelper.java:127)
at org.alfresco.web.bean.dialog.DialogManager.setCurrentDialog(DialogManager.java:52)
at org.alfresco.web.app.AlfrescoNavigationHandler.handleDialogOpen(AlfrescoNavigationHandler.java:509)
at org.alfresco.web.app.AlfrescoNavigationHandler.handleNavigation(AlfrescoNavigationHandler.java:103)
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:84)
at javax.faces.component.UICommand.broadcast(UICommand.java:106)
at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:105)
at org.alfresco.web.app.servlet.AlfrescoFacesServlet.service(AlfrescoFacesServlet.java:49)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.faces.FacesException: java.lang.ClassNotFoundException: org.alfresco.sample.AddAspectDialog
at org.apache.myfaces.util.ClassUtils.simpleClassForName(ClassUtils.java:162)
at org.apache.myfaces.util.ClassUtils.newInstance(ClassUtils.java:265)
at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:49)
at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:311)
at org.springframework.web.jsf.DelegatingVariableResolver.resolveVariable(DelegatingVariableResolver.java:110)
at org.apache.myfaces.el.ValueBindingImpl$ELVariableResolver.resolveVariable(ValueBindingImpl.java:569)
at org.apache.commons.el.NamedValue.evaluate(NamedValue.java:124)
at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:378)
… 29 more
Caused by: java.lang.ClassNotFoundException: org.alfresco.sample.AddAspectDialog
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1338)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1187)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at org.apache.myfaces.util.ClassUtils.classForName(ClassUtils.java:138)
at org.apache.myfaces.util.ClassUtils.simpleClassForName(ClassUtils.java:157)
… 36 more

Someone can help me?
Thanks

velja
Champ in-the-making
Champ in-the-making
Have you included faces-config.xml with your jar file?

rcortesr
Star Contributor
Star Contributor
Have you included faces-config.xml with your jar file?

Yes.
In my JAR file there are:
* In /alfresco/extension –> web-client-config-custom.xml, facturaModel.xml and facturaModel-context.xml
* In /META-INF –> faces-config.xml
* In /org/alfresco/sample –> AddAspectDialog

Is this correct??

velja
Champ in-the-making
Champ in-the-making
First of all I'm still a newbie with alfresco, but I believe this message indicates that <managed-bean> block for your bean is not being loaded. If you exported other jars from example SDKs, this might be the reason.
According to wiki docs, only one faces-config.xml is being loaded. This is why all your beans should be inside the same jar file. If you have exported other jar files, try deleting them to see if that fixes your problem.

gavinc
Champ in-the-making
Champ in-the-making
I know what the error is, but i can't explain it  Smiley Sad

Basically, the error means that the AddAspectDialog class can not be found but for the bean to be loaded the web-client-config-custom.xml must have been found (to load the dialog). It looks like both files are in your JAR file so I can't explain why one file is found and one is not!!?

One explanation is that you are actually picking up another web-client-config-custom.xml file from somewhere else and the JAR file is not being picked up.

rcortesr
Star Contributor
Star Contributor
I know what the error is, but i can't explain it  Smiley Sad

Basically, the error means that the AddAspectDialog class can not be found but for the bean to be loaded the web-client-config-custom.xml must have been found (to load the dialog). It looks like both files are in your JAR file so I can't explain why one file is found and one is not!!?

One explanation is that you are actually picking up another web-client-config-custom.xml file from somewhere else and the JAR file is not being picked up.
I have two web-client-config-custom.xml, the first is in jar file and the second is in \tomcat\shared\classes\alfresco\extension.
Both files are equal, have the same content.

gavinc
Champ in-the-making
Champ in-the-making
OK, so it's probably the \tomcat\shared\classes\alfresco\extension one thats getting picked up and your JAR file is not.

Check that your JAR file is in the <tomcat>/webapps/alfresco/WEB-INF/lib folder. It may have been removed if the WAR file has been re-deployed. Try running the integrate-extension target in the SDK sample as that will ensure the files are always re-deployed with the rest of the application.

rcortesr
Star Contributor
Star Contributor
Hi,

my custom dialog it's working.
I would like to aplicate this custom dialog to documents.
I have created a new javabean and I need to compile it.
I have used this command: javac AddAspect.java
But appears to me errors.
How I can compile my new AddAspect.java???

Thanks!!

alessioa_
Champ in-the-making
Champ in-the-making
Hi rcortesr,
did you solve with the jar i sent you yesterday? Could you post which was the problem so other people that read this post and have the same trouble can found an answer to solve it…

Thanks
Alessio A.