Opened 11 years ago

Closed 11 years ago

#1822 closed defect (fixed)

Can't use external files with batch item importers

Reported by: Nicklas Nordborg Owned by: everyone
Priority: minor Milestone: BASE 3.3
Component: coreplugins Version:
Keywords: Cc:

Description

It seems like all of the batch item importers have problems if the selected file to import data from is an external file reference.

For example:

  • Prepare by creating an external file reference. The actual URL doesn't matter, but the file reference must be linked with a File server.
  • Go to the "Extracts" list page
  • Click on "Import" and select the "Extract importer"
  • Select the external file for the "File" parameter
  • There are some other required parameters. Simply enter some dummy values.
  • Click on 'Next'. An error message is displayed:
could not initialize proxy - no Session *
org.hibernate.LazyInitializationException: could not initialize proxy - no Session 
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:167) 
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:215) 
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190) 
at net.sf.basedb.core.data.FileServerData_$$_javassist_40.getConnectionManagerFactory(FileServerData_$$_javassist_40.java) 
at net.sf.basedb.util.uri.ConnectionParameters.create(ConnectionParameters.java:52) 
at net.sf.basedb.core.File.getServerInfo(File.java:1098) 
at net.sf.basedb.core.File.getDownloadStream(File.java:1460) 
at net.sf.basedb.plugins.batchimport.AbstractItemImporter.configure(AbstractItemImporter.java:358) 
at net.sf.basedb.core.PluginConfigurationRequest.invoke(PluginConfigurationRequest.java:114) 
at org.apache.jsp.common.plugin.index_jsp._jspService(index_jsp.java:518) 
...

The root cause is that the call to File.getDownloadStream() is done on an object that has been detached from the session, and the information about the file server is configured for lazy-loading.

Change History (2)

comment:1 by Nicklas Nordborg, 11 years ago

The same error when actually trying to use the file when importing:

org.hibernate.LazyInitializationException: could not initialize proxy - no Session 
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:167) 
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:215) 
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190) 
at net.sf.basedb.core.data.FileServerData_$$_javassist_40.getConnectionManagerFactory(FileServerData_$$_javassist_40.java) 
at net.sf.basedb.util.uri.ConnectionParameters.create(ConnectionParameters.java:52) 
at net.sf.basedb.core.File.getServerInfo(File.java:1098) 
at net.sf.basedb.core.File.getDownloadStream(File.java:1460) 
at net.sf.basedb.plugins.AbstractFlatFileImporter.run(AbstractFlatFileImporter.java:440) 
at net.sf.basedb.core.PluginExecutionRequest.invoke(PluginExecutionRequest.java:116) 
at net.sf.basedb.core.InternalJobQueue$JobRunner.run(InternalJobQueue.java:571)
at java.lang.Thread.run(Unknown Source)
Last edited 11 years ago by Nicklas Nordborg (previous) (diff)

comment:2 by Nicklas Nordborg, 11 years ago

Resolution: fixed
Status: newclosed

(In [6499]) Fixes #1822: Can't use external files with batch item importers

Note: See TracTickets for help on using tickets.