Patches item #862668, was opened at 2003-12-19 02:55
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376687&aid=862668&group_id=22866

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: yan zijian (jamesyan)
Assigned to: Nobody/Anonymous (nobody)
Summary: Patch for [ 608729 ] Deployment fails if no env-entry-value 

Initial Comment:
I am working for clearing bug [608729 ] Deployment fails 
if no env-entry-value. And I almost fixed that bug, but 
it still has some problem. 

When you take a moment to see bug #608729, It's 
meaning is about that env-entry-value tag is optional in 
dtd, but when deploying a sessionbean without defining 
env-entry-value but dedined env-entry-name and env-
entry-type, jboss will throw deploymentexception.
now, i can fix this error, make the result as when env-
entry-type equals java.lang.String, i can put a default 
String object in jndi context through new String(), but if 
the env-entry-type equals to java.lang.Double or some 
other as java.lang.Integer, i can't generate a default 
Double object without a init value, should i generate a 
default double object with default value zero(0)? 

Now I can't make a decide, if you think that if a session 
bean' ejb-jar.xml has not assigned env-entry-value 
when env-entry-value is java.lang.Double or any other 
such as java.lang.Integer, jboss should define a default 
number such as 0 to init Double object or Integer 
object, then put it in jndi context, I will complete that 
job, waiting your reply.

thanks.

Regards

Patch to apply:

public void importEjbJarXml(Element element) throws 
DeploymentException {
        name = getElementContent(getUniqueChild
(element, "env-entry-name"));
        type = getElementContent(getUniqueChild
(element, "env-entry-type"));
        // Strip any surrounding spaces
        type = type.trim();
        try {
            ClassLoader loader = 
EnvEntryMetaData.class.getClassLoader();
            Class typeClass = loader.loadClass(type);
            if( typeClass == String.class ) {
                Element valueElement = 
getOptionalChild (element, "env-entry-value");
                if (valueElement == null) {
                    value = new String ();
                }
                else {
                    value = getElementContent 
(valueElement);
                }
            }
            else {
                value = getElementContent
(getUniqueChild(element, "env-entry-value"));
            }
        }
        catch (ClassNotFoundException ce) {
            throw new DeploymentException (ce);
        }
    }

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376687&aid=862668&group_id=22866


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to