Confirmed. Hacking the ext.fileupload.jar to use the MANIFEST.MF below
make it work. The changed line is the Import-Package one, where I
specify dependency to javax.servlet.* as optional. I can still make
FileUpload work using the built-in Restlet component HTTP Server.
Should I make a JIRA request for this? This is very trivial... ;)
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.5.0_14-b03 (Sun Microsystems Inc.)
Bundle-ManifestVersion: 2
Bundle-Name: Restlet Extension - FileUpload
Bundle-SymbolicName: org.restlet.ext.fileupload
Bundle-Version: 1.1
Bundle-Vendor: Noelios Consulting
Export-Package: org.restlet.ext.fileupload;uses:="org.restlet.resource
,org.restlet.data,org.apache.commons.fileupload"
Import-Package:
javax.servlet;resolution:="optional",javax.servlet.http;resolution:="optional",org.apache.commons.fi
leupload,org.restlet,org.restlet.data,org.restlet.resource,org.restle
t.service,org.restlet.util
Name: org.restlet.ext.fileupload
Implementation-Title: org.restlet.ext.fileupload_1.2
Implementation-Version: 1.1 Snapshot (build 215)
Implementation-Vendor: Noelios Consulting
Hendy Irawan wrote:
After battling various strange things with latest Restlet milestone
(without OSGi support incorporated), I tried Restlet snapshot and
wow... I need no more Engine.setInstance() hack... and Component
actually calls Application.createRoot(). (For some strange reason, it
didn't, and left my Restlet server in a "blank" state. I have to
update my restlet app bundle on every launch to make it work)
Latest snapshot is working fine.
(plus, thanks for mentioning me in the Changelog) ^)^
No workarounds needed now, except...
Why ext.fileupload requires 'javax.servlet' and 'javax.servlet.http'
(in OSGi manifest)? There has to be a good reason for this, because in
my experience it works fine without (i.e. just using the built-in
Restlet HTTP server component)
If it's not always required then should be marked as
resolution:=optional in MANIFEST.MF (or maybe other way). Thanks.
--
Best regards,
Hendy Irawan