users@glassfish.java.net

Problems deploying ear (String index out of range: -4)

From: <glassfish_at_javadesktop.org>
Date: Wed, 14 May 2008 03:27:58 PDT

Can anyone please point me at a solution to the following problem (reply here or email to a.j.beaumont[at]aston.ac.uk):

I have an enterprise application that deploys and runs fine on the Sun Application Server version 9.0

However, when I try to deploy it on Sun Application Server version 9.0 update 1 or any subsequent version, or on glassfish, I get the following error:

Deploying application in domain failed; String index out of range: -4 String index out of range: -4

In the log file I see the following exception:

[#|2008-05-14T11:01:45.725+0100|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.tools.deployment|_ThreadID=17;_ThreadName=Thread-37;_RequestID=ed4272ef-581f-412d-81a6-e325625cf1eb;|Exception occured in J2EEC Phase
com.sun.enterprise.deployment.backend.IASDeploymentException: String index out of range: -4
        at java.lang.String.substring(String.java:1768)
        at oracle.toplink.essentials.internal.helper.Helper.truncate(Helper.java:1876)
        at oracle.toplink.essentials.tools.schemaframework.TableDefinition.buildForeignKeyConstraintName(TableDefinition.java:444)
        at oracle.toplink.essentials.tools.schemaframework.TableDefinition.buildForeignKeyConstraint(TableDefinition.java:413)
        at oracle.toplink.essentials.tools.schemaframework.TableDefinition.buildForeignFieldTypes(TableDefinition.java:381)
        at oracle.toplink.essentials.tools.schemaframework.TableDefinition.buildFieldTypes(TableDefinition.java:350)
        at oracle.toplink.essentials.tools.schemaframework.SchemaManager.buildFieldTypes(SchemaManager.java:106)
        at oracle.toplink.essentials.tools.schemaframework.TableCreator.replaceTablesAndConstraints(TableCreator.java:224)
        at oracle.toplink.essentials.tools.schemaframework.TableCreator.replaceTables(TableCreator.java:215)
        at oracle.toplink.essentials.tools.schemaframework.SchemaManager.replaceDefaultTables(SchemaManager.java:817)
        at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createOrReplaceDefaultTables(EntityManagerFactoryProvider.java:307)
        at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.writeDDLsToFiles(EntityManagerFactoryProvider.java:330)
        at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.generateDDLFiles(EntityManagerFactoryProvider.java:235)
        at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:231)
        at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:78)
        at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:113)
        at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:107)
        at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:76)
        at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.loadPersistenceUnitBundle(PersistenceProcessor.java:468)
        at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.createTablesInDB(PersistenceProcessor.java:325)
        at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.processAppBundle(PersistenceProcessor.java:190)
        at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.processApplication(PersistenceProcessor.java:125)
        at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processApplication(DeploymentEventListenerImpl.java:193)
        at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processEvent(DeploymentEventListenerImpl.java:152)
        at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.notifyDeploymentEvent(DeploymentEventListenerImpl.java:109)
        at com.sun.enterprise.deployment.backend.DeploymentEventManager.notifyDeploymentEvent(DeploymentEventManager.java:66)
        at com.sun.enterprise.deployment.backend.AppDeployer.postDeploy(AppDeployer.java:429)
        at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:225)
        at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:129)
        at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:169)
        at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:871)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:266)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:739)
        at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:174)
        at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:210)

What could be causing this exception?

-Dr Tony Beaumont
Aston University
Birmingham, UK
[Message sent by forum member 'beaumontaston' (beaumontaston)]

http://forums.java.net/jive/thread.jspa?messageID=274246