Share Archetype Appears to be Broken

59 views
Skip to first unread message

ukdavo

unread,
Mar 14, 2012, 11:44:52 AM3/14/12
to Maven Alfresco Lifecycle Discussion Group
Hi there

I tried using the Share Archetype. Maven generates the WAR OK & it
appears to deploy OK under Tomcat (i.e. no errors during startup). On
trying to access the Share homepage via browser I get the following
error:

ltScheduler_Worker-9] The OpenOffice connection was re-established.
15:13:24,465 INFO [web.site.EditionInterceptor] Successfully
retrieved license information from Alfresco.
15:13:24,526 ERROR [alfresco.web.site]
org.springframework.web.util.NestedServletException: Request
processing failed; nested exception is java.lang.NullPointerException
java.lang.NullPointerException
at java.io.StringReader.<init>(StringReader.java:33)
at org.json.JSONTokener.<init>(JSONTokener.java:66)
at org.json.JSONObject.<init>(JSONObject.java:420)
at org.alfresco.web.site.EditionInterceptor
$EditionInfo.<init>(EditionInterceptor.java:192)
at
org.alfresco.web.site.EditionInterceptor.preHandle(EditionInterceptor.java:
101)
at
org.springframework.web.servlet.handler.WebRequestHandlerInterceptorAdapter.preHandle(WebRequestHandlerInterceptorAdapter.java:
54)
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:
781)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:
719)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:
644)
at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:
549)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:
617)
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.alfresco.web.site.servlet.MTAuthenticationFilter.doFilter(MTAuthenticationFilter.java:
74)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
206)
at
org.alfresco.web.site.servlet.SSOAuthenticationFilter.doFilter(SSOAuthenticationFilter.java:
307)
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:
127)
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:
293)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
859)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint
$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)

I had a look inside the generated WAR. There are a bunch of tokens in
the share-config-custom.xml. For example:

<scheme>${share.server.scheme}</scheme>
<hostname>${share.server.name}</hostname>
<port>${share.server.port}</port>

Is this correct?

I then checked the pom.xml. I see that there's filtering for
application.properties there but nothing for share-config-custom.xml.
Is this the source of my problem or is it something else?

Cheers

Mark

stijnr

unread,
Mar 15, 2012, 11:00:35 AM3/15/12
to maven-a...@googlegroups.com
Hi Mark, 

I think the property filtering is okay: check if there is an application.properties file in alfresco/web-extension in the WAR. Furthermore, there should also be Spring property placeholder configuration in alfresco/web-extension/custom-slingshot-application-context.xml, which is referring to the application.properties and making it available in Spring.
I started working on POMs to use as parents for your webapp, and quickstart example to show how to use them. Right now the code is at http://code.google.com/p/maven-alfresco-poms/, but I plan to merge it to the Alfresco Archetypes project. I just finished the Share POM and webapp, so you can see what I did there. The Alfresco POM, webapp and Module (AMP) projects are also quite far. See the POMs for inline documentation on how to use them. They currently support:
  • Packaging AMPs, Alfresco and Share WARs in a faster way with the maven-copy-plugin
  • Deploying Alfresco WAR to a running (remote) Tomcat instance
  • Hot deploying the WAR or AMP customizations to a local running Tomcat instance (file copy)
  • Live editing of AMPs with jRebel (including Java and Spring reloading, you never need to restart Tomcat!)
  • Running Share WAR with Jetty against a running Alfresco (e.g. in Tomcat)
Left to do: Runnig a Share customization (JAR) with Jetty.

Regards, Stijn

Mark Davidson

unread,
Mar 15, 2012, 11:50:57 AM3/15/12
to maven-a...@googlegroups.com
alfresco/web-extension/application.properties - exists
alfresco/web-extension/custom-slingshot-application-context.xml - nope, doesn't exist

Cheers

Mark

--
You received this message because you are subscribed to the Google Groups "Maven Alfresco Lifecycle Discussion Group" group.
To view this discussion on the web visit https://groups.google.com/d/msg/maven-alfresco/-/r-Nr9dRncVwJ.
To post to this group, send email to maven-a...@googlegroups.com.
To unsubscribe from this group, send email to maven-alfresc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/maven-alfresco?hl=en.

stijnr

unread,
Mar 19, 2012, 6:14:00 AM3/19/12
to maven-a...@googlegroups.com
It isn't in your source either? Under: /my-custom-share/src/main/resources/alfresco/web-extension/custom-slingshot-application-context.xml? It should come with the project when creating it with the archetype (version 3.9.0).

Regards, Stijn
Mark

To post to this group, send email to maven-alfresco@googlegroups.com.
To unsubscribe from this group, send email to maven-alfresco+unsubscribe@googlegroups.com.

Mark Davidson

unread,
Mar 19, 2012, 6:33:09 AM3/19/12
to maven-a...@googlegroups.com
Archetype version 3.9.0? Err no I was using 1.9.1 as shown in the documentation at http://wiki.alfresco.com/wiki/Managing_Alfresco_Lifecyle_with_Maven. Is there any documentation on how to access/use the later version & what it features?

Regards

Mark

To view this discussion on the web visit https://groups.google.com/d/msg/maven-alfresco/-/hieiqhajXQ4J.

To post to this group, send email to maven-a...@googlegroups.com.
To unsubscribe from this group, send email to maven-alfresc...@googlegroups.com.

stijnr

unread,
Mar 19, 2012, 8:15:27 AM3/19/12
to maven-a...@googlegroups.com
Ah, 

I too started at the Wiki with the documentation, but then I looked at what was available in the Nexus repo, and noticed that 3.9.0 had been released for all archetypes. That is the most recent version (in preparation of a 4.0 release for Alfresco 4.0), but I doubt there is a changelog :).
You should be able to use 3.9.0 just as you would use 1.9.1, just replace the version numbers.

Regards, Stijn

Mark Davidson

unread,
Mar 23, 2012, 8:25:53 AM3/23/12
to maven-a...@googlegroups.com
OK will give 3.9.0 a go.

Being a newbie to this and having run into problems (no it's not simple like the homepage states) I would be happy to write up a wiki page on how to use the archetypes, an Idiot's Guide.. on condition that someone answers my stupid questions as I run into further problems. Out of date documentation often turns people away from otherwise useful projects.

Regard

Mark

--
You received this message because you are subscribed to the Google Groups "Maven Alfresco Lifecycle Discussion Group" group.
To view this discussion on the web visit https://groups.google.com/d/msg/maven-alfresco/-/nyoxj1BVKe0J.

Gabriele Columbro

unread,
Mar 23, 2012, 1:43:48 PM3/23/12
to maven-a...@googlegroups.com, maven-a...@googlegroups.com
+100000.... ;)

I just don't have time to do it...can you maybe update directly:


And also create a much simpler starters guide and maybe link it from there? If you want to edit the gcode project just let me know :)

I think a really concise and better doc is the real key for the success of this project :)

Thanks for be willing to try and help!!!

Gab

Gabriele Columbro
Principal Architect, Consulting Services
Alfresco Software ( http://www.alfresco.com )

M: +31 (0)627 565 103
P: +39 320 161 28 46
Skype: gabrielecolumbro
Twitter: @mindthegabz

On 23 mrt. 2012, at 13:25, Mark Davidson <ukd...@googlemail.com> wrote:

OK will give 3.9.0 a go.

Being a newbie to this and having run into problems (no it's not simple like the homepage states) I would be happy to write up a wiki page on how to use the archetypes, an Idiot's Guide.. on condition that someone answers my stupid questions as I run into further problems. Out of date documentation often turns people away from otherwise useful projects

Regard

Mark

On 19 March 2012 12:15, stijnr <stijnd...@gmail.com> wrote:
Ah, 

I too started at the Wiki with the documentation, but then I looked at what was available in the Nexus repo, and noticed that 3.9.0 had been released for all archetypes. That is the most recent version (in preparation of a 4.0 release for Alfresco 4.0), but I doubt there is a changelog :).
You should be able to use 3.9.0 just as you would use 1.9.1, just replace the version numbers.

Regards, Stijn


On Monday, March 19, 2012 11:33:09 AM UTC+1, ukdavo wrote:
Archetype version 3.9.0? Err no I was using 1.9.1 as shown in the documentation at http://wiki.alfresco.com/wiki/Managing_Alfresco_Lifecyle_with_Maven. Is there any documentation on how to access/use the later version & what it features?

Regards

Mark


--
You received this message because you are subscribed to the Google Groups "Maven Alfresco Lifecycle Discussion Group" group.
To view this discussion on the web visit https://groups.google.com/d/msg/maven-alfresco/-/nyoxj1BVKe0J.

To post to this group, send email to maven-a...@googlegroups.com.
To unsubscribe from this group, send email to maven-alfresc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/maven-alfresco?hl=en.

Timo

unread,
Mar 28, 2012, 3:48:31 AM3/28/12
to maven-a...@googlegroups.com
It seems to be difficult to get rid of the NullPointerException.

I created the maven project using archetype version 3.9.0:
mvn archetype:generate -DarchetypeGroupId=org.alfresco.maven -DarchetypeArtifactId=maven-alfresco-share-archetype -DarchetypeVersion=3.9.0 -DgroupId=com.mycompany -DartifactId=maven-alfresco-share -Dversion=1.0-SNAPSHOT -DarchetypeRepository=http://maven.alfresco.com/nexus/content/repositories/releases -DinteractiveMode=false

It created file alfresco/web-extension/custom-slingshot-application-context.xml.sample. I rename the file to alfresco/web-extension/custom-slingshot-application-context.xml. Now I build and start Jetty.

I have Alfresco running in http://localhost:8080/alfresco. When I go to localhost:8081/maven-alfresco-share, I get the following exception:
[INFO] Started Jetty Server
10:25:24,605 INFO [web.site.EditionInterceptor] Successfully retrieved license information from Alfresco.
2012-03-28 10:25:24.648::WARN: /maven-alfresco-share/page/site-index
java.lang.NullPointerException
at java.io.StringReader.<init>(StringReader.java:33)
at org.json.JSONTokener.<init>(JSONTokener.java:66)
at org.json.JSONObject.<init>(JSONObject.java:420)
etc.

What is wrong with my project? Any help is greatly appreciated.

B.R.
Timo

maanantaina 19. maaliskuuta 2012 12.14.00 UTC+2 stijnr kirjoitti:
> It isn&#39;t in your source either? Under: /my-custom-share/src/<WBR>main/resources/alfresco/web-<WBR>extension/custom-slingshot-<WBR>application-context.xml? It should come with the project when creating it with the archetype (version 3.9.0).
>
> </div>
> Regards, Stijn

Maurizio Pillitu

unread,
Apr 4, 2012, 9:03:18 AM4/4/12
to maven-a...@googlegroups.com
Hi Timo,
I had the same issue and got rid of it by commenting out some syntax from the share-config-custom.xml file in the share project; please check issue


and see if the workaround applies for you as well; for any question, feel free to ping!

HTH
  mau
Reply all
Reply to author
Forward
0 new messages