Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ServletConfig has not been initialized

ubuntupenguinMar 19 2009 — edited Mar 19 2009
I have a download servlet that I am working with (actually BalusC's servlet code that I have modified/broken). When I go to get the mime type of the file that I am sending by :
String contentType = getServletContext().getMimeType(file.getName());
I get this error.
java.lang.IllegalStateException: ServletConfig has not been initialized
I am overriding the init function so that I can pool database connections and load the root location of the downloadable files if that helps any.

Thanks ,
Chem E
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 16 2009
Added on Mar 19 2009
3 comments
5,297 views