Cannot Invoke Method isAssignableFrom() on Null Object

2012-08-10

Grails error message in Cinnamon Entitylib

Setup

Grails 1.3.1

Java 6

Java Domain classes with JPA 1

Project: Cinnamon / Entitylib and AdminTool (Dandelion): cinnamon-cms.de

Problem description

A normal call to load a GORM object (Java Domain class) fails with a strange error message:

java.lang.NullPointerException: Cannot invoke method isAssignableFrom() on null object
at java_lang_Class$isAssignableFrom.call(Unknown Source)
at eu.hornerproject.dandelion.IndexTypeController$_closure5.doCall(IndexTypeController.groovy:75)
at eu.hornerproject.dandelion.IndexTypeController$_closure5.doCall(IndexTypeController.groovy

The code in question:

1
    def indexTypeInstance = IndexType.get(params.id)

params.id contains a valid id.

The IndexType class is mapped.

Note that there is absolutely no hint as to what causes this problem - java.lang.Class is called from an unknown source, and stepping through to it by debugger is a quite impractical, because Grails / Groovy does so many things during the IndexType.get() step that you will probably die of old age before you find the problem.

(Probable) Cause & Solution

The IndexType class was missing getters and setters, and I guess the later ones are being used by GORM to set the indexerClass- and vaProvider-class fields.

[DM_API_E_EXIST] Error: Document/object Specified by Does Not Exist.

2012-08-10

An obscure error in Documentum 5.3

Error message:

[DM_API_E_EXIST]error:  "Document/object specified by  does not exist."
com.documentum.fc.client.DfSession.createServerException(DfSession.java:3556)
com.documentum.fc.client.DfSession.convertToDfException(DfSession.java:3538)
com.documentum.fc.client.DfSession.apiGet(DfSession.java:217)
com.documentum.fc.bof.compoundclass.AspectMgr.getAspectCount(AspectMgr.java:235)
com.documentum.fc.bof.compoundclass.AspectMgr.getAspects(AspectMgr.java:26)
com.documentum.fc.client.DfPersObjFactoryWithAspects.makeObject(DfPersObjFactoryWithAspects.java:41)
com.documentum.fc.client.DfSession.makePersistentObject(DfSession.java:2268)
com.documentum.fc.client.DfSession.newObjectWithType(DfSession.java:2368)
com.documentum.fc.client.DfSession.newObject(DfSession.java:2348)

System: Documentum 5.3 SP5 / Oracle 10 / Windows Server 2003

Code using dfc.jar:

1
2
3
4
5
6
7
IDfSysObject report = ...;
if (report == null) {
    report = (IDfSysObject) session.newObject("dm_document");
    report.setObjectName("my log");
    report.link(folderName);
    report.save();
}

Solution / Explanation:

The code called session.disconnect() before session.newObject(…).

DCTM 5.3 does not return a proper error message like “session is invalid or disconnected”

LifecycleException: Protocol Handler Initialization Failed: java.net.BindException: Address Already in Use

LifecycleException: Protocol Handler Initialization Failed: java.net.BindException: Address Already in Use:8080

 

Problem:

Invisible programm listening on port 8080

System: Ubuntu 9.10 / Grails 1.2.1 / Java 6

When: while starting a grails application, the following error occured: Error Message

LifecycleException:  Protocol handler initialization failed: java.net.BindException: Address already in use<null>:8080
at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:135)
at grails.web.container.EmbeddableServer$start.call(Unknown Source)
at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:158)
at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy)
at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:287)
at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:149)
at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy)
at _GrailsRun_groovy.runInline(_GrailsRun_groovy:115)
at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59)
at RunApp$_run_closure1.doCall(RunApp.groovy:33)
at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:344)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:334)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.processTargets(Gant.groovy:495)
at gant.Gant.processTargets(Gant.groovy:480)
Server failed to start: LifecycleException:  Protocol handler initialization failed: java.net.BindException: Address already in use<null>:8080

$ netstat -tupl

(Es konnten nicht alle Prozesse identifiziert werden; Informationen über
nicht-eigene Processe werden nicht angezeigt; Root kann sie anzeigen.)
Aktive Internetverbindungen (Nur Server)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 localhost:7634          *:*                     LISTEN      -              
tcp        0      0 *:ssh                   *:*                     LISTEN      -              
tcp        0      0 localhost:ipp           *:*                     LISTEN      -              
tcp        0      0 localhost:mysql         *:*                     LISTEN      -              
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      -              
tcp6       0      0 localhost:ipp           [::]:*                  LISTEN      -              
tcp6       0      0 [::]:http-alt           [::]:*                  LISTEN      -              

Analysis

Executing netstat as normal user hides the programm which is using port 8080 (in this case, an unexpected tomcat instance).

Solution

  1. shutdown tomcat6 running on port 8080

    sudo /etc/init.d/tomcat6 stop

  2. use netstat as root

    sudo netstat -tupl tcp6 0 0 [::]:http-alt [::]:* LISTEN 1972/jsvc

[originally posted in 2010]

Fail to Import Ssl Certificate

2012-08-10

Situation

A client bought a new Certificate and needed to have it installed.

Solution

  1. make sure that the certificate is not borked: there should be a newline between —-BEGIN CERTIFICATE— and the data.
  2. If necessary, convert to DER format:

    openssl x509 -in myCert -out myCert.der -outform DER

  3. Import intermediate certs with different alias than the one used for your own cert:

    keytool -keystore theKeyStore -alias thawte_intermediate -import -file thawte_int.der -trustcacerts

  4. Import your new cert

    keytool -keystore theKeyStore -import -file _new_cert.der -trustcacerts

Resources:

  • http://www.modssl.org/docs/2.8/ssl_faq.html#ToC36
  • http://community.igniterealtime.org/thread/39868
  • http://wiki.zimbra.com/wiki/4.x_Commercial_Certificates_Guide
  • http://docs.codehaus.org/display/JETTY/How+to+configure+SSL

Subcategories

  • Errors

    Descriptions of error messages and possible solutions

  • Little Goblin

    Posts about Little Goblin, the Grails based open source browser game engine and its reference implementation.

    The home page of Little Goblin is littlegoblin.de