[Building Sakai] crashes on KnowledgeBase tool

Roland Groen roland at edia.nl
Wed Jun 29 14:16:47 PDT 2011


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

*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



2011/6/29 Liu, Peter <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
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to
> 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/20110629/fa0872d0/attachment.html 


More information about the sakai-dev mailing list