Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002594 [Hessian] crash always 04-11-08 04:51 07-17-08 22:45
Reporter maslovalex View Status public  
Assigned To
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version Product Version 3.1.5
  Product Build
Summary 0002594: HessianSkeleton.invoke does not closes output stream in case of Exception
Description Server->Client checked exception propagation does not work because of subj.

Basically client does not receive everything to complete Exception deserialization
Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0003260)
lizongbo
07-12-08 10:33
edited on: 07-12-08 10:37

in 3.1.6 also have the bug ,the cause of is that:
when you use hession 2.0 by Hessian2Output&12290;
then when get HessianMetaInfoAPI or got an Exception ,Hessian2Output 's out method not executed .

so I fix the bug by an "out.cloes();" fro every "return;" in "invoke" method .

the code ifs follow:

-----------------------------
    public void invoke(Object service,
                       AbstractHessianInput in,
                       AbstractHessianOutput out) throws Exception {
        ServiceContext context = ServiceContext.getContext();

        // backward compatibility for some frameworks that don't read
        // the call type first
        in.skipOptionalCall();

        String header;
        while ((header = in.readHeader()) != null) {
            Object value = in.readObject();

            context.addHeader(header, value);
        }

        String methodName = in.readMethod();
        Method method = getMethod(methodName);

        if (method != null) {
        } else if ("_hessian_getAttribute".equals(methodName)) {
            String attrName = in.readString();
            in.completeCall();

            String value = null;

            if ("java.api.class".equals(attrName)) {
                value = getAPIClassName();
            } else if ("java.home.class".equals(attrName)) {
                value = getHomeClassName();
            } else if ("java.object.class".equals(attrName)) {
                value = getObjectClassName();
            }

            out.startReply();

            out.writeObject(value);

            out.completeReply();
            out.close();// fix bug for Hessian2Output,added by lizongbo
            return;
        } else if (method == null) {
            out.startReply();
            out.writeFault("NoSuchMethodException",
                           "The service has no method named: " + in.getMethod(),
                           null);
            out.completeReply();
            out.close();// fix bug for Hessian2Output,added by lizongbo
            return;
        }

        Class[] args = method.getParameterTypes();
        Object[] values = new Object[args.length];

        for (int i = 0; i < args.length; i++) {
            values[i] = in.readObject(args[i]);
        }

        Object result = null;

        try {
            result = method.invoke(service, values);
        } catch (Throwable e) {
            if (e instanceof InvocationTargetException) {
                e = ((InvocationTargetException) e).getTargetException();
            }

            log.log(Level.WARNING, e.toString(), e);

            out.startReply();
            out.writeFault("ServiceException", e.getMessage(), e);
            out.completeReply();
            out.close();// fix bug for Hessian2Output,added by lizongbo
            return;
        }

        // The complete call needs to be after the invoke to handle a
        // trailing InputStream
        in.completeCall();

        out.startReply();

        out.writeObject(result);

        out.completeReply();
        out.close();
    }

----------------------

 
(0003278)
emil
07-17-08 22:45

Fixed in 3.2.0

hessian/3551
hessian/3552
hessian/3553
hessian/3554
 

- Issue History
Date Modified Username Field Change
04-11-08 04:51 maslovalex New Issue
07-12-08 10:33 lizongbo Note Added: 0003260
07-12-08 10:36 lizongbo Note Added: 0003261
07-12-08 10:37 lizongbo Note Edited: 0003260
07-12-08 10:37 lizongbo Note Deleted: 0003261
07-12-08 10:43 lizongbo Issue Monitored: lizongbo
07-17-08 22:45 emil Status new => closed
07-17-08 22:45 emil Note Added: 0003278
07-17-08 22:45 emil Resolution open => fixed


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
37 total queries executed.
29 unique queries executed.
Powered by Mantis Bugtracker