[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.webtools] Q about MethodElement.getEnterpriseBean()

I have some code like this that is failing:

                EnterpriseBean bean = method.getEnterpriseBean();
                if (bean != null) {
                  String beanName = bean.getName();
                  if (beanName != null) {
                    System.out.println(beanName);
                  }
                }

When I run it, bean is not null, but its name and most of its other parts are null.

method is an instance of MethodElement, and its values, such as name, seem be to be set correctly. It just fails in finding the enterpriseBean with a short href like this:

<enterpriseBean xmi:type="com.ibm.etools.ejb:ContainerManagedEntity" href="META-INF/ejb-jar.xml#AccountEJB"/>

It does return a non-null value; it's just that the fields of that non-null value are mostly null.

When I manually update the XMI file to contain 'long' hrefs:

<enterpriseBean xmi:type="com.ibm.etools.ejb:ContainerManagedEntity" href="platform:/resource/cmpaSampleEJB/ejbModule/META-INF/ejb-jar.xml#AccountEJB"/>

the properties of bean have correct non-null values and the code works.

This code worked with the short hrefs in previous versions of Eclipse/WebSphere, it's only failing now.

Is there a way to get this code to work without updating the values of the href fields in the ibm-ejb-jar-ext-wbi.xmi file?