cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with the WCM preview tutorial

mike
Champ in-the-making
Champ in-the-making
Hello,

I downloaded and installed the WCM v2 preview on Linux using Weblogic 9.2 and Oracle 9iR2 and all appears to work fine.

However, when following the tutorial I encounter the error below when uploading the 'company-footer.xsd' as part of creating a new web form:

Please correct the errors below then click Finish.
    * unable to parse company-footer.xsd: null

This also throws the following expection on the application server:

14:23:09,041 ERROR [org.alfresco.web.ui.common.Utils] unable to parse company-footer.xsd: null
java.lang.NullPointerException
        at org.alfresco.web.forms.xforms.SchemaUtil.parseSchema(SchemaUtil.java:219)
        at org.alfresco.web.bean.wcm.CreateFormWizard.schemaFileValueChanged(CreateFormWizard.java:612)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
        at javax.faces.component.UIInput.broadcast(UIInput.java:200)
        at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
        at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:132)
        at org.apache.myfaces.lifecycle.LifecycleImpl.applyRequestValues(LifecycleImpl.java:200)
        at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:71)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:105)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:73)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3243)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)


Any ideas?

Thanks,

Mike
14 REPLIES 14

arielb
Champ in-the-making
Champ in-the-making
what browser version are you using?

mike
Champ in-the-making
Champ in-the-making
I have tried Firefox 2.0.0.1 on Windows 2000 and Firefox 2.0.0.2pre on SuSE 10.2.

Both give the same error.

I don't think the problem is client side as a packet trace show the form submission of the xsd to the UploadFileServlet

arielb
Champ in-the-making
Champ in-the-making
it looks like you're right - it does seem like the upload is working properly.  just to make absolutely sure, can you try it with IE6 on windows or firefox 1.5 on any other platform.

My hunch is that the problem is actually with your server environment though.  it seems as if you might have an older version of xerces somewhere on your classpath with is conflicting with the version needed by alfresco.  it seems like the DOMImplementation your classpath is providing does not have support for LS 3.0.  can you provide some information on your server environment, particularly which version of xerces is part of your jvm distribution?  check $JAVA_HOME/common/endorsed as well to see if you have a xerces.jar there.

thanks,

ariel

mike
Champ in-the-making
Champ in-the-making
I've also tried with IE6 and Opera 9.1 and both give the same problem.

The only version of xerces on my classpath is the one bundled in the alfresco web app (xercesImpl-2.8.0.jar). I have just tried xercesImpl-2.9.0.jar and get the same problem.

Env details:

jdk 1.5.0_11
weblogic 9.2 MP!
SuSE Enterprise 9 SP2

Thanks,

Mike.

mike
Champ in-the-making
Champ in-the-making
I turned on debugging for the org.alfresco.web.app.servlet.UploadFileServlet and get the following:

10:47:34,737 DEBUG [org.alfresco.web.app.servlet.UploadFileServlet] Uploading servlet servicing…
10:47:34,770 DEBUG [org.alfresco.web.app.servlet.UploadFileServlet] Processing uploaded file: company-footer.xsd
10:47:34,774 DEBUG [org.alfresco.web.app.servlet.UploadFileServlet] Temp file: /tmp/Alfresco/alfresco60610.upload created from upload filename: company-footer.xsd
10:47:34,774 DEBUG [org.alfresco.web.app.servlet.UploadFileServlet] Sending back javascript response window.parent.upload_complete_helper('schema',{error: '${_UPLOAD_ERROR}', fileTypeImage: '${_FILE_TYPE_IMAGE}'})
10:47:34,906 ERROR [org.alfresco.web.ui.common.Utils] unable to parse company-footer.xsd: null
java.lang.NullPointerException
        at org.alfresco.web.forms.xforms.SchemaUtil.parseSchema(SchemaUtil.java:219)
        at org.alfresco.web.bean.wcm.CreateFormWizard.schemaFileValueChanged(CreateFormWizard.java:612)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
        at javax.faces.component.UIInput.broadcast(UIInput.java:200)
        at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
        at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:132)
        at org.apache.myfaces.lifecycle.LifecycleImpl.applyRequestValues(LifecycleImpl.java:200)
        at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:71)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:105)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:73)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3243)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)


Hope this helps Smiley Happy

Mike

mike
Champ in-the-making
Champ in-the-making
I've turned on some more debugging and now get the following:

16:15:24,135 DEBUG [org.alfresco.web.app.servlet.UploadFileServlet] Uploading servlet servicing…
16:15:24,167 DEBUG [org.alfresco.web.app.servlet.UploadFileServlet] Processing uploaded file: company-footer.xsd
16:15:24,171 DEBUG [org.alfresco.web.app.servlet.UploadFileServlet] Temp file: /tmp/Alfresco/alfresco10831.upload created from upload filename: company-footer.xsd
16:15:24,171 DEBUG [org.alfresco.web.app.servlet.UploadFileServlet] Sending back javascript response window.parent.upload_complete_helper('schema',{error: '${_UPLOAD_ERROR}', fileTypeImage: '${_FILE_TYPE_IMAGE}'})
16:15:24,298 DEBUG [org.alfresco.web.bean.wcm.CreateFormWizard] getSchemaRootElementNameChoices(null) = 0
16:15:24,299 DEBUG [org.alfresco.web.bean.wcm.CreateFormWizard] getSchemaRootElementNameChoices(null) = 0
16:15:24,300 DEBUG [org.alfresco.web.bean.wcm.CreateFormWizard] schemaFileValueChanged(company-footer.xsd[/tmp/Alfresco/alfresco10831.upload])
16:15:24,337 ERROR [org.alfresco.web.ui.common.Utils] unable to parse company-footer.xsd: null
java.lang.NullPointerException
        at org.alfresco.web.forms.xforms.SchemaUtil.parseSchema(SchemaUtil.java:219)
        at org.alfresco.web.bean.wcm.CreateFormWizard.schemaFileValueChanged(CreateFormWizard.java:612)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
        at javax.faces.component.UIInput.broadcast(UIInput.java:200)
        at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
        at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:132)
        at org.apache.myfaces.lifecycle.LifecycleImpl.applyRequestValues(LifecycleImpl.java:200)
        at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:71)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:105)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:73)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3243)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
16:15:24,339 DEBUG [org.alfresco.web.bean.wcm.CreateFormWizard] getSchemaRootElementNameChoices(null) = 0
16:15:24,339 DEBUG [org.alfresco.web.bean.wcm.CreateFormWizard] getSchemaRootElementNameChoices(null) = 0
16:15:24,340 DEBUG [org.alfresco.web.bean.wcm.CreateFormWizard] getSchemaRootElementNameChoices(null) = 0
16:15:24,340 DEBUG [org.alfresco.web.bean.wcm.CreateFormWizard] getSchemaRootElementNameChoices(null) = 0
16:15:24,369 DEBUG [org.alfresco.web.bean.wcm.CreateFormWizard] getSchemaRootElementNameChoices(null) = 0
16:15:24,370 DEBUG [org.alfresco.web.bean.wcm.CreateFormWizard] getSchemaRootElementNameChoices(null) = 0
16:15:24,370 DEBUG [org.alfresco.web.bean.wcm.CreateFormWizard] getSchemaRootElementNameChoices(null) = 0
16:15:24,370 DEBUG [org.alfresco.web.bean.wcm.CreateFormWizard] getSchemaRootElementNameChoices(null) = 0
16:15:24,370 DEBUG [org.alfresco.web.bean.wcm.CreateFormWizard] getSchemaRootElementNameChoices(null) = 0



I think the exception is thrown from this method in org.alfresco.web.bean.wcm.CreateFormWizard:

   public String schemaFileValueChanged(final ValueChangeEvent vce)
   {
      if (LOGGER.isDebugEnabled())
      {
         LOGGER.debug("schemaFileValueChanged(" + this.getFileName(FILE_SCHEMA) +
                      "[" + this.getSchemaFile() + "])");
      }
      if (this.getSchemaFile() != null)
      {
         try
         {
            final Document d = XMLUtil.parse(this.getSchemaFile());
            this.schema = SchemaUtil.parseSchema(d);
         }
         catch (Exception e)
         {
            final String msg = "unable to parse " + this.getFileName(FILE_SCHEMA);
            this.removeUploadedSchemaFile();
            Utils.addErrorMessage(msg + ": " + e.getMessage(), e);
         }
      }
      return null;
   }

arielb
Champ in-the-making
Champ in-the-making
can you take a look at the jars within your jdk and weblogic and see if any of them contain xerces, and if they are clobbering the xerces version in the classpath?  also, try copying xerces-2.9.0 into tomcat/common/endorsed, restart the webapp and see if that fixes things.

mike
Champ in-the-making
Champ in-the-making
I've doubled checked and I definiately have no other versions of xerces either in my classpath or contained in any jars.

I've added xerces-2.9.0 to the weblogic equivilent of tomcat/common/endorsed and still get the same problem.

The trace below shows it is now using the new version of xerces as one line has changed slightly (highlighted in bold)

08:36:16,691 DEBUG [app.servlet.UploadFileServlet] Uploading servlet servicing…
08:36:16,722 DEBUG [app.servlet.UploadFileServlet] Processing uploaded file: company-footer.xsd
08:36:16,726 DEBUG [app.servlet.UploadFileServlet] Temp file: /tmp/Alfresco/alfresco50971.upload created from upload filename: company-footer.xsd
08:36:16,726 DEBUG [app.servlet.UploadFileServlet] Sending back javascript response window.parent.upload_complete_helper('schema',{error: '${_UPLOAD_ERROR}', fileTypeImage: '${_FILE_TYPE_IMAGE}'})
08:36:16,839 DEBUG [bean.wcm.CreateFormWizard] getSchemaRootElementNameChoices(null) = 0
08:36:16,839 DEBUG [bean.wcm.CreateFormWizard] getSchemaRootElementNameChoices(null) = 0
08:36:16,841 DEBUG [bean.wcm.CreateFormWizard] schemaFileValueChanged(company-footer.xsd[/tmp/Alfresco/alfresco50971.upload])
08:36:16,868 ERROR [ui.common.Utils] unable to parse company-footer.xsd: null
java.lang.NullPointerException
        at org.alfresco.web.forms.xforms.SchemaUtil.parseSchema(SchemaUtil.java:219)
        at org.alfresco.web.bean.wcm.CreateFormWizard.schemaFileValueChanged(CreateFormWizard.java:612)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
        at javax.faces.component.UIInput.broadcast(UIInput.java:200)
        at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
        at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:132)
        at org.apache.myfaces.lifecycle.LifecycleImpl.applyRequestValues(LifecycleImpl.java:200)
        at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:71)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:105)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:73)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3243)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
08:36:16,870 DEBUG [bean.wcm.CreateFormWizard] getSchemaRootElementNameChoices(null) = 0
08:36:16,870 DEBUG [bean.wcm.CreateFormWizard] getSchemaRootElementNameChoices(null) = 0
08:36:16,871 DEBUG [bean.wcm.CreateFormWizard] getSchemaRootElementNameChoices(null) = 0
08:36:16,871 DEBUG [bean.wcm.CreateFormWizard] getSchemaRootElementNameChoices(null) = 0 



thanks,

Mike

arielb
Champ in-the-making
Champ in-the-making
i'm afraid i'm really not quite sure what's going on here - as i've never seen this and am unable to reproduce.  if you have access to the source tree, could you add a debuggin statment to confirm that the problem is with this line:
final DOMImplementationRegistry registry = (DOMImplementationLS)registry.getDOMImplementation("XML 1.0 LS 3.0");

meaning, can you confirm that the result of that is null?  if so - it is definitely something peculiar about your environment and i guess we'll have to set it up and try to reproduce it.