Showing posts with label Alfresco. Show all posts
Showing posts with label Alfresco. Show all posts

Saturday, 25 July 2009

Yet another juicy Alfresco Labs 3.1 stacktrace...

...which kept me busy for a couple of days.
I dumped it here for in case somebody else hits it.
So if you didn't find this post by googling an alfresco exception, you need to move along people, there is nothing to see here.

Without further ado, if you get the following exception:

javax.faces.FacesException: javax.faces.FacesException: Could not retrieve value of component with path : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /jsp/dialog/container.jsp][Class: javax.faces.component.html.HtmlForm,Id: dialog][Class: javax.faces.component.UINamingContainer,Id: dialog-body][Class: org.alfresco.web.ui.common.component.UIPanel,Id: users-panel][Class: org.alfresco.web.ui.common.component.data.UIRichList,Id: users-list][Class: org.alfresco.web.ui.common.component.data.UIColumn,Id: _idJsp33][Class: javax.faces.component.html.HtmlOutputText,Id: _idJsp35]}
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:425)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.jasper.JasperException: javax.faces.FacesException: Could not retrieve value of component with path : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /jsp/dialog/container.jsp][Class: javax.faces.component.html.HtmlForm,Id: dialog][Class: javax.faces.component.UINamingContainer,Id: dialog-body][Class: org.alfresco.web.ui.common.component.UIPanel,Id: users-panel][Class: org.alfresco.web.ui.common.component.data.UIRichList,Id: users-list][Class: org.alfresco.web.ui.common.component.data.UIColumn,Id: _idJsp33][Class: javax.faces.component.html.HtmlOutputText,Id: _idJsp35]}
at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
at org.apache.jsp.jsp.dialog.container_jsp._jspService(container_jsp.java:637)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419)
... 19 more
Caused by: javax.faces.FacesException: Could not retrieve value of component with path : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /jsp/dialog/container.jsp][Class: javax.faces.component.html.HtmlForm,Id: dialog][Class: javax.faces.component.UINamingContainer,Id: dialog-body][Class: org.alfresco.web.ui.common.component.UIPanel,Id: users-panel][Class: org.alfresco.web.ui.common.component.data.UIRichList,Id: users-list][Class: org.alfresco.web.ui.common.component.data.UIColumn,Id: _idJsp33][Class: javax.faces.component.html.HtmlOutputText,Id: _idJsp35]}
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getStringValue(RendererUtils.java:227)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderOutput(HtmlTextRendererBase.java:69)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:57)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)
at org.alfresco.web.ui.common.Utils.encodeRecursive(Utils.java:173)
at org.alfresco.web.ui.common.Utils.encodeRecursive(Utils.java:168)
at org.alfresco.web.ui.common.renderer.data.RichListRenderer$DetailsViewRenderer.renderListRow(RichListRenderer.java:292)
at org.alfresco.web.ui.common.renderer.data.RichListRenderer.encodeChildren(RichListRenderer.java:118)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:527)
at javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:483)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:364)
at org.apache.jsp.jsp.users.users_jsp._jspx_meth_a_005frichList_005f0(users_jsp.java:659)
at org.apache.jsp.jsp.users.users_jsp._jspService(users_jsp.java:273)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
... 42 more
Caused by: javax.faces.el.EvaluationException: Cannot get value for expression '#{r.sizeLatest}'
at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:405)
at javax.faces.component.UIOutput.getValue(UIOutput.java:80)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getStringValue(RendererUtils.java:223)
... 57 more
Caused by: javax.faces.el.EvaluationException: Exception getting value of property sizeLatest of base of type : org.alfresco.web.bean.repository.MapNode
at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:99)
at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java:535)
at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:386)
... 59 more
Caused by: java.lang.NullPointerException
at java.io.StringReader.(StringReader.java:33)
at org.alfresco.repo.search.impl.lucene.ADMLuceneIndexerImpl.indexProperty(ADMLuceneIndexerImpl.java:1037)
at org.alfresco.repo.search.impl.lucene.ADMLuceneIndexerImpl.createDocuments(ADMLuceneIndexerImpl.java:606)
at org.alfresco.repo.search.impl.lucene.AbstractLuceneIndexerImpl.indexImpl(AbstractLuceneIndexerImpl.java:632)
at org.alfresco.repo.search.impl.lucene.AbstractLuceneIndexerImpl.indexImpl(AbstractLuceneIndexerImpl.java:657)
at org.alfresco.repo.search.impl.lucene.AbstractLuceneIndexerImpl.flushPending(AbstractLuceneIndexerImpl.java:789)
at org.alfresco.repo.search.impl.lucene.ADMLuceneIndexerImpl.doPrepare(ADMLuceneIndexerImpl.java:1591)
at org.alfresco.repo.search.impl.lucene.AbstractLuceneIndexerImpl.prepare(AbstractLuceneIndexerImpl.java:472)
at org.alfresco.repo.search.impl.lucene.AbstractLuceneIndexerAndSearcherFactory.prepare(AbstractLuceneIndexerAndSearcherFactory.java:783)
at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.beforeCommit(AlfrescoTransactionSupport.java:661)
at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:48)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:835)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:645)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:632)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:314)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:117)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy176.getUserUsage(Unknown Source)
at org.alfresco.web.bean.users.UsersBeanProperties.getUserUsage(UsersBeanProperties.java:290)
at org.alfresco.web.bean.users.UsersDialog$1.get(UsersDialog.java:410)
at org.alfresco.web.bean.repository.QNameNodeMap.get(QNameNodeMap.java:117)
at org.alfresco.web.bean.repository.MapNode.get(MapNode.java:157)
at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:81)
... 62 more


nice, hey.

I think its reported here
https://issues.alfresco.com/jira/browse/ETHREEOH-1846

To fix it, I built a newer version of org.alfresco.repo.search.impl.lucene.ADMLuceneIndexerImpl from the svn sources, and dumped it in the alfresco/WEB-INF/classes and it works!

Tuesday, 21 July 2009

more alfresco pain

This time I tried to send e-mails when new documents are added. I thought this would be simple. (With Alfresco labs 3.1)
First I got errors like:
20:08:32,529  ERROR [action.executer.MailActionExecuter]
Failed to send email to 'amanica@localhost'
as the address is incorrectly formatted

Eventually I figured out my test addresses are not acceptable to javamail. I had to setup amanica@localhost.dev before it worked.

Next I got the following:
20:08:33,310  ERROR [action.executer.MailActionExecuter]
Failed to send email to [root, test]
org.springframework.mail.MailPreparationException:
Could not prepare mail; nested exception is java.lang.NullPointerException
Caused by: java.lang.NullPointerException
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:599)
at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:388)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:332)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:347)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:336)
at org.alfresco.repo.action.executer.MailActionExecuter.executeImpl(MailActionExecuter.java:352

And I think setting a e-mail address for the admin user fixed that.

Thirdly it only wanted to send these rule e-mails from alfresco@alfresco.com, but if I copy slightly newer versions of
MailActionExecuter$1.class and MailActionExecuter.class into
${ALF_HOME}/tomcat/shared/classes/org/alfresco/repo/action/executer/
it works. I don't know if that breaks anything else in the process.

And finally, I'm still unhappy that they don't ship with oracle hibernate mapping files in the community edition, even in version 3.2 .
Caused by: java.lang.RuntimeException: Error occurred.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException
: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.sqlmap.client.SqlMapException: The <sqlmap> resource is missing: alfresco/ibatis/#resource.
dialect#/content-insert-SqlMap.xml
at org.alfresco.ibatis.HierarchicalSqlMapConfigParser.parse(HierarchicalSqlMapConfigParser.java:112)
at org.alfresco.ibatis.HierarchicalSqlMapClientFactoryBean.buildSqlMapClient(HierarchicalSqlMapClientFactoryBean.java:86)
</sqlmap>

Like eclipse and maven, its painfull but theres nothing better :(

Tuesday, 14 April 2009

Alfresco pain

After struggling a lot, I finally got Alfresco running on my Glassfish (v2ur2-b04),
for a couple of minutes then it broke again. I'll update this if I get it working one day.

First of all, look at the following for how to install using an oracle db.
http://wiki.alfresco.com/wiki/Database_Configuration
Which worked mostly, except it seems like you have to use the AlfrescoOracle9Dialect eg.:
hibernate.dialect=org.alfresco.repo.domain.hibernate.dialect.AlfrescoOracle9Dialect


Initially I got the following exceptions:
Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.(Z)V
Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.

and
Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Lj
ava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V
Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit
This was fixed by putting the correct hibernate jars in the domain1/lib and domain1/lib/ext folders.
I put asm-attrs.jar, cglib-2.1.3.jar, ojdbc14_g.jar (for oracle) in domain1/lib and
asm.jar, serializer.jar, xalan.jar in domain1/lib/ext


Next when I tried to log into the share webapp, I got the following:
"The remote server may be unavailable or your authentication details have not been recognized."
Thanks to the following link I figured out that alfresco does not like to run on a different port the server port is hardcoded into the war files in several places:
http://forums.alfresco.com/en/viewtopic.php?f=8&t=13625&start=15&st=0&sk=t&sd=a&hilit=The+remote+server+may+be+unavailable+or+your+authentication+details+have+not+been+recognised#p45826

Since I'd like to run it on a non-default port, I updated the port number by replacing all occurrences of 8080 with 12080.

I'm lazy so I did it like this:
$ cd domain1
$ replace 8080 12080 -- `find -iname "*.wsdl"`
$ replace 8080 12080 -- `find -iname "*.xml"`
$ replace 8080 12080 -- `find -iname "*.ftl"`
(btw this replace command I used is part of mysql-server-5.0: /usr/bin/replace)
See
http://wiki.alfresco.com/wiki/Changing_Default_Port_Configuration for more info.


Next I got this exception in my logs:

org.alfresco.web.framework.exception.RendererExecutionException: Unable to execute 'body' JSP include: /site-index.jsp
Caused by: java.lang.ClassCastException: org.alfresco.tools.FakeHttpServletResponse cannot be cast to org.apache.coyote.tomcat5.CoyoteResponseFacade

I found a fixed up version of alfresco-web-framework.jar which goes in domain1/applications/j2ee-modules/share/WEB-INF/lib on this forum:
http://forums.java.net/jive/thread.jspa?threadID=58906
Now I could actually log in.


But somewere along the line I got the following:
org.alfresco.web.framework.exception.RendererExecutionException: FreemarkerProcessor failed to process template: org/alfresco/global/slingshot-login.ftl
Caused by: freemarker.core.InvalidReferenceException: on line 32, column 70 in org/alfresco/global/slingshot-login.ftl link not found.
on line 32, column 70 in org/alfresco/global/slingshot-login.ftl link not found.
The problematic instruction:
----------
==> user-directive link [on line 32, column 70 in org/alfresco/global/slingshot-login.ftl]
in user-directive template.body [on line 6, column 1 in org/alfresco/global/slingshot-login.ftl]
and what fixed it for me AFAICT is to add the sun-web.xml described here:
http://blogs.sun.com/mandy/entry/alfresco_on_glassfish_short_version

mm.. seems like everything is not working for me yet. I have to switch between the patched and the original versions of alfresco-web-framework.jar (i.e log in with the one and play further with the other)

I'm doing a svn checkout at the moment to see if the developent verion works better on glassfish.
Maybe I can submit some patches if necessary.