I tried to set up the jackrabbit in tomcat 5.0.28, but i get "[Fatal
Error] :1:1: Content is not allowed in prolog." error when i tried to
lookup a repository. 
I have tried several different methods of changing the configuration,
but still the same error occurs.  Please, can anyone help and advice?
Thank you.
 
Below are my configuration setting.


in server.xml of tomcat:

<Context path="/rabbittest" docBase="rabbittest" debug="0"
reloadable="true" crossContext="true">
 
   <Resource name="jcr/repository" auth="Container"
type="javax.jcr.Repository"/>
  
   <ResourceParams name="jcr/repository">
     <parameter>
       <name>factory</name>
 
<value>org.apache.jackrabbit.core.jndi.BindableRepositoryFactory</value>
     </parameter>
     <parameter>
       <name>configFilePath</name>
 
<value>F:/Java/jakarta-tomcat-5.0.28/webapps/rabbittest/docMan</value>
     </parameter>
     <parameter>
       <name>repHomeDir</name>
 
<value>F:/Java/jakarta-tomcat-5.0.28/webapps/rabbittest/docMan/rep</valu
e>
     </parameter>
   </ResourceParams>

</Context>


in web.xml:
<resource-env-ref>
   <description>Content Repository</description>
   <resource-env-ref-name>jcr/repository</resource-env-ref-name>
   <resource-env-ref-type>javax.jcr.Repository</resource-env-ref-type>
</resource-env-ref>

in my servlet java class for looking up repository:
import ....
public class RabbitServlet extends HttpServlet {
 public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
 
  PrintWriter out = res.getWriter();
  try  {
   out.println ("testing getting repository");
   InitialContext context = new InitialContext();
   Context environment = (Context) context.lookup("java:comp/env");
   Repository repository = (Repository)
environment.lookup("jcr/repository");
   System.out.println ("after getting repository");
   out.flush();
  }
  catch (Exception e)  {
   throw new ServletException ("Unable to output file.");
  }
  finally  {
   try {
    out.close ();
   }
   catch (Exception e) {
   }
  }
 }
     ......
}

error printstacktrace:
[Fatal Error] :1:1: Content is not allowed in prolog.
2006-4-6 9:15:38 org.apache.naming.NamingContext lookup
??: Unexpected exception resolving reference
org.apache.jackrabbit.core.config.ConfigurationException: Configuration
file syntax error.: Content is not allowed in pr
olog.: Content is not allowed in prolog.
        at
org.apache.jackrabbit.core.config.ConfigurationParser.parseXML(Configura
tionParser.java:548)
        at
org.apache.jackrabbit.core.config.ConfigurationParser.parseRepositoryCon
fig(ConfigurationParser.java:200)
        at
org.apache.jackrabbit.core.config.RepositoryConfig.create(RepositoryConf
ig.java:139)
        at
org.apache.jackrabbit.core.config.RepositoryConfig.create(RepositoryConf
ig.java:82)
        at
org.apache.jackrabbit.core.jndi.BindableRepository.init(BindableReposito
ry.java:127)
        at
org.apache.jackrabbit.core.jndi.BindableRepository.create(BindableReposi
tory.java:115)
        at
org.apache.jackrabbit.core.jndi.BindableRepositoryFactory.getObjectInsta
nce(BindableRepositoryFactory.java:63)
        at
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFact
ory.java:129)
        at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
        at
org.apache.naming.NamingContext.lookup(NamingContext.java:791)
        at
org.apache.naming.NamingContext.lookup(NamingContext.java:138)
        at
org.apache.naming.NamingContext.lookup(NamingContext.java:779)
        at
org.apache.naming.NamingContext.lookup(NamingContext.java:151)
        at rabbit.RabbitServlet.doPost(RabbitServlet.java:35)
        at rabbit.RabbitServlet.doGet(RabbitServlet.java:55)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:237)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:157)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:214)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
ntext.java:104)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
20)
        at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardCon
textValve.java:198)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:152)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
ntext.java:104)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
20)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:137)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
ntext.java:104)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:118)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
ntext.java:102)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
20)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:109)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
ntext.java:104)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
20)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
        at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:79
9)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
onnection(Http11Protocol.java:705)
        at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:57
7)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
..java:683)
        at java.lang.Thread.run(Thread.java:536)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in
prolog.
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
Source)
        at
org.apache.jackrabbit.core.config.ConfigurationParser.parseXML(Configura
tionParser.java:542)
        ... 40 more
org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
Source)
        at
org.apache.jackrabbit.core.config.ConfigurationParser.parseXML(Configura
tionParser.java:542)
        at
org.apache.jackrabbit.core.config.ConfigurationParser.parseRepositoryCon
fig(ConfigurationParser.java:200)
        at
org.apache.jackrabbit.core.config.RepositoryConfig.create(RepositoryConf
ig.java:139)
        at
org.apache.jackrabbit.core.config.RepositoryConfig.create(RepositoryConf
ig.java:82)
        at
org.apache.jackrabbit.core.jndi.BindableRepository.init(BindableReposito
ry.java:127)
        at
org.apache.jackrabbit.core.jndi.BindableRepository.create(BindableReposi
tory.java:115)
        at
org.apache.jackrabbit.core.jndi.BindableRepositoryFactory.getObjectInsta
nce(BindableRepositoryFactory.java:63)
        at
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFact
ory.java:129)
        at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
        at
org.apache.naming.NamingContext.lookup(NamingContext.java:791)
        at
org.apache.naming.NamingContext.lookup(NamingContext.java:138)
        at
org.apache.naming.NamingContext.lookup(NamingContext.java:779)
        at
org.apache.naming.NamingContext.lookup(NamingContext.java:151)
        at rabbit.RabbitServlet.doPost(RabbitServlet.java:35)
        at rabbit.RabbitServlet.doGet(RabbitServlet.java:55)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:237)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:157)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:214)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
ntext.java:104)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
20)
        at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardCon
textValve.java:198)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:152)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
ntext.java:104)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
20)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:137)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
ntext.java:104)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:118)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
ntext.java:102)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
20)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:109)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
ntext.java:104)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
20)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
        at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:79
9)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
onnection(Http11Protocol.java:705)
        at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:57
7)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
..java:683)
        at java.lang.Thread.run(Thread.java:536)

[This e-mail is confidential and may be priviledged. If you are not the
intended recipient, please kindly notify us immediately and delete the message
from your system; please do not copy or use it for any purpose, nor disclose
its contents to any other person. Thank you.]
---ST Electronics Group---

Reply via email to