Commons chain: Registring commands outside web application?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Commons chain: Registring commands outside web application?

Vinicius Caldeira Carvalho
Hello there!
Since ConfigParser.parse(Catalog, URL) is deprecated. What's the right
way to load a catalog descriptor from a non web application?
Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Commons chain: Registring commands outside web application?

Craig McClanahan-2
On 6/2/05, Vinicius Caldeira Carvalho <[hidden email]> wrote:
> Hello there!
> Since ConfigParser.parse(Catalog, URL) is deprecated. What's the right
> way to load a catalog descriptor from a non web application?
> Thanks
>

As the deprecation message says, use ConfigParser.parse(URL) instead,
and pass in the URL of an xml document that has potentially multiple
catalogs in it:

    <catalogs>

        <catalog name="foo">
            ...
        </catalog>

        <catalog name="bar">
            ...
        </catalog>

    </catalogs>

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[fileupload] Write to disk error

Luke-2
Hi;

I have the following code:

File uploadFull = new File(uploadFullDir + fileName);
myLogger.debug(upLoadFiles.class.getName() + " uploadFull: " +
uploadFull.toString());
File uploadThumb = new File(thumbDir + fileName);
myLogger.debug(upLoadFiles.class.getName() + " uploadThumb: " +
uploadThumb.toString());
file.write(uploadFull);
file.write(uploadThumb);

The console is producing this error. I don't know why. It is happening on
the line: file.write(uploadThumb). The directory structure exists. Why would
there be a null pointer?

Any ideas?

Thanks,

Luke

19484 [http-80-Processor25] DEBUG servlet.upLoad.upLoadFiles -
servlet.upLoad.upLoadFiles Pic directory
E:\testSite\pictures\atouchofclass\20050101\pics\
19484 [http-80-Processor25] DEBUG servlet.upLoad.upLoadFiles -
servlet.upLoad.upLoadFiles Thumb directory
E:\testSite\pictures\atouchofclass\20050101\thumbs\
19515 [http-80-Processor25] DEBUG servlet.upLoad.upLoadFiles -
servlet.upLoad.upLoadFiles uploadFull:
E:\testSite\pictures\atouchofclass\20050101\pics\me_dolphin.jpg
19515 [http-80-Processor25] DEBUG servlet.upLoad.upLoadFiles -
servlet.upLoad.upLoadFiles uploadThumb:
E:\testSite\pictures\atouchofclass\20050101\thumbs\me_dolphin.jpg
java.lang.NullPointerException
at
org.apache.commons.fileupload.DefaultFileItem.write(DefaultFileItem.java:434
)
at servlet.upLoad.upLoadFiles.doPost(upLoadFiles.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:214)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:198)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:152)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
.java:540)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:102)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137
)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117
)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:102)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:705)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:683)
at java.lang.Thread.run(Thread.java:536)



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [fileupload] Write to disk error

Martin Cooper
On 6/7/05, Luke <[hidden email]> wrote:

> Hi;
>
> I have the following code:
>
> File uploadFull = new File(uploadFullDir + fileName);
> myLogger.debug(upLoadFiles.class.getName() + " uploadFull: " +
> uploadFull.toString());
> File uploadThumb = new File(thumbDir + fileName);
> myLogger.debug(upLoadFiles.class.getName() + " uploadThumb: " +
> uploadThumb.toString());
> file.write(uploadFull);
> file.write(uploadThumb);
>
> The console is producing this error. I don't know why. It is happening on
> the line: file.write(uploadThumb). The directory structure exists. Why would
> there be a null pointer?

As the JavaDoc comments explain, write() is only guaranteed to work
once for any given file item.

--
Martin Cooper


> Any ideas?
>
> Thanks,
>
> Luke
>
> 19484 [http-80-Processor25] DEBUG servlet.upLoad.upLoadFiles -
> servlet.upLoad.upLoadFiles Pic directory
> E:\testSite\pictures\atouchofclass\20050101\pics\
> 19484 [http-80-Processor25] DEBUG servlet.upLoad.upLoadFiles -
> servlet.upLoad.upLoadFiles Thumb directory
> E:\testSite\pictures\atouchofclass\20050101\thumbs\
> 19515 [http-80-Processor25] DEBUG servlet.upLoad.upLoadFiles -
> servlet.upLoad.upLoadFiles uploadFull:
> E:\testSite\pictures\atouchofclass\20050101\pics\me_dolphin.jpg
> 19515 [http-80-Processor25] DEBUG servlet.upLoad.upLoadFiles -
> servlet.upLoad.upLoadFiles uploadThumb:
> E:\testSite\pictures\atouchofclass\20050101\thumbs\me_dolphin.jpg
> java.lang.NullPointerException
> at
> org.apache.commons.fileupload.DefaultFileItem.write(DefaultFileItem.java:434
> )
> at servlet.upLoad.upLoadFiles.doPost(upLoadFiles.java:89)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:237)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:157)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:214)
> at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
> t.java:104)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> at
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
> Valve.java:198)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:152)
> at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
> t.java:104)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
> .java:540)
> at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
> t.java:102)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137
> )
> at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
> t.java:104)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117
> )
> at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
> t.java:102)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> :109)
> at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
> t.java:104)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
> at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
> ction(Http11Protocol.java:705)
> at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
> at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
> a:683)
> at java.lang.Thread.run(Thread.java:536)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]