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.

1 comment:

  1. Mr Marius

    I am getting this same thing with DDEAWEB (our own custom app written my Ziyaad)

    And looks like I am following your workaround :)

    But now it seems like it's GlassFish : http://tai-dev.blog.co.uk/2010/01/21/nosuchmethoderror-org-objectweb-asm-classwriter-when-deploying-your-app-to-a-new-instance-of-glassfish-v2-1-1-it-looks-like-the-upgraded-fins-are-7849068/

    cheers
    Richard

    ReplyDelete