Hello!

Backup import fails with the following weird, unclear error:

INFO 03-14 11:20:14.787 BackupImportController.java 57284 240 
org.apache.openmeetings.servlet.outputhandler.BackupImportController [main] - 
Organizations import complete, starting user import
[ERROR] [main] org.apache.openmeetings.cli.Admin - Restore failed
java.lang.NullPointerException: null
        at org.simpleframework.xml.convert.Reference.getType(Reference.java:70) 
~[simple-xml-jar-2.6.9.jar:na]
        at org.simpleframework.xml.core.Factory.getOverride(Factory.java:143) 
~[simple-xml-jar-2.6.9.jar:na]
        at 
org.simpleframework.xml.core.ObjectFactory.getInstance(ObjectFactory.java:63) 
~[simple-xml-jar-2.6.9.jar:na]
        at org.simpleframework.xml.core.Composite.read(Composite.java:139) 
~[simple-xml-jar-2.6.9.jar:na]
        at 
org.simpleframework.xml.core.Composite.readVariable(Composite.java:623) 
~[simple-xml-jar-2.6.9.jar:na]
        at 
org.simpleframework.xml.core.Composite.readInstance(Composite.java:573) 
~[simple-xml-jar-2.6.9.jar:na]
        at org.simpleframework.xml.core.Composite.readUnion(Composite.java:549) 
~[simple-xml-jar-2.6.9.jar:na]
        at 
org.simpleframework.xml.core.Composite.readElement(Composite.java:532) 
~[simple-xml-jar-2.6.9.jar:na]
        at 
org.simpleframework.xml.core.Composite.readElements(Composite.java:445) 
~[simple-xml-jar-2.6.9.jar:na]
        at org.simpleframework.xml.core.Composite.access$400(Composite.java:59) 
~[simple-xml-jar-2.6.9.jar:na]
        at 
org.simpleframework.xml.core.Composite$Builder.read(Composite.java:1383) 
~[simple-xml-jar-2.6.9.jar:na]
        at org.simpleframework.xml.core.Composite.read(Composite.java:201) 
~[simple-xml-jar-2.6.9.jar:na]
        at org.simpleframework.xml.core.Composite.read(Composite.java:148) 
~[simple-xml-jar-2.6.9.jar:na]
        at 
org.simpleframework.xml.core.Composite.readVariable(Composite.java:623) 
~[simple-xml-jar-2.6.9.jar:na]
        at 
org.simpleframework.xml.core.Composite.readInstance(Composite.java:573) 
~[simple-xml-jar-2.6.9.jar:na]
        at org.simpleframework.xml.core.Composite.readUnion(Composite.java:549) 
~[simple-xml-jar-2.6.9.jar:na]
        at 
org.simpleframework.xml.core.Composite.readElement(Composite.java:532) 
~[simple-xml-jar-2.6.9.jar:na]
        at 
org.simpleframework.xml.core.Composite.readElements(Composite.java:445) 
~[simple-xml-jar-2.6.9.jar:na]
        at org.simpleframework.xml.core.Composite.access$400(Composite.java:59) 
~[simple-xml-jar-2.6.9.jar:na]
        at 
org.simpleframework.xml.core.Composite$Builder.read(Composite.java:1383) 
~[simple-xml-jar-2.6.9.jar:na]
        at org.simpleframework.xml.core.Composite.read(Composite.java:201) 
~[simple-xml-jar-2.6.9.jar:na]
        at org.simpleframework.xml.core.Composite.read(Composite.java:148) 
~[simple-xml-jar-2.6.9.jar:na]
        at org.simpleframework.xml.core.Traverser.read(Traverser.java:92) 
~[simple-xml-jar-2.6.9.jar:na]
        at org.simpleframework.xml.core.Persister.read(Persister.java:625) 
~[simple-xml-jar-2.6.9.jar:na]
        at org.simpleframework.xml.core.Persister.read(Persister.java:606) 
~[simple-xml-jar-2.6.9.jar:na]
        at org.simpleframework.xml.core.Persister.read(Persister.java:584) 
~[simple-xml-jar-2.6.9.jar:na]
        at 
org.apache.openmeetings.servlet.outputhandler.BackupImportController.readUserList(BackupImportController.java:737)
 ~[openmeetings-2.1.0-RELEASE.jar:na]
        at 
org.apache.openmeetings.servlet.outputhandler.BackupImportController.readUserList(BackupImportController.java:691)
 ~[openmeetings-2.1.0-RELEASE.jar:na]
        at 
org.apache.openmeetings.servlet.outputhandler.BackupImportController.performImport(BackupImportController.java:245)
 ~[openmeetings-2.1.0-RELEASE.jar:na]
        at org.apache.openmeetings.cli.Admin.restoreOm(Admin.java:616) 
[openmeetings-2.1.0-RELEASE.jar:na]
        at org.apache.openmeetings.cli.Admin.process(Admin.java:262) 
[openmeetings-2.1.0-RELEASE.jar:na]
        at org.apache.openmeetings.cli.Admin.main(Admin.java:623) 
[openmeetings-2.1.0-RELEASE.jar:na]

It does not matter the version of openmeetings. I tried to restore 2.1.0 backup 
to 3.0.7, and to 2.1.0 (the same version which produced backup file).
The case of this error was the state_id in address in user definition.
If state_id is not in predefined list of state ids - import fails.
As I understand state for ldap users is taken from Active Directory field 
(which can be empty or contain any string), and openmeetings creates new 
state_id with new state name if no-one was matched.
As a result importing backup constantly fails until I fixed state_id to one of 
predefined (update om_user set state_id=221).
I guess at least error in this case can be more informative.

Reply via email to