Autobase error when deploying with --nojars

9 views
Skip to first unread message

Madruga

unread,
Jun 19, 2009, 2:30:13 PM6/19/09
to Autobase
Hi all,

I'm getting IOException: Stream closed at Autobase.findFileOpener
(Autobase.groovy:87)

Deploying the same app on the same server, but building the complete
war (without the --nojars cmd) it works.

Any hints on how to make this work?

grails 1.1.1
autobase 0.8.5

Thank you

Madruga

unread,
Jun 19, 2009, 4:29:51 PM6/19/09
to Autobase
Apparently the problem is that when using --nojars and putting all the
grails jar on tomcat/lib folder, the class loader doesn't points to
the place where autobase.zip is

new ClassLoaderFileOpener().getResourceAsStream("/autobase.zip") on
file WarFileOpener.java

Madruga

unread,
Jun 19, 2009, 4:41:15 PM6/19/09
to Autobase
quick and nasty workaround if someone hits this issue, have to change
to plugin code

replace the method createZipStream in file WarFileOpener.java with
this one:

private static ZipInputStream createZipStream() throws IOException {
InputStream is = new ClassLoaderFileOpener
().getResourceAsStream("/autobase.zip");

try {
is.available();
} catch(Exception ioe) {
System.out.println("class loader could not load
autobase.zip trying with SCH") ;

is = ServletContextHolder.getServletContext
().getResourceAsStream("/WEB-INF/classes/autobase.zip");
}

return new ZipInputStream(new BufferedInputStream(is));

Robert Fischer

unread,
Jun 19, 2009, 5:31:20 PM6/19/09
to grails-...@googlegroups.com
Hrm. I wonder...should we just use
ServletContextHolder.getServletContext().getResourceAsStream(...) all the time?

~~ Robert.

> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "Autobase" group.
> To post to this group, send email to grails-...@googlegroups.com
> To unsubscribe from this group, send email to grails-autoba...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/grails-autobase?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
>

--
~~ Robert Fischer, Smokejumper IT Consulting.
Enfranchised Mind Blog http://EnfranchisedMind.com/blog

Check out my book, "Grails Persistence with GORM and GSQL"!
http://www.smokejumperit.com/redirect.html

signature.asc
Reply all
Reply to author
Forward
0 new messages