Search the FirstSpirit Knowledge Base
Hallo,
ich habe das CMS auf Version 2023_08 gebracht.
unter andrem lege ich ein neues Medium mit Text an:
// UID_MEDIASTORE_FOLDER = de.espirit.firstspirit.access.store.mediastore.MediaFolder.UID_TYPE;
Integer siInteger = new Integer(convString.length());
ByteArrayInputStream bais = new ByteArrayInputStream(fileContent.getBytes());
long length = siInteger.longValue();
String fileExtension = "htm";
final String encoding = "ISO-8859-1";
MediaFolder myMediaFolder = (MediaFolder) ms.getStoreElement(folderRef, FsUidTypes.UID_MEDIASTORE_FOLDER);
Media newMedia = myMediaFolder.createMedia(mediumRef, fileName, Media.FILE, false, true);
if (!newMedia.isLocked()) {
newMedia.setLock(true, false);
}
File newFile = newMedia.getFile(lang);
newFile.setFile(length, bais, fileExtension);
newFile.setEncoding(encoding);
newMedia.save();
newMedia.setLock(false, false);
if (!newMedia.isLocked()) {
newMedia.setLock(true, false);
}
newMedia.release(false);
newMedia.setLock(false, false);
retUid = newMedia.getUid();
newFile.setFile(length, bais, fileExtension);
Es lag vermutlich an unserem Modul. Darin waren Jars die einen Konflikt verursacht haben. Nach Umstellung auf scope=module tritt der Fehler nicht mehr auf. Nun muss ich natürlich wieder alles noch mal testen.
Hier die komplette Fehlermeldung (habe nichts gefunden um diese als Anhang anzuhängen 😞
ERROR 19.09.2024 08:42:42.803 (de.espirit.firstspirit.server.mediamanagement.UploadHooks): BLAME UploadHook 'DE.ESPIRIT.FIRSTSPIRIT.STORE.ACCESS.MEDIASTORE.MIMETYPEUPLOADHOOK'! projectId=1994557 media=TestMedia1 type=file
java.lang.IllegalArgumentException: Cannot create factory for 'de.espirit.firstspirit.server.mediamanagement.mime.GsonFactory' (implementationClass=de.espirit.firstspirit.server.mediamanagement.gson.GsonFactoryImpl, loader=de.espirit.common.FactoryRegistry$LibrariesLoader@2c039ac6, securityManager=java.lang.SecurityManager@6eb97687) - java.lang.ClassNotFoundException: de.espirit.firstspirit.server.mediamanagement.gson.GsonFactoryImpl
at de.espirit.common.FactoryRegistry.newFactory(FactoryRegistry.java:389)
at de.espirit.common.FactoryRegistry.getFactory(FactoryRegistry.java:353)
at de.espirit.firstspirit.server.mediamanagement.mime.JsonContentTypeGuesser.handle(JsonContentTypeGuesser.java:28)
at de.espirit.eu.medsea.mimeutil.TextMimeDetector.fireMimeHandlers(TextMimeDetector.java:370)
at de.espirit.eu.medsea.mimeutil.TextMimeDetector.getMimeTypesByteArray(TextMimeDetector.java:296)
at de.espirit.eu.medsea.mimeutil.TextMimeDetector.getMimeTypesInputStream(TextMimeDetector.java:241)
at de.espirit.eu.medsea.mimeutil.detector.MimeDetector.getMimeTypes(MimeDetector.java:108)
at de.espirit.eu.medsea.mimeutil.MimeDetectorRegistry.getMimeTypes(MimeDetectorRegistry.java:156)
at de.espirit.eu.medsea.mimeutil.MimeUtil2.getMimeTypes(MimeUtil2.java:492)
at de.espirit.eu.medsea.mimeutil.MimeUtil2.getMimeTypes(MimeUtil2.java:463)
at de.espirit.eu.medsea.mimeutil.MimeUtil.getMimeTypes(MimeUtil.java:319)
at de.espirit.firstspirit.server.mediamanagement.mime.MimeUtilFacade.guessMimeTypes(MimeUtilFacade.java:177)
at de.espirit.firstspirit.server.mediamanagement.mime.MimeTypeInputStream.guessMimeTypes(MimeTypeInputStream.java:33)
at de.espirit.firstspirit.server.mediamanagement.mime.MimeTypeInputStream.getBestMimeType(MimeTypeInputStream.java:41)
at de.espirit.firstspirit.store.access.mediastore.MimeTypeUploadHook.preProcess(MimeTypeUploadHook.java:31)
at de.espirit.firstspirit.server.mediamanagement.UploadHooks.callPreMethod(UploadHooks.java:173)
at de.espirit.firstspirit.server.mediamanagement.UploadHooks.processPreUploadHooks(UploadHooks.java:83)
at de.espirit.firstspirit.store.access.mediastore.FileImpl.uploadFile(FileImpl.java:289)
at de.espirit.firstspirit.store.access.mediastore.FileImpl.setFile(FileImpl.java:156)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at bsh.Reflect.invokeMethod(Reflect.java:185)
at bsh.Reflect.invokeObjectMethod(Reflect.java:118)
at bsh.Name.invokeMethod(Name.java:858)
at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:75)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47)
at bsh.BSHBlock.evalBlock(BSHBlock.java:130)
at bsh.BSHBlock.eval(BSHBlock.java:80)
at bsh.BSHBlock.eval(BSHBlock.java:46)
at bsh.BSHTryStatement.eval(BSHTryStatement.java:88)
at bsh.BSHBlock.evalBlock(BSHBlock.java:130)
at bsh.BSHBlock.eval(BSHBlock.java:80)
at bsh.BshMethod.invokeImpl(BshMethod.java:371)
at bsh.BshMethod.invoke(BshMethod.java:267)
at bsh.BshMethod.invoke(BshMethod.java:170)
at bsh.PreparsedScript.invoke(PreparsedScript.java:66)
at de.espirit.firstspirit.server.script.BeanshellScriptEngine$BeanshellExecutable.execute(BeanshellScriptEngine.java:101)
at de.espirit.firstspirit.server.script.PermissionsScriptEngine$PermissionsExecutable.lambda$execute$1(PermissionsScriptEngine.java:85)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at de.espirit.firstspirit.server.script.PermissionsScriptEngine$PermissionsExecutable.execute(PermissionsScriptEngine.java:90)
at de.espirit.firstspirit.server.script.PermissionsScriptEngine$PermissionsExecutable.execute(PermissionsScriptEngine.java:85)
at de.espirit.firstspirit.common.ScriptUtil.execute(ScriptUtil.java:111)
at de.espirit.firstspirit.server.scheduler.ScriptTaskExecutor.run(ScriptTaskExecutor.java:162)
at de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl$TaskCallable.executeLocal(ScheduleManagerImpl.java:2795)
at de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl$TaskCallable.executeLocal(ScheduleManagerImpl.java:2778)
at de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl$TaskCallable.call(ScheduleManagerImpl.java:2704)
at de.espirit.firstspirit.server.ExecutionManagerImpl$ExtendedCallable.call(ExecutionManagerImpl.java:637)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at de.espirit.common.util.BoundedExecutorService$RunnableWrapper.run(BoundedExecutorService.java:493)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
at de.espirit.common.util.SuspendableThread.run(SuspendableThread.java:60)
Caused by: java.lang.ClassNotFoundException: de.espirit.firstspirit.server.mediamanagement.gson.GsonFactoryImpl
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at de.espirit.common.FactoryRegistry.lambda$newFactory$0(FactoryRegistry.java:384)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at de.espirit.common.FactoryRegistry.newFactory(FactoryRegistry.java:383)
... 57 more
ERROR 19.09.2024 08:42:42.818 (de.espirit.firstspirit.server.mediamanagement.UploadHooks): BLAME UploadHook 'DE.ESPIRIT.FIRSTSPIRIT.SERVICE.MEDIAMANAGEMENT.MEDIACONSTRAINTSUPLOADHOOK'! projectId=1994557 media=TestMedia1 type=file
java.lang.IllegalArgumentException: Cannot create factory for 'de.espirit.firstspirit.server.mediamanagement.mime.GsonFactory' (implementationClass=de.espirit.firstspirit.server.mediamanagement.gson.GsonFactoryImpl, loader=de.espirit.common.FactoryRegistry$LibrariesLoader@2c039ac6, securityManager=java.lang.SecurityManager@6eb97687) - java.lang.ClassNotFoundException: de.espirit.firstspirit.server.mediamanagement.gson.GsonFactoryImpl
at de.espirit.common.FactoryRegistry.newFactory(FactoryRegistry.java:389)
at de.espirit.common.FactoryRegistry.getFactory(FactoryRegistry.java:353)
at de.espirit.firstspirit.server.mediamanagement.mime.JsonContentTypeGuesser.handle(JsonContentTypeGuesser.java:28)
at de.espirit.eu.medsea.mimeutil.TextMimeDetector.fireMimeHandlers(TextMimeDetector.java:370)
at de.espirit.eu.medsea.mimeutil.TextMimeDetector.getMimeTypesByteArray(TextMimeDetector.java:296)
at de.espirit.eu.medsea.mimeutil.TextMimeDetector.getMimeTypesInputStream(TextMimeDetector.java:241)
at de.espirit.eu.medsea.mimeutil.detector.MimeDetector.getMimeTypes(MimeDetector.java:108)
at de.espirit.eu.medsea.mimeutil.MimeDetectorRegistry.getMimeTypes(MimeDetectorRegistry.java:156)
at de.espirit.eu.medsea.mimeutil.MimeUtil2.getMimeTypes(MimeUtil2.java:492)
at de.espirit.eu.medsea.mimeutil.MimeUtil2.getMimeTypes(MimeUtil2.java:463)
at de.espirit.eu.medsea.mimeutil.MimeUtil.getMimeTypes(MimeUtil.java:319)
at de.espirit.firstspirit.server.mediamanagement.mime.MimeUtilFacade.guessMimeTypes(MimeUtilFacade.java:177)
at de.espirit.firstspirit.server.mediamanagement.mime.MimeTypeInputStream.guessMimeTypes(MimeTypeInputStream.java:33)
at de.espirit.firstspirit.server.mediamanagement.mime.MimeTypeInputStream.getBestMimeType(MimeTypeInputStream.java:41)
at de.espirit.firstspirit.service.mediamanagement.MediaConstraintsUploadHook.preProcess(MediaConstraintsUploadHook.java:52)
at de.espirit.firstspirit.server.mediamanagement.UploadHooks.callPreMethod(UploadHooks.java:173)
at de.espirit.firstspirit.server.mediamanagement.UploadHooks.processPreUploadHooks(UploadHooks.java:83)
at de.espirit.firstspirit.store.access.mediastore.FileImpl.uploadFile(FileImpl.java:289)
at de.espirit.firstspirit.store.access.mediastore.FileImpl.setFile(FileImpl.java:156)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at bsh.Reflect.invokeMethod(Reflect.java:185)
at bsh.Reflect.invokeObjectMethod(Reflect.java:118)
at bsh.Name.invokeMethod(Name.java:858)
at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:75)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47)
at bsh.BSHBlock.evalBlock(BSHBlock.java:130)
at bsh.BSHBlock.eval(BSHBlock.java:80)
at bsh.BSHBlock.eval(BSHBlock.java:46)
at bsh.BSHTryStatement.eval(BSHTryStatement.java:88)
at bsh.BSHBlock.evalBlock(BSHBlock.java:130)
at bsh.BSHBlock.eval(BSHBlock.java:80)
at bsh.BshMethod.invokeImpl(BshMethod.java:371)
at bsh.BshMethod.invoke(BshMethod.java:267)
at bsh.BshMethod.invoke(BshMethod.java:170)
at bsh.PreparsedScript.invoke(PreparsedScript.java:66)
at de.espirit.firstspirit.server.script.BeanshellScriptEngine$BeanshellExecutable.execute(BeanshellScriptEngine.java:101)
at de.espirit.firstspirit.server.script.PermissionsScriptEngine$PermissionsExecutable.lambda$execute$1(PermissionsScriptEngine.java:85)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at de.espirit.firstspirit.server.script.PermissionsScriptEngine$PermissionsExecutable.execute(PermissionsScriptEngine.java:90)
at de.espirit.firstspirit.server.script.PermissionsScriptEngine$PermissionsExecutable.execute(PermissionsScriptEngine.java:85)
at de.espirit.firstspirit.common.ScriptUtil.execute(ScriptUtil.java:111)
at de.espirit.firstspirit.server.scheduler.ScriptTaskExecutor.run(ScriptTaskExecutor.java:162)
at de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl$TaskCallable.executeLocal(ScheduleManagerImpl.java:2795)
at de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl$TaskCallable.executeLocal(ScheduleManagerImpl.java:2778)
at de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl$TaskCallable.call(ScheduleManagerImpl.java:2704)
at de.espirit.firstspirit.server.ExecutionManagerImpl$ExtendedCallable.call(ExecutionManagerImpl.java:637)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at de.espirit.common.util.BoundedExecutorService$RunnableWrapper.run(BoundedExecutorService.java:493)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
at de.espirit.common.util.SuspendableThread.run(SuspendableThread.java:60)
Caused by: java.lang.ClassNotFoundException: de.espirit.firstspirit.server.mediamanagement.gson.GsonFactoryImpl
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at de.espirit.common.FactoryRegistry.lambda$newFactory$0(FactoryRegistry.java:384)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at de.espirit.common.FactoryRegistry.newFactory(FactoryRegistry.java:383)
... 57 more
Hallo Andreas,
das sieht von der Fehlermeldung her nach einem Bug aus, der mit Version 2023.9 (also direkt eine Version später) behoben wurde (interne Ticket-ID: CORE-15518).
Viele Grüße
Michael
Es lag vermutlich an unserem Modul. Darin waren Jars die einen Konflikt verursacht haben. Nach Umstellung auf scope=module tritt der Fehler nicht mehr auf. Nun muss ich natürlich wieder alles noch mal testen.