You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by qcfireball <qc...@yahoo.com> on 2007/08/13 21:01:22 UTC

Model 2 Deployment Problems

I am attempting to do a Model 2 deployment, but when I retrieve the
Repository like this:

        final InitialContext context     = new InitialContext();
        final Context environment = (Context)
context.lookup("java:comp/env");
        final Repository repository  = (Repository)
environment.lookup("jcr/repository");
        return repository;

I get the following error:

SEVERE: jsp: Error retrieving Repository JNDI Object jcr/repository
javax.naming.NamingException: Cannot create resource instance
at
org.apache.naming.factory.ResourceEnvFactory.getObjectInstance(ResourceEnvFactory.java:114)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)

I am using Tomcat 6.0.13, Jackrabbit 1.3

I followed the application howto and the model 2 howto, and tomcat starts up
with no errors in the logs.
-- 
View this message in context: http://www.nabble.com/Model-2-Deployment-Problems-tf4263029.html#a12131983
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Model 2 Deployment Problems

Posted by qcfireball <qc...@yahoo.com>.
I have finally figured out how to get this configured properly.  The resource
link must go in file: [Tomcat]/conf/context.xml - for availability in ALL
webapps.

-- 
View this message in context: http://www.nabble.com/Model-2-Deployment-Problems-tf4263029.html#a12145389
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Model 2 Deployment Problems

Posted by Anton Gavazuk <an...@gmail.com>.
Is resource existed in your jndi tree?


2007/8/13, sbarriba <sb...@yahoo.co.uk>:
>
> * Can you post your server config?
> * Worth setting up log4j at the app server level to debug out JackRabbit
> logging. For Tomcat 5 this is achieved by putting a log4j.xml in
> [Tomcat]/common/classes.
> * Is anything getting created in the configured "repHomeDir" (the
> repository
> directory)?
> Regards,
> Shaun
>
> -----Original Message-----
> From: qcfireball [mailto:qcfireball@yahoo.com]
> Sent: 13 August 2007 20:01
> To: users@jackrabbit.apache.org
> Subject: Model 2 Deployment Problems
>
>
> I am attempting to do a Model 2 deployment, but when I retrieve the
> Repository like this:
>
>         final InitialContext context     = new InitialContext();
>         final Context environment = (Context)
> context.lookup("java:comp/env");
>         final Repository repository  = (Repository)
> environment.lookup("jcr/repository");
>         return repository;
>
> I get the following error:
>
> SEVERE: jsp: Error retrieving Repository JNDI Object jcr/repository
> javax.naming.NamingException: Cannot create resource instance
> at
> org.apache.naming.factory.ResourceEnvFactory.getObjectInstance
> (ResourceEnvFa
> ctory.java:114)
> at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java
> :304)
> at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
> at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
> at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
> at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>
> I am using Tomcat 6.0.13, Jackrabbit 1.3
>
> I followed the application howto and the model 2 howto, and tomcat starts
> up
> with no errors in the logs.
> --
> View this message in context:
> http://www.nabble.com/Model-2-Deployment-Problems-tf4263029.html#a12131983
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>

RE: Model 2 Deployment Problems

Posted by qcfireball <qc...@yahoo.com>.
I will post my server config tomorrow when I get in to work.  I will also try
to get log4j configured for jackrabbit.  1) where do I get the log4j.xml
from?  Is it in the jackrabbit sources?  2) I am using Tomcat 6, so there is
no [Tomcat]/common/classes.  I will look into the new "config" for Tomcat 6
and see where this went.

I also forgot to mention, that I am trying to set this up on top of an
already created repository.  So, "repHomeDir" already has stuff in it.

In response to the other post on this topic, is there a way to see the JNDI
tree in tomcat?  Or would I have to code this myself?

Thanks.



sbarriba wrote:
> 
> * Can you post your server config?
> * Worth setting up log4j at the app server level to debug out JackRabbit
> logging. For Tomcat 5 this is achieved by putting a log4j.xml in
> [Tomcat]/common/classes.
> * Is anything getting created in the configured "repHomeDir" (the
> repository
> directory)?
> Regards,
> Shaun
> 
> -----Original Message-----
> From: qcfireball [mailto:qcfireball@yahoo.com] 
> Sent: 13 August 2007 20:01
> To: users@jackrabbit.apache.org
> Subject: Model 2 Deployment Problems
> 
> 
> I am attempting to do a Model 2 deployment, but when I retrieve the
> Repository like this:
> 
>         final InitialContext context     = new InitialContext();
>         final Context environment = (Context)
> context.lookup("java:comp/env");
>         final Repository repository  = (Repository)
> environment.lookup("jcr/repository");
>         return repository;
> 
> I get the following error:
> 
> SEVERE: jsp: Error retrieving Repository JNDI Object jcr/repository
> javax.naming.NamingException: Cannot create resource instance
> at
> org.apache.naming.factory.ResourceEnvFactory.getObjectInstance(ResourceEnvFa
> ctory.java:114)
> at
> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
> at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
> at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
> at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
> at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
> 
> I am using Tomcat 6.0.13, Jackrabbit 1.3
> 
> I followed the application howto and the model 2 howto, and tomcat starts
> up
> with no errors in the logs.
> -- 
> View this message in context:
> http://www.nabble.com/Model-2-Deployment-Problems-tf4263029.html#a12131983
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Model-2-Deployment-Problems-tf4263029.html#a12135633
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


RE: Model 2 Deployment Problems

Posted by qcfireball <qc...@yahoo.com>.
Here is my server config file:


<Server port="8005" shutdown="SHUTDOWN">

  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
  <!--Initialize Jasper prior to webapps are loaded. Documentation at
/docs/jasper-howto.html -->
  <Listener className="org.apache.catalina.core.JasperListener" />
  <!-- JMX Support for the Tomcat server. Documentation at
/docs/non-existent.html -->
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
/>
  <Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
    <!-- JCR:Resource | Definition of JCR Repository Resource -->
    <Resource name="jcr/globalRepository"
          auth="Container"
          type="javax.jcr.Repository"
         
factory="org.apache.jackrabbit.core.jndi.BindableRepositoryFactory"
          configFilePath="/opt/Apps/tomcat/jackrabbit/repository.xml"
          repHomeDir="/opt/Apps/tomcat/jackrabbit"/>

  </GlobalNamingResources>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container", 
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   -->
  <Service name="Catalina">
  
    <!--The connectors can use a shared executor, you can define one or more
named thread pools-->
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" 
        maxThreads="150" minSpareThreads="4"/>
    -->
    
    
    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking &
non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    -->           
    <!-- Define a SSL HTTP/1.1 Connector on port 8443
         This connector uses the JSSE configuration, when using APR, the 
         connector should be using the OpenSSL style configuration
         described in the APR documentation -->
    <!--
    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
    -->

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />


    <!-- An Engine represents the entry point (within Catalina) that
processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes
them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">         
    --> 
    <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->        

      <!-- The request dumper valve dumps useful debugging information about
           the request and response data received and sent by Tomcat.
           Documentation at: /docs/config/valve.html -->
      <!--
      <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
      -->

      <!-- This Realm uses the UserDatabase configured in the global JNDI
           resources under the key "UserDatabase".  Any edits
           that are performed against this UserDatabase are immediately
           available for use by the Realm.  -->
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>

      <!-- Define the default virtual host
           Note: XML Schema validation will not work with Xerces 2.2.
       -->
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

        <!-- SingleSignOn valve, share authentication between web
applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"  
               prefix="localhost_access_log." suffix=".txt" pattern="common"
resolveHosts="false"/>
        -->
        <!-- JCR:Resource | Link for JCR Repository Resource -->
              <ResourceLink name="jcr/repo"
                            global="jcr/globalRepository"
                            type="javax.jcr.Repository"/>
      </Host>
    </Engine>
  </Service>
</Server>



* Can you post your server config?
* Worth setting up log4j at the app server level to debug out JackRabbit
logging. For Tomcat 5 this is achieved by putting a log4j.xml in
[Tomcat]/common/classes.
* Is anything getting created in the configured "repHomeDir" (the repository
directory)?
Regards,
Shaun

-- 
View this message in context: http://www.nabble.com/Model-2-Deployment-Problems-tf4263029.html#a12142564
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


RE: Model 2 Deployment Problems

Posted by sbarriba <sb...@yahoo.co.uk>.
* Can you post your server config?
* Worth setting up log4j at the app server level to debug out JackRabbit
logging. For Tomcat 5 this is achieved by putting a log4j.xml in
[Tomcat]/common/classes.
* Is anything getting created in the configured "repHomeDir" (the repository
directory)?
Regards,
Shaun

-----Original Message-----
From: qcfireball [mailto:qcfireball@yahoo.com] 
Sent: 13 August 2007 20:01
To: users@jackrabbit.apache.org
Subject: Model 2 Deployment Problems


I am attempting to do a Model 2 deployment, but when I retrieve the
Repository like this:

        final InitialContext context     = new InitialContext();
        final Context environment = (Context)
context.lookup("java:comp/env");
        final Repository repository  = (Repository)
environment.lookup("jcr/repository");
        return repository;

I get the following error:

SEVERE: jsp: Error retrieving Repository JNDI Object jcr/repository
javax.naming.NamingException: Cannot create resource instance
at
org.apache.naming.factory.ResourceEnvFactory.getObjectInstance(ResourceEnvFa
ctory.java:114)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)

I am using Tomcat 6.0.13, Jackrabbit 1.3

I followed the application howto and the model 2 howto, and tomcat starts up
with no errors in the logs.
-- 
View this message in context:
http://www.nabble.com/Model-2-Deployment-Problems-tf4263029.html#a12131983
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.