[opencms-dev] exceptions importing a ZIP file into an Oracle DB

Mariano Barcia mariano.barcia at colaborativa.net
Mon Dec 22 06:07:02 CET 2003


Hello all,

We are having a problem importing a large ZIP file of about 130 MBs,
using the "Database management" functionality from the Administration
View. The ZIP file is the result of a MySQL 4 export and we had no
problems importing this file back into another MySQL 4 database, but we
are having problems trying to import it into an Oracle 8.1.7 database.
The import procedure throws exceptions for many of the files being
imported, but many of the files *do* get imported OK.

I detail one stack trace of the exceptions given, as an example:

( 533 / 7951 ) Importing /kdb/customers/es/di/solutions/159353.shtml
Exception com.opencms.core.CmsException: 2 Not found. Detailed error:
[com.opencms.file.genericSql.CmsDbAccess]
/kdb/customers/es/di/solutions/159353sp.shtml.
at
com.opencms.file.genericSql.CmsDbAccess.readFile(CmsDbAccess.java:6092)
at
com.opencms.file.genericSql.CmsResourceBroker.readFile(CmsResourceBroker
.java:5203)
at com.opencms.file.CmsObject.readFile(CmsObject.java:2883)
at
com.opencms.file.CmsResourceTypePage.lockResource(CmsResourceTypePage.ja
va:660)
at
com.opencms.file.CmsResourceTypePage.importResource(CmsResourceTypePage.
java:638)
at com.opencms.file.CmsObject.importResource(CmsObject.java:2140)
at
com.opencms.file.CmsImport.CmsResourceBroker.readFile(CmsImport.java:601
)
at
com.opencms.file.CmsImport.CmsResourceBroker.readFile(CmsImport.java:786
)
at
com.opencms.file.CmsImport.CmsResourceBroker.readFile(CmsImport.java:188
)
at
com.opencms.file.genericSql.CmsResourceBroker.importResources(CmsResourc
eBroker.java:4156)
at com.opencms.file.CmsObject.importResources(CmsObject.java:2167)


And the manifest.xml portion of that file
        <file>
 
<source>kdb/customers/es/di/solutions/159353sp.shtml</source>
 
<destination>kdb/customers/es/di/solutions/159353sp.shtml</destination>
            <type>page</type>
            <user>Admin</user>
            <group>Administrators</group>
            <access>383</access>
            <lastmodified>1071568023000</lastmodified>
            <properties>
                <property>
                    <name>ProgId</name>
                    <type>1</type>
                    <value><![CDATA[FrontPage.Editor.Document]]></value>
                </property>
                <property>
                    <name>NavPos</name>
                    <type>1</type>
                    <value><![CDATA[61]]></value>
                </property>
                <property>
                    <name>NavText</name>
                    <type>1</type>
                    <value><![CDATA[Cómo instalar el controlador USB en
el sistema operativo Microsoft(R) Windows(R) Me.]]></value>
                </property>
                <property>
                    <name>GENERATOR</name>
                    <type>1</type>
                    <value><![CDATA[Microsoft FrontPage 4.0]]></value>
                </property>
                <property>
                    <name>Title</name>
                    <type>1</type>
                    <value><![CDATA[Cómo instalar el controlador USB en
el sistema operativo Microsoft(R) Windows(R) Me.]]></value>
                </property>
            </properties>
        </file>


It's always the same exception, and always the same (or nearly the same)
manifest data. We have checked the methods, and arrived to the lines
throwing the exceptions:

    /**
     * Reads a file from the Cms.<BR/>
     *
     * @param projectId The Id of the project in which the resource will
be used.
     * @param onlineProjectId The online projectId of the OpenCms.
     * @param filename The complete name of the new file (including
pathinformation).
     *
     * @return file The read file.
     *
     * @throws CmsException Throws CmsException if operation was not
succesful
     */
     public CmsFile readFile(int projectId,
                             int onlineProjectId,
                             String filename)
         throws CmsException

(lines 6047-6092)

    ...
    try {
            con = DriverManager.getConnection(usedPool);
            // if the actual project is the online project read file
header and content
            // from the online project
            statement =
con.prepareStatement(m_cq.get("C_FILES_READ"+usedStatement));
            statement.setString(1, filename);
            statement.setInt(2, projectId);
            res = statement.executeQuery();
            if(res.next()) {
			...
            } else {
                throw new CmsException("["+this.getClass().getName()+"]
"+filename,CmsException.C_NOT_FOUND);
            }
    ...

Maybe, just maybe, there is a difference between importing a ZIP file
while in the ONLINE project? Maybe we did not change to the offline
project before doing the import ... Anyway, the question would still
remain: why some files are imported well?

Thanks for your time,
--mariano





More information about the opencms-dev mailing list