You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by bpares <bp...@indra.es> on 2007/03/16 10:05:19 UTC

Cannot insert null ("SYSTEM"."REP_FSENTRY"."FSENTRY_NAME")

Hi, i'm trying to initiate a connection with oracle from my java program. I
have been modifying repository.xml but when  i run 

Repository repository = new TransientRepository();
    		session = repository.login(
                    new SimpleCredentials(username,
password.toCharArray()));

i have this exception:

ERROR - failed to create folder entry: /
java.sql.SQLException: ORA-01400: no se puede realizar una inserciĆ³n NULL en
("SYSTEM"."REP_FSENTRY"."FSENTRY_NAME")

	at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
	at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
	at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
	at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1451)
	at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:862)
	at
oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1846)
	at
oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1771)
	at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2361)
	at
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:422)
	at
org.apache.jackrabbit.core.fs.db.DbFileSystem.createDeepFolder(DbFileSystem.java:1306)
	at
org.apache.jackrabbit.core.fs.db.DbFileSystem.verifyRoodExists(DbFileSystem.java:1279)
	at
org.apache.jackrabbit.core.fs.db.DbFileSystem.init(DbFileSystem.java:363)
	at
org.apache.jackrabbit.core.fs.db.OracleFileSystem.init(OracleFileSystem.java:109)
	at
org.apache.jackrabbit.core.config.FileSystemConfig.init(FileSystemConfig.java:57)
	at
org.apache.jackrabbit.core.config.RepositoryConfig.init(RepositoryConfig.java:271)
	at
org.apache.jackrabbit.core.config.RepositoryConfig.create(RepositoryConfig.java:141)
	at
org.apache.jackrabbit.core.config.RepositoryConfig.create(RepositoryConfig.java:83)
	at
org.apache.jackrabbit.core.TransientRepository$2.getRepository(TransientRepository.java:240)
	at
org.apache.jackrabbit.core.TransientRepository.startRepository(TransientRepository.java:261)
	at
org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:329)
	at
org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:359)
	at adap.FirstHop.loginJackRabbit(FirstHop.java:55)
	at adap.FirstHop.main(FirstHop.java:37)
ERROR - failed to initialize file system
org.apache.jackrabbit.core.fs.FileSystemException: failed to create folder
entry: /
	at
org.apache.jackrabbit.core.fs.db.DbFileSystem.createDeepFolder(DbFileSystem.java:1310)
	at
org.apache.jackrabbit.core.fs.db.DbFileSystem.verifyRoodExists(DbFileSystem.java:1279)
	at
org.apache.jackrabbit.core.fs.db.DbFileSystem.init(DbFileSystem.java:363)
	at
org.apache.jackrabbit.core.fs.db.OracleFileSystem.init(OracleFileSystem.java:109)
	at
org.apache.jackrabbit.core.config.FileSystemConfig.init(FileSystemConfig.java:57)
	at
org.apache.jackrabbit.core.config.RepositoryConfig.init(RepositoryConfig.java:271)
	at
org.apache.jackrabbit.core.config.RepositoryConfig.create(RepositoryConfig.java:141)
	at
org.apache.jackrabbit.core.config.RepositoryConfig.create(RepositoryConfig.java:83)
	at
org.apache.jackrabbit.core.TransientRepository$2.getRepository(TransientRepository.java:240)
	at
org.apache.jackrabbit.core.TransientRepository.startRepository(TransientRepository.java:261)
	at
org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:329)
	at
org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:359)
	at adap.FirstHop.loginJackRabbit(FirstHop.java:55)
	at adap.FirstHop.main(FirstHop.java:37)
Caused by: java.sql.SQLException: ORA-01400: no se puede realizar una
inserciĆ³n NULL en ("SYSTEM"."REP_FSENTRY"."FSENTRY_NAME")

if its helps, i show here my repositoy.xml

<Repository>


    <!--
        virtual file system where the repository stores global state
        (e.g. registered namespaces, custom node types, etc.)
    -->
		<FileSystem class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">
						<param name="url"
value="jdbc:oracle:thin://@192.168.12.100:1521:simge"/>
                <param name="user" value="system"/>
                <param name="password" value="simgeume"/>
                <param name="schemaObjectPrefix" value="rep_"/>
    </FileSystem>

    
    <!--
        security configuration
    -->
    <Security appName="Jackrabbit">
        <!--
            access manager:
            class: FQN of class implementing the AccessManager interface
        -->
        <AccessManager
class="org.apache.jackrabbit.core.security.SimpleAccessManager">
            <!-- <param name="config" value="${rep.home}/access.xml"/> -->
        </AccessManager>

        <LoginModule
class="org.apache.jackrabbit.core.security.SimpleLoginModule">
           <!-- anonymous user name ('anonymous' is the default value) -->
           <param name="anonymousId" value="anonymous"/>
           <!--
              default user name to be used instead of the anonymous user
              when no login credentials are provided (unset by default)
           -->
           <!-- <param name="defaultUserId" value="superuser"/> -->
        </LoginModule>
    </Security>

    <!--
        location of workspaces root directory and name of default workspace
    -->
    <Workspaces rootPath="${rep.home}/workspaces"
defaultWorkspace="default"/>
    <!--
        workspace configuration template:
        used to create the initial workspace if there's no workspace yet
    -->
    <!--<Workspace name="${wsp.name}">-->
    <Workspace name="rep">
        <!--
            virtual file system of the workspace:
            class: FQN of class implementing the FileSystem interface
        -->
        <!--<FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${wsp.home}"/>
        </FileSystem>-->
        
        <FileSystem
class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">
					<param name="url"
value="jdbc:oracle:thin://@192.168.12.100:1521:simge"/>
                <param name="user" value="system"/>
                <param name="password" value="simgeume"/>
                <param name="schemaObjectPrefix" value="rep_"/>
    		</FileSystem>

        <!--
            persistence manager of the workspace:
            class: FQN of class implementing the PersistenceManager
interface
        -->
        <PersistenceManager
class="org.apache.jackrabbit.core.state.db.OraclePersistenceManager">
					    	<param name="url"
value="jdbc:oracle:thin://@192.168.12.100:1521:simge"/>
                <param name="user" value="system"/>
                <param name="password" value="simgeume"/>
                <param name="schemaObjectPrefix" value="${wsp.name}_"/>
                <!--<param name="schemaObjectPrefix" value="rep_"/>-->
                <param name="externalBLOBs" value="false"/>
         </PersistenceManager> 

        
        
        <!--
            Search index and the file system it uses.
            class: FQN of class implementing the QueryHandler interface
        -->
        <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <!--<param name="path" value="${wsp.home}/index"/>-->
            <param name="path" value="rep/index"/>
        </SearchIndex>
    </Workspace>

    <!--
        Configures the versioning
    -->
    <Versioning rootPath="${rep.home}/version">
        <!--
            Configures the filesystem to use for versioning for the
respective
            persistence manager
        -->
        
         <FileSystem
class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">
								<param name="url"
value="jdbc:oracle:thin://@192.168.12.100:1521:simge"/>
                <param name="user" value="system"/>
                <param name="password" value="simgeume"/>
                <param name="schemaObjectPrefix" value="rep_"/>
    		</FileSystem>
        
        <!--
            Configures the persistence manager to be used for persisting
version state.
            Please note that the current versioning implementation is based
on
            a 'normal' persistence manager, but this could change in future
            implementations.
        -->
        <PersistenceManager
class="org.apache.jackrabbit.core.state.db.OraclePersistenceManager">
					    	<param name="url"
value="jdbc:oracle:thin://@192.168.12.100:1521:simge"/>
                <param name="user" value="system"/>
                <param name="password" value="simgeume"/>
                <param name="schemaObjectPrefix" value="rep_"/>
                <!--<param name="schemaObjectPrefix"
value="${wsp.name}_"/>-->
                <param name="externalBLOBs" value="false"/>
         </PersistenceManager> 
    </Versioning>
    
    

    <!--
        Search index for content that is shared repository wide
        (/jcr:system tree, contains mainly versions)
    -->
    <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
        <param name="path" value="${rep.home}/repository/index"/>
    </SearchIndex>
</Repository>

what am i missing?

thanks!!

-- 
View this message in context: http://www.nabble.com/Cannot-insert-null-%28%22SYSTEM%22.%22REP_FSENTRY%22.%22FSENTRY_NAME%22%29-tf3413326.html#a9510888
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Cannot insert null ("SYSTEM"."REP_FSENTRY"."FSENTRY_NAME")

Posted by bpares <bp...@indra.es>.
HI Stefan...this is very strange. First of all I run the example without any
xml and i see that it automatically create the repository folder, the
repository xml and derby.log. Then, i delete all these content and run the
example
with the xml that you gave to me. And i have the same error i reported to
you. And also the program didn't create the derby.log just only create the
folder repository.

this is the repository xml:

<?xml version="1.0"?>
<Repository>
    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
        <param name="path" value="${rep.home}/repository"/>
    </FileSystem>

    <Security appName="Jackrabbit">
        <AccessManager
class="org.apache.jackrabbit.core.security.SimpleAccessManager" />
        <LoginModule
class="org.apache.jackrabbit.core.security.SimpleLoginModule" />
    </Security>

    <Workspaces rootPath="${rep.home}/workspaces"
defaultWorkspace="default"/>

    <Workspace name="${wsp.name}">
        <FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${wsp.home}"/>
        </FileSystem>

        <PersistenceManager
class="org.apache.jackrabbit.core.state.db.OraclePersistenceManager">
            <param name="url"
value="jdbc:oracle:thin://@192.168.12.112:1521:simge"/>
            <param name="user" value="repo"/>
            <param name="password" value="repo"/>
            <param name="schemaObjectPrefix" value="${wsp.name}_"/>
            <param name="externalBLOBs" value="false"/>
        </PersistenceManager>

        <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/index"/>
        </SearchIndex>
    </Workspace>

    <Versioning rootPath="${rep.home}/version">
        <FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${rep.home}/version"/>
        </FileSystem>

        <PersistenceManager
class="org.apache.jackrabbit.core.state.db.OraclePersistenceManager">
            <param name="url"
value="jdbc:oracle:thin://@192.168.12.112:1521:simge"/>
            <param name="user" value="repo"/>
            <param name="password" value="repo"/>
            <param name="schemaObjectPrefix" value="version_"/>
            <param name="externalBLOBs" value="false"/>
        </PersistenceManager>
    </Versioning>
</Repository>



Stefan Guggisberg wrote:
> 
> On 3/16/07, bpares <bp...@indra.es> wrote:
>>
>> Hi Stefan, i did the new schema in the DB and tried:
>>
>> try{
>>  Repository repository = new TransientRepository();
>>  session = repository.login(new SimpleCredentials(username,
>> password.toCharArray()));
>> }catch(Exception e){
>>  e.printStackTrace();
>> }finally {
>>  System.out.println("Closing session.");
>>  session.logout();
>> }
>>
>> and i when i executes login, it goes directilly to finally, try to logout
>> and gives to me a NullPointerException
> 
> the login call must have thrown an exception; what's that exception?
> 
> there should be more information in the log file, did you check the log
> file?
> 
> cheers
> stefan
> 
>>
>> so when i execute again i received:
>>
>> WARN - Existing lock file at
>> D:\SIMGE_REPO\JackRabbitProject\repository\.lock deteteced. Repository
>> was
>> not shut down properly.
>> Closing session.
>> Exception in thread "main" java.lang.NullPointerException
>>         at adap.FirstHop.main(FirstHop.java:48)
>>
>> thanks!!
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Cannot-insert-null-%28%22SYSTEM%22.%22REP_FSENTRY%22.%22FSENTRY_NAME%22%29-tf3413326.html#a9513760
>> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Cannot-insert-null-%28%22SYSTEM%22.%22REP_FSENTRY%22.%22FSENTRY_NAME%22%29-tf3413326.html#a9547697
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Cannot insert null ("SYSTEM"."REP_FSENTRY"."FSENTRY_NAME")

Posted by Stefan Guggisberg <st...@gmail.com>.
On 3/16/07, bpares <bp...@indra.es> wrote:
>
> Hi Stefan, i did the new schema in the DB and tried:
>
> try{
>  Repository repository = new TransientRepository();
>  session = repository.login(new SimpleCredentials(username,
> password.toCharArray()));
> }catch(Exception e){
>  e.printStackTrace();
> }finally {
>  System.out.println("Closing session.");
>  session.logout();
> }
>
> and i when i executes login, it goes directilly to finally, try to logout
> and gives to me a NullPointerException

the login call must have thrown an exception; what's that exception?

there should be more information in the log file, did you check the log file?

cheers
stefan

>
> so when i execute again i received:
>
> WARN - Existing lock file at
> D:\SIMGE_REPO\JackRabbitProject\repository\.lock deteteced. Repository was
> not shut down properly.
> Closing session.
> Exception in thread "main" java.lang.NullPointerException
>         at adap.FirstHop.main(FirstHop.java:48)
>
> thanks!!
>
> --
> View this message in context: http://www.nabble.com/Cannot-insert-null-%28%22SYSTEM%22.%22REP_FSENTRY%22.%22FSENTRY_NAME%22%29-tf3413326.html#a9513760
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>

Re: Cannot insert null ("SYSTEM"."REP_FSENTRY"."FSENTRY_NAME")

Posted by bpares <bp...@indra.es>.
Hi Stefan, i did the new schema in the DB and tried:

try{
 Repository repository = new TransientRepository();
 session = repository.login(new SimpleCredentials(username,
password.toCharArray()));
}catch(Exception e){
 e.printStackTrace();
}finally {
 System.out.println("Closing session.");
 session.logout();            
}

and i when i executes login, it goes directilly to finally, try to logout
and gives to me a NullPointerException

so when i execute again i received:

WARN - Existing lock file at
D:\SIMGE_REPO\JackRabbitProject\repository\.lock deteteced. Repository was
not shut down properly.
Closing session.
Exception in thread "main" java.lang.NullPointerException
	at adap.FirstHop.main(FirstHop.java:48)

thanks!!

-- 
View this message in context: http://www.nabble.com/Cannot-insert-null-%28%22SYSTEM%22.%22REP_FSENTRY%22.%22FSENTRY_NAME%22%29-tf3413326.html#a9513760
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Cannot insert null ("SYSTEM"."REP_FSENTRY"."FSENTRY_NAME")

Posted by Stefan Guggisberg <st...@gmail.com>.
hi,

i noticed a couple of issues with your configuration.

1. is there a specific reason for using OracleFileSystem
instead of LocalFileSystem? generally i wouldn't recommend using
the db file systems as it is a rather advanced setup with some
potential tripping hazards.

there are some legitimate use cases for using the db file system
implementations but in most cases you don't need them.

2. you used conflicting/hardcoded values for the "schemaObjectPrefix" parameter.
schema objects used by a specific persistence manager/file system instance are
prefixed with this value in oder to avoid name collisions.

3. the workspace name in your workspace template element is hardcoded;
it should be the placeholder variable "$wsp.name".

4. you used the oracle "system" account. it's always a good idea to use
a dedicated user/schema per repository instance.



i appended a sample repository.xml that you can use. i used the
jdbc url from your config. however, the sample assumes an oracle
user/schema "repo" with password "repo".

try the following:

- delete the contents of your repository home directory (incl. subdirs)
- copy the appended repository.xml to your repository home directory
- create an oracle user/schema with name "repo" and password "repo"
- start your test application


cheers
stefan


sample repository.xml:


<?xml version="1.0"?>
<Repository>
    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
        <param name="path" value="${rep.home}/repository"/>
    </FileSystem>

    <Security appName="Jackrabbit">
        <AccessManager
class="org.apache.jackrabbit.core.security.SimpleAccessManager" />
        <LoginModule
class="org.apache.jackrabbit.core.security.SimpleLoginModule" />
    </Security>

    <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>

    <Workspace name="${wsp.name}">
        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${wsp.home}"/>
        </FileSystem>

        <PersistenceManager
class="org.apache.jackrabbit.core.state.db.OraclePersistenceManager">
            <param name="url"
value="jdbc:oracle:thin://@192.168.12.112:1521:simge"/>
            <param name="user" value="repo"/>
            <param name="password" value="repo"/>
            <param name="schemaObjectPrefix" value="${wsp.name}_"/>
            <param name="externalBLOBs" value="false"/>
        </PersistenceManager>

        <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/index"/>
        </SearchIndex>
    </Workspace>

    <Versioning rootPath="${rep.home}/version">
        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${rep.home}/version"/>
        </FileSystem>

        <PersistenceManager
class="org.apache.jackrabbit.core.state.db.OraclePersistenceManager">
            <param name="url"
value="jdbc:oracle:thin://@192.168.12.112:1521:simge"/>
            <param name="user" value="repo"/>
            <param name="password" value="repo"/>
            <param name="schemaObjectPrefix" value="version_"/>
            <param name="externalBLOBs" value="false"/>
        </PersistenceManager>
    </Versioning>
</Repository>