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 Thu, 12 Dec 2002 01:37:34 GMT
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


Of course, I am still clueless on why this is happening. 


-----Original Message-----
From: Yoshia Makino [mailto:makino@valuecommerce.ne.jp] 
Sent: Thursday, December 12, 2002 9:57 AM
To: 'Velocity Users List'
Subject: RE: Velocity initialize failure in resin


Nope.

There is a try catch around the configuration.load() as follows :- 

private  ExtendedProperties configuration = new ExtendedProperties();
org.apache.velocity.runtime.RuntimeInstance.setDefaultProperties(){
	try {
             configuration.load( inputStream );
	} catch ( Exception e ) {
		e.printStackTrace();
	}
	
}

The exception is never reached.  Its crashing inside the ExtendProperties
instance.

What I find confusing is that I am using the default VelocityEngine and am
not doing anything funky.

I suppose the next step is to get the source for ExtendedProperties and
trace through that.  I just thought it may be more of a configuration error
rather than a code problem since this setup has been deployed in other
machines before.

Thanks


-----Original Message-----
From: Geir Magnusson Jr. [mailto:geirm@adeptra.com] 
Sent: Wednesday, December 11, 2002 10:37 PM
To: Velocity Users List
Subject: Re: Velocity initialize failure in resin


And you have no idea where?

Hm.  Can you put a try around that and catch anything that might get 
thrown?

On Wednesday, December 11, 2002, at 06:13 AM, Yoshia Makino wrote:

> Hi,
> I am using resin 2.1.6 and velocity 1.3.1 rc-2 and I am experiencing
> difficulties in bringing resin up.
>
> When I initialize the VelocityEngine, resin crashes quietly. ie 
> without a stacktrace.
>
> Using the System.out debug method, I found that the crash occurs
> whilst executing
>
> org.apache.velocity.runtime.RuntimeInstance.setDefaultProperties(){
>             configuration.load( inputStream );
> }
>
>
>
> I have installed the same setup in a 3-4 other machines without a 
> problem.
>
> Can anyone help me track this problem down or has anyone experienced 
> the same problem?
>
> Thank you
> Yoshia
>
-- 
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>

--
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