[Building Sakai] crashes on KnowledgeBase tool

Liu, Peter peter.liu at yale.edu
Wed Jun 29 19:55:34 PDT 2011


Roland,

Thanks for the prompt response.  I have tried to add the ‘stax’ dependence into the impl pom.xml and it is still not working with java 5 for sakai 2.6.  Actually, it has no problem to compile the tool under java 5 even without the ‘stax’ dependence.

I also have another question: is this tool requiring Spring 2.5?  I have tried to run the tool by using java 6 for sakai 2.6 and it gives me the following error (However, the tool shows up in application and it crashes when you click the tool to the first page).  Sakai-2.6 is running on spring 2.0.6 version.

Any suggestion?

Thanks a lot!
Peter Liu

- - - - - - - - - - - - - -Error - - - - - -
2011-06-29 22:17:52,744  INFO main org.apache.catalina.startup.HostConfig - Deploying web application archive edia-sakai-knowledgebase-tool.war
2011-06-29 22:17:57,278  INFO main org.sakaiproject.util.ToolListener - registering tools from resource: /tools/edia.sakai.knowledgebase.xml
2011-06-29 22:17:57,289  INFO main org.sakaiproject.util.ToolListener - registering tools from resource: /tools/edia.sakai.knowledgebase.help.xml
2011-06-29 22:17:57,296  INFO main org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/edia-sakai-knowledgebase-tool] - Initializing Spring root WebApplicationContext
2011-06-29 22:17:57,347 ERROR main org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.context.ApplicationContextException: Custom context class [org.springframework.web.context.support.XmlWebApplicationContext] is not of type [org.springframework.web.context.ConfigurableWebApplicationContext]
               at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230)
               at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
               at org.sakaiproject.component.impl.ContextLoader.initWebApplicationContext(ContextLoader.java:64)
               at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
               at org.sakaiproject.util.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:56)
               at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
               at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
               at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
               at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
               at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
               at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:831)
               at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:720)
               at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
               at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
               at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
               at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
               at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
               at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
               at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
               at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
               at org.apache.catalina.core.StandardService.start(StandardService.java:448)
               at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
               at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
               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:597)
               at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
               at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
2011-06-29 22:17:57,371 ERROR main org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/edia-sakai-knowledgebase-tool] - Exception sending context initialized event to listener instance of class org.sakaiproject.util.ContextLoaderListener
org.springframework.context.ApplicationContextException: Custom context class [org.springframework.web.context.support.XmlWebApplicationContext] is not of type [org.springframework.web.context.ConfigurableWebApplicationContext]
               at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230)
               at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)


From: Roland Groen [mailto:roland at edia.nl]
Sent: Wednesday, June 29, 2011 5:17 PM
To: Liu, Peter
Cc: sakai-dev at collab.sakaiproject.org
Subject: Re: [Building Sakai] crashes on KnowledgeBase tool

Hi Peter,

I've done some testing and it appears it is a JDK issue in relation to the stax api. Sakai 2.7+ runs on JDK 1.6 which includes a stax parser, JDK 1.5 does not. I've created a test class:


import javax.xml.stream.XMLInputFactory;



public class StaxTest {

           public static void main(String[] args) {

                      XMLInputFactory factory = XMLInputFactory.newInstance();

                      System.out.println(factory.toString());

    }

}


If I run and compile this with JDK 1.6 I get:



# export JAVA_HOME=/usr/java/jdk1.6.0_21/
# export PATH=$JAVA_HOME/bin:$PATH
# javac StaxTest.java
# java StaxTest
com.sun.xml.internal.stream.XMLInputFactoryImpl at 45bab50a

If I switch to JDK 1.5 I need the stax-api, otherwise it won't compile:

# export JAVA_HOME=/usr/java/jdk1.5.0_19/
# export PATH=$JAVA_HOME/bin:$PATH
# javac -classpath stax-api-1.0.1.jar  StaxTest.java
# java -classpath stax-api-1.0.1.jar:.  StaxTest
Exception in thread "main" javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.MXParserFactory not found
     at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:72)
     at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:178)
     at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92)
     at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:136)
     at StaxTest.main(StaxTest.java:6)


Now I get the same error as you do. It turns out that it needs a stax implementation. You pointed to sjsxp:

# java -classpath stax-api-1.0.1.jar:sjsxp-1.0.1.jar:.  StaxTest
com.sun.xml.stream.ZephyrParserFactory at 768965fb

But there is also stax itself:

[root at kantoor ~]# java -classpath stax-api-1.0.1.jar:stax-1.2.0.jar:.  StaxTest
com.bea.xml.stream.MXParserFactory at 3e7ffe01

This issue can be resolved by adding one of both to the pom.xml of the impl/pom.xm file. I'd personally go for stax:




<dependency>

    <groupId>stax</groupId>

    <artifactId>stax</artifactId>

    <version>1.2.0</version>

</dependency>

Please let me know if this works for you. If it does, I'll create a 2.6 branch and add the dependency to the impl/pom.xml

With kind regards,

--
Roland M.S. Groen
roland at edia.nl<mailto:roland at edia.nl>

Edia - Educatie Technologie
Korte Prinsengracht 42 hs | 1013 GT Amsterdam
T 020 716 36 12 | F 020 716 36 13 | M 06 2423 09 06 | www.edia.nl<http://www.edia.nl/>


2011/6/29 Liu, Peter <peter.liu at yale.edu<mailto:peter.liu at yale.edu>>
Hi Roland,

I am very interesting on your Sakai-Contrib tool: Knowledgebase and I am trying to plugging into our Sakai 2-6-x instance.

I have downloaded your 2.7.x version and have successfully built it for Sakai-2-6-x version after modifying the pom.xml file.

However, it crashes on the tomcat 5.5.26 when I am trying to run it in Sakai 2.6.x.  The following error is shown in the log file below.

It seems that it look for sjsxp.jar, which is missing.  Do you have any idea how to solve it?

Thanks a lot!
Peter Liu

Yale University, New Haven, CT



- - - - - - - - -  - Error message  - - - - - - - -  -
2011-06-29 19:20:21,775  INFO main org.apache.solr.request.XSLTResponseWriter - xsltCacheLifetimeSeconds=5
2011-06-29 19:20:21,853  INFO main org.apache.solr.core.RequestHandlers - created standard: solr.SearchHandler
2011-06-29 19:20:21,854  INFO main org.apache.solr.core.RequestHandlers - created dismax: solr.SearchHandler
2011-06-29 19:20:21,854  INFO main org.apache.solr.core.RequestHandlers - created partitioned: solr.SearchHandler
2011-06-29 19:20:21,854  INFO main org.apache.solr.core.RequestHandlers - created /spellCheckCompRH: solr.SearchHandler
2011-06-29 19:20:21,866 ERROR main org.sakaiproject.util.NoisierDefaultListableBeanFactory - Failed to preinstantiate the singleton named nl.edia.knowledgebase.dao.KnowledgeBaseDaoTarget. Destroying all Spring beans.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nl.edia.knowledgebase.dao.KnowledgeBaseDaoTarget' defined in URL [jar:file:C:/tomcat-5.5.26-sakai26/components/edia-sakai-knowledgebase-pack/WEB-INF/lib/edia-sakai-knowledgebase-impl-0.1.jar!/nl/edia/knowledgebase/dao/kb-hibernate.xml]: Cannot resolve reference to bean 'nl.edia.knowledgebase.logic.SearchService' while setting bean property 'searchService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nl.edia.knowledgebase.logic.SearchService' defined in URL [jar:file:C:/tomcat-5.5.26-sakai26/components/edia-sakai-knowledgebase-pack/WEB-INF/lib/edia-sakai-knowledgebase-impl-0.1.jar!/nl/edia/knowledgebase/logic/kb-services.xml]: Invocation of init method failed; nested exception is javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.MXParserFactory not found
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nl.edia.knowledgebase.logic.SearchService' defined in URL [jar:file:C:/tomcat-5.5.26-sakai26/components/edia-sakai-knowledgebase-pack/WEB-INF/lib/edia-sakai-knowledgebase-impl-0.1.jar!/nl/edia/knowledgebase/logic/kb-services.xml]: Invocation of init method failed; nested exception is javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.MXParserFactory not found
Caused by:
javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.MXParserFactory not found
      at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:72)
      at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:178)
      at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92)
      at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:136)
      at org.apache.solr.handler.XmlUpdateRequestHandler.init(XmlUpdateRequestHandler.java:82)
      at org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:158)
      at org.apache.solr.core.SolrCore.<init>(SolrCore.java:556)
      at org.apache.solr.core.CoreContainer.create(CoreContainer.java:428)
      at nl.edia.knowledgebase.logic.SearchServiceImpl.init(SearchServiceImpl.java:272)
      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.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1240)


_______________________________________________
sakai-dev mailing list
sakai-dev at collab.sakaiproject.org<mailto:sakai-dev at collab.sakaiproject.org>
http://collab.sakaiproject.org/mailman/listinfo/sakai-dev

TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org<mailto:sakai-dev-unsubscribe at collab.sakaiproject.org> with a subject of "unsubscribe"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20110630/1f8182b2/attachment.html 


More information about the sakai-dev mailing list