velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yoshia Makino <mak...@valuecommerce.ne.jp>
Subject RE: Velocity initialize failure in resin
Date Fri, 13 Dec 2002 00:46:39 GMT
I'll just include my last mail before last regarding the seg fault.
The jvm is dropped and since I was using resin, the wrapper.pl was also
killed.



--

OK, I tried the following piece of code and I strace'ed it.



import java.io.StringWriter;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.Template;
import org.apache.velocity.app.Velocity;
import org.apache.velocity.app.VelocityEngine;

public class VelocityTest {
    public static void main(String[] args) {
        try {
            VelocityEngine ve = new VelocityEngine();
            ve.init();
            VelocityContext context = new VelocityContext();
            context.put("name", new String("Velocity"));
            Template template = null;
            template = ve.getTemplate("mytemplate.vm");
            StringWriter sw = new StringWriter();
            template.merge(context, sw);
            sw.flush();
            sw.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

The difference b/w the one that works and the one that doesn't work is as
follows :- Doesn't work :
stat64("/home/shapps/org/apache/commons/collections/ExtendedProperties$Prope
rtiesTokenizer.class", 0x9fffcc78) = -1 ENOENT (No such file or directory)
rt_sigprocmask(SIG_BLOCK, [USR2], NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK,
[USR2], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [USR2], NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [USR2], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK,
[USR2], NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [USR2], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [USR2], NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK,
[USR2], NULL, 8) = 0
--- SIGSEGV (Segmentation fault) ---
--- SIGSEGV (Segmentation fault) ---
--- SIGSEGV (Segmentation fault) ---
--- SIGSEGV (Segmentation fault) ---

Works :-
stat64("/tmp/org/apache/commons/collections/ExtendedProperties$PropertiesTok
enizer.class", 0xbfffcbc4) = -1 ENOENT (No such file or directory)
rt_sigprocmask(SIG_BLOCK, [USR2], NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK,
[USR2], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [USR2], NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [USR2], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK,
[USR2], NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [USR2], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [USR2], NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK,
[USR2], NULL, 8) = 0
--- SIGSEGV (Segmentation fault) ---
rt_sigreturn(0x480e7880)                = 1
--- SIGSEGV (Segmentation fault) ---
rt_sigreturn(0x480e6b50)                = 1
stat64("/tmp/org/apache/velocity/runtime/log/LogManager.class", 0xbfffcb9c)
= -1 ENOENT (No such file or dir
ectory)
rt_sigprocmask(SIG_BLOCK, [USR2], NULL, 8) = 0



-----Original Message-----
From: Geir Magnusson Jr. [mailto:geirm@adeptra.com] 
Sent: Friday, December 13, 2002 1:26 AM
To: Velocity Users List
Subject: Re: Velocity initialize failure in resin



On Wednesday, December 11, 2002, at 11:01 PM, Yoshia Makino wrote:

> I found the problem.
>
> This was happening because
> org.apache.commons.collections.ExtendedProperties
> is not very nice.
>
> It was using a while(true) loop and using NullPointerExceptions to
> figure
> out the EOF of the velocity.properties file.  So when the
> BufferedReader.readLine() was called, it seg faulted when EOF was 
> reached
> instead of throwing a NullPointerException.
>

it *seg faulted*?  Dropping the JVM?


> Althought this must obviously work for most people, it was causing 
> problems
> in this case.
>
-- 
Geir Magnusson Jr                                   203-355-2219(w)
Adeptra, Inc.                                       203-247-1713(m)
geirm@adeptra.com


--
To unsubscribe, e-mail:
<mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:velocity-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message