Image imports are no longer working -- due to "JAI not available: java.lang.ClassNotFoundException: javax.media.jai.PlanarImage"

Hi,

I am no longer able to import images (basic small JPEG file) successfully due to the error dump below .. This used to work and I have already images in the system that preview (and were also imported via drag-and-drop using the same browser) to prove it

I also saw this similar (but not exact) question .. and the guy who logged that question seemed to have resolved his issues by modifying the code and or replacing some java libraries .. I hope this is not the only way this can be resolved.

I also asked the question linked here .. and I am not sure if the current issues I am having with image uploads/preview could be connected to not having a completely updated system.

How do I go about troubleshooting this ? Any suggestions would be much appreciated. Thanks in advance.

 2014-02-07 12:46:35,226 WARN  [Nuxeo-Work-pictureViewsGeneration-1] [it.tidalwave.image.java2d.ImplementationFactoryJ2D] JAI not available: java.lang.ClassNotFoundException: javax.media.jai.PlanarImage
2014-02-07 12:46:35,333 ERROR [Nuxeo-Work-pictureViewsGeneration-1] [it.tidalwave.image.EditableImage] Cannot load EXIF metadata: javax.imageio.IIOException: Inconsistent metadata read from stream
2014-02-07 12:46:36,540 ERROR [Nuxeo-Work-pictureViewsGeneration-1] [it.tidalwave.image.EditableImage] Cannot load EXIF metadata: javax.imageio.IIOException: Inconsistent metadata read from stream
2014-02-07 12:46:36,786 ERROR [Nuxeo-Work-pictureViewsGeneration-1] [org.nuxeo.ecm.core.work.AbstractWork] Exception during work: PictureViewsGenerationWork(27beb097-4b32-4da5-8565-2b9b241446fa, , Progress(?%, ?/0), Saving)
org.nuxeo.ecm.core.api.ClientException: Failed to save document DocumentModelImpl(27beb097-4b32-4da5-8565-2b9b241446fa, path=/asset-library/religious-people.jpg, title=religious-people.jpg)
        at org.nuxeo.ecm.core.api.AbstractSession.saveDocument(AbstractSession.java:1996)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.nuxeo.ecm.core.api.TransactionalCoreSessionWrapper.invoke(TransactionalCoreSessionWrapper.java:136)
        at com.sun.proxy.$Proxy101.saveDocument(Unknown Source)
        at org.nuxeo.ecm.platform.picture.PictureViewsGenerationWork.work(PictureViewsGenerationWork.java:86)
        at org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:65)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)
Caused by: org.nuxeo.ecm.core.api.DocumentException: org.nuxeo.ecm.core.storage.StorageException: java.io.IOException: Stream Closed
        at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.getBinary(SQLSession.java:1177)
        at org.nuxeo.ecm.core.storage.sql.coremodel.SQLContentProperty.setValue(SQLContentProperty.java:80)
        at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexProperty.setValue(SQLComplexProperty.java:101)
        at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexListProperty.setList(SQLComplexListProperty.java:278)
        at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexListProperty.setValue(SQLComplexListProperty.java:86)
        at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexProperty.setPropertyValue(SQLComplexProperty.java:222)
        at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive.writeDocumentPart(SQLDocumentLive.java:178)
        at org.nuxeo.ecm.core.api.DocumentModelFactory.writeDocumentModel(DocumentModelFactory.java:298)
        at org.nuxeo.ecm.core.api.AbstractSession.writeModel(AbstractSession.java:557)
        at org.nuxeo.ecm.core.api.AbstractSession.saveDocument(AbstractSession.java:1968)
        ... 11 more
Caused by: org.nuxeo.ecm.core.storage.StorageException: java.io.IOException: Stream Closed
        at org.nuxeo.ecm.core.storage.sql.SessionImpl.getBinary(SessionImpl.java:334)
        at org.nuxeo.ecm.core.storage.sql.ra.ConnectionImpl.getBinary(ConnectionImpl.java:169)
        at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.getBinary(SQLSession.java:1175)
        ... 20 more
Caused by: java.io.IOException: Stream Closed
        at java.io.FileInputStream.available(Native Method)
        at org.nuxeo.ecm.core.storage.sql.AbstractBinaryManager.storeAndDigest(AbstractBinaryManager.java:97)
        at org.nuxeo.ecm.core.storage.sql.LocalBinaryManager.storeAndDigest(LocalBinaryManager.java:176)
        at org.nuxeo.ecm.core.storage.sql.LocalBinaryManager.getBinary(LocalBinaryManager.java:114)
        at org.nuxeo.ecm.core.storage.sql.SessionImpl.getBinary(SessionImpl.java:332)
0 votes

3 answers

6165 views

ANSWER



Hi,

i'm using nuxeo 5.9.2 and i have this error on import images : 2014-02-27 11:19:07,852 ERROR [Nuxeo-Work-pictureViewsGeneration-1] [org.nuxeo.ecm.core.work.AbstractWork] Exception during work: PictureViewsGenerationWork(ff0136d1-82b0-42c8-b615-2c7b92de8f2d, , Progress(?%, ?/0), Generating views)

This link https://jira.nuxeo.com/browse/NXP-13603 indicate that it was resolved in 5.9.2 but not for me.

Any idea ?

Thanks

PR

0 votes



This is unrelated to the original question, please ask a new question.
03/18/2014


Hi !

I encountered the exact same problem today on a fresh install of nuxeo. I just wanted to upload some files to the DAM.

Here is my log :

2014-02-12 13:49:59,870 ERROR [Nuxeo-Work-pictureViewsGeneration-5] [org.nuxeo.ecm.core.work.AbstractWork] Exception during work: PictureViewsGenerationWork(6bad171a-7337-4f16-91fe-67b1cd531285, , Progress(?%, ?/0), Saving) org.nuxeo.ecm.core.api.ClientException: Failed to save document DocumentModelImpl(6bad171a-7337-4f16-91fe-67b1cd531285, path=/default-domain/UserWorkspaces/Alex/PHOTO VIDEO/005.JPG.1392209378695, title=005.JPG)

at org.nuxeo.ecm.core.api.AbstractSession.saveDocument(AbstractSession.java:1891)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.nuxeo.ecm.core.api.TransactionalCoreSessionWrapper.invoke(TransactionalCoreSessionWrapper.java:136)
at com.sun.proxy.$Proxy101.saveDocument(Unknown Source)
at org.nuxeo.ecm.platform.picture.PictureViewsGenerationWork.work(PictureViewsGenerationWork.java:86)
at org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:65)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

Caused by: org.nuxeo.ecm.core.api.DocumentException: org.nuxeo.ecm.core.storage.StorageException: java.io.IOException: Stream Closed

at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.getBinary(SQLSession.java:1188)
at org.nuxeo.ecm.core.storage.sql.coremodel.SQLContentProperty.setValue(SQLContentProperty.java:80)
at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexProperty.setValue(SQLComplexProperty.java:101)
at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexListProperty.setList(SQLComplexListProperty.java:278)
at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexListProperty.setValue(SQLComplexListProperty.java:86)
at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexProperty.setPropertyValue(SQLComplexProperty.java:222)
at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive.writeDocumentPart(SQLDocumentLive.java:178)
at org.nuxeo.ecm.core.api.DocumentModelFactory.writeDocumentModel(DocumentModelFactory.java:298)
at org.nuxeo.ecm.core.api.AbstractSession.writeModel(AbstractSession.java:555)
at org.nuxeo.ecm.core.api.AbstractSession.saveDocument(AbstractSession.java:1863)
... 11 more

Caused by: org.nuxeo.ecm.core.storage.StorageException: java.io.IOException: Stream Closed

at org.nuxeo.ecm.core.storage.sql.SessionImpl.getBinary(SessionImpl.java:334)
at org.nuxeo.ecm.core.storage.sql.ra.ConnectionImpl.getBinary(ConnectionImpl.java:169)
at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.getBinary(SQLSession.java:1186)
... 20 more

Caused by: java.io.IOException: Stream Closed

at java.io.FileInputStream.available(Native Method)
at org.nuxeo.ecm.core.storage.sql.AbstractBinaryManager.storeAndDigest(AbstractBinaryManager.java:97)
at org.nuxeo.ecm.core.storage.sql.LocalBinaryManager.storeAndDigest(LocalBinaryManager.java:176)
at org.nuxeo.ecm.core.storage.sql.LocalBinaryManager.getBinary(LocalBinaryManager.java:114)
at org.nuxeo.ecm.core.storage.sql.SessionImpl.getBinary(SessionImpl.java:332)
... 22 more

To solve this I tried to follow this advice : http://comments.gmane.org/gmane.comp.cms.nuxeo.general/10772 which is probably outdated since copying https://maven-eu.nuxeo.org/nexus/service/local/repositories/jboss-thirdparty/content/javax/media/jai-core/1.1.3/jai-core-1.1.3.jar available from https://maven-eu.nuxeo.org/nexus/index.html#nexus-search;classname~javax.media.jai.PlanarImage to the lib folder of nuxeo did not fix the problem.

I have no idea what to do next. Strange that a fresh install of nuxeo with a couple of addons from the marketplace behaves like this …

Any help from the Nuxeo team appreciated.

0 votes



Which version of Nuxeo are you using? 5.8 with latest HF? This error should be fixed by https://jira.nuxeo.com/browse/NXP-13603, and is available in 5.8-HF06.
02/12/2014

I downloaded nuxeo-5.9.1-setup.exe From this page : http://www.nuxeo.com/en/downloads
02/12/2014

Ok as per the issue you linked, this problem is fixed for version 5.9.2. I guess the version I have (5.9.1) still has the bug. Moving on and downloading the LTS 5.8 version. Maybe you guys should consider removing 5.9.1 alltogether from the download page. It would avoid wasting people's time and money. Thanks again for pointing me in the right direction.
02/13/2014


I was running on a VM download of 5.8 LTS .. after my update problems of that version, I went and downloaded the 5.9.1 VM .. But this version suffers from exactly the same problem with image imports (affects only drag and drop and via the import button .. imports via nuxeo drive are OK so far)

I was unaware about the state of java libraries and expected dependencies for nuxeo. So I took a look at installed java libraries, and discovered that openjdk6 and 7 were installed, but there was no JAI oriented libraries installed on either.

So, I checked the ubuntu repos, and indeed there were two JAI packages listed ( libjai-core-java, libjai-imageio-core-java) .. I installed both, but they installed in the wrong places (/usr/share/java .. instead of somewhere within /usr/lib/jvm/java-7-openjdk-i386/jre/lib) ..

I have since copied the library files across to be within the installed tree of openjdk7 libraries, and now the original error has gone and I no longer get the error “JAI not available: java.lang.ClassNotFoundException: javax.media.jai.PlanarImage”

However, image imports are still broken but now for every attempt at image import or manipulation of imported image, I get:

2014-02-11 02:59:37,704 ERROR [Nuxeo-Work-pictureViewsGeneration-5] [it.tidalwave.image.EditableImage] Cannot load EXIF metadata: javax.imageio.IIOException: Inconsistent metadata read from stream 2014-02-11 02:59:39,415 ERROR [Nuxeo-Work-pictureViewsGeneration-5] [it.tidalwave.image.EditableImage] Cannot load EXIF metadata: javax.imageio.IIOException: Inconsistent metadata read from stream 2014-02-11 02:59:39,674 ERROR [Nuxeo-Work-pictureViewsGeneration-5] [org.nuxeo.ecm.core.work.AbstractWork] Exception during work: PictureViewsGenerationWork(52d1a832-bb28-48fe-ab45-d90c06fcb780, , Progress(?%, ?/0), Saving) org.nuxeo.ecm.core.api.ClientException: Failed to save document DocumentModelImpl(52d1a832-bb28-48fe-ab45-d90c06fcb780, path=/default-domain/workspaces/Chux Test/dont-wake-me-up.jpg, title=dont-wake-me-up.jpg)

    at org.nuxeo.ecm.core.api.AbstractSession.saveDocument(AbstractSession.java:1891)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.nuxeo.ecm.core.api.TransactionalCoreSessionWrapper.invoke(TransactionalCoreSessionWrapper.java:136)
    at com.sun.proxy.$Proxy101.saveDocument(Unknown Source)
    at org.nuxeo.ecm.platform.picture.PictureViewsGenerationWork.work(PictureViewsGenerationWork.java:86)
    at org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:65)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)

Caused by: org.nuxeo.ecm.core.api.DocumentException: org.nuxeo.ecm.core.storage.StorageException: java.io.IOException: Stream Closed

    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.getBinary(SQLSession.java:1188)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLContentProperty.setValue(SQLContentProperty.java:80)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexProperty.setValue(SQLComplexProperty.java:101)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexListProperty.setList(SQLComplexListProperty.java:278)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexListProperty.setValue(SQLComplexListProperty.java:86)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexProperty.setPropertyValue(SQLComplexProperty.java:222)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive.writeDocumentPart(SQLDocumentLive.java:178)
    at org.nuxeo.ecm.core.api.DocumentModelFactory.writeDocumentModel(DocumentModelFactory.java:298)
    at org.nuxeo.ecm.core.api.AbstractSession.writeModel(AbstractSession.java:555)
    at org.nuxeo.ecm.core.api.AbstractSession.saveDocument(AbstractSession.java:1863)
    ... 11 more

Caused by: org.nuxeo.ecm.core.storage.StorageException: java.io.IOException: Stream Closed

    at org.nuxeo.ecm.core.storage.sql.SessionImpl.getBinary(SessionImpl.java:334)
    at org.nuxeo.ecm.core.storage.sql.ra.ConnectionImpl.getBinary(ConnectionImpl.java:169)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.getBinary(SQLSession.java:1186)
    ... 20 more

Caused by: java.io.IOException: Stream Closed

    at java.io.FileInputStream.available(Native Method)
    at org.nuxeo.ecm.core.storage.sql.AbstractBinaryManager.storeAndDigest(AbstractBinaryManager.java:97)
    at org.nuxeo.ecm.core.storage.sql.LocalBinaryManager.storeAndDigest(LocalBinaryManager.java:176)
    at org.nuxeo.ecm.core.storage.sql.LocalBinaryManager.getBinary(LocalBinaryManager.java:114)
    at org.nuxeo.ecm.core.storage.sql.SessionImpl.getBinary(SessionImpl.java:332)

Unfortunately, this error message is not really pointing to anything specifically that I can troubleshoot. So, I am wondering how I can increase the debug level of nuxeo in hope of being able to get a greater detail in the log files ..

But why would nuxeo authors ship a VM with a nuxeo version that cannot process images, keep silent on this fact, and fail to respond to user questions around it? .. This is baffling indeed. We are now starting to consider other options now ..

Final steps we are taking to get around this problem: – install oracle jdk7 (and ensure JAI libraries are installed) .. – use 'alternatives' to set oracle java as default JVM – increase the debug levels, and test some more

Will update this as we go along ..

0 votes