Bug in JBI?

All,
I am evaluating JBI. I understand that the WSDL 2.0 implementation is based on a draft and not on the final version therefore I decided to revert to WSDL 1.1.
My problem is in com.sun.jbi.messaging.util.WSDLHelper#getOperationsForService11(Document , QName). To understand the problem, lets look at the way the "porttypes" and the "operations" are found:
#getPortType: definitions.getElementsByTagNameNS(WSDL_11, PORTTYPE)
#getOperationsForService11: portType.getElementsByTagNameNS(WSDL_11, OPERATION)
this does specify the namespace as WSDL_11. Now when it tries to look for "input" and "ouput" within an "operation" it goes by the following code:
NodeList ins = op.getElementsByTagName(IN_MSG);
NodeList outs = op.getElementsByTagName(OUT_MSG);
Hence no namespace therefore my generated WSDL has to be modified from:
<wsdl:operation name="sendMail">
<wsdl:input name="sendMailRequest" message="impl:sendMailRequest"/>
<wsdl:output name="sendMailResponse" message="impl:sendMailResponse"/>
</wsdl:operation>
to
<wsdl:operation name="sendMail">
<input name="sendMailRequest" message="impl:sendMailRequest"/>
<output name="sendMailResponse" message="impl:sendMailResponse"/>
</wsdl:operation>
which is a pain because I really would like to automate the process. Am I missing something?
Regards
Yoram

Thanks, I've tried but I have a problem (probably me being stupid but here we go)
This is my WSDL
<?xml version="1.0" encoding="UTF-8"?>
<definitions
targetNamespace="http://localhost/namespace/jbi/com.test.jbi.ItineraryConfirmationService.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost/namespace/jbi/com.test.jbi.ItineraryConfirmationService.wsdl"
xmlns:intf="http://localhost/namespace/jbi/com.test.jbi.ItineraryConfirmationService.wsdl"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
<types>
<schema elementFormDefault="qualified"
targetNamespace="http://localhost/namespace/jbi/com.test.jbi.ItineraryConfirmationService.wsdl" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="sendMail">
<complexType>
<sequence>
<element name="in0" type="xsd:string"/>
<element name="in1" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="sendMailResponse">
<complexType/>
</element>
</schema>
</types>
<message name="sendMailRequest">
<part element="impl:sendMail" name="parameters"/>
</message>
<message name="sendMailResponse">
<part element="impl:sendMailResponse" name="parameters"/>
</message>
<portType name="ItineraryConfirmationServiceOperations">
<operation name="sendMail">
<input message="impl:sendMailRequest" name="sendMailRequest"/>
<output message="impl:sendMailResponse" name="sendMailResponse"/>
</operation>
</portType>
<binding name="itineraryconfirmation.wsdlSoapBinding" type="impl:ItineraryConfirmationServiceOperations">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="sendMail">
<wsdlsoap:operation soapAction=""/>
<input name="sendMailRequest">
<wsdlsoap:body use="literal"/>
</input>
<output name="sendMailResponse">
<wsdlsoap:body use="literal"/>
</output>
</operation>
</binding>
<service name="ItineraryConfirmationServiceOperationsService">
<port binding="impl:itineraryconfirmation.wsdlSoapBinding" name="itineraryconfirmation.wsdl">
<wsdlsoap:address location="http://localhost/jbi/itineraryconfirmation.wsdl"/>
</port>
</service>
</definitions>
When I use this code I get the namespaceURI
     public static void main(String[] args)
          throws Exception
          DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
          factory.setNamespaceAware(true);
          DocumentBuilder builder = factory.newDocumentBuilder();
          Document doc = builder.parse(new File("C:/b-wsdl.xml"));
          System.out.println(doc.getDocumentElement().getNamespaceURI());
but when this code is used in JBI (WSDLHelper), getWSDLVersion returns null, and since there is no check in getOperationsForServices I get a nullpointerexception
public static HashMap getOperationsForService(Document serviceDesc, QName serviceName)
throws javax.jbi.messaging.MessagingException
version = getWSDLVersion(serviceDesc);
private static String getWSDLVersion(Document description)
return description.getDocumentElement().getNamespaceURI();
}

Similar Messages

  • Cannot install sun-http-binding jbi component

    Hello!
    I'm trying to install httpbc.jar into a cluster environment and I'm faced with a following error message:
    java.lang.Integer cannot be cast to java.lang.String at com.sun.jbi.management.facade.Installer.addComponentToTarget(Installer.java:942) at com.sun.jbi.management.facade.Installer.installComponentToTarget(Installer.java:567) at com.sun.jbi.management.facade.Installer.install(Installer.java:215) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93) at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27) at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208) at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120) at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262) at javax.management.StandardMBean.invoke(StandardMBean.java:391) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:178) at com.sun.esb.management.base.services.AbstractServiceMBeansImpl.invokeMBeanOperation(AbstractServiceMBeansImpl.java:498) at com.sun.esb.management.base.services.AbstractServiceMBeansImpl.invokeMBeanOperation(AbstractServiceMBeansImpl.java:639) at com.sun.esb.management.impl.installation.InstallationServiceMBeanImpl.installComponent(InstallationServiceMBeanImpl.java:135) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93) at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27) at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208) at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120) at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262) at javax.management.StandardMBean.invoke(StandardMBean.java:391) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:178) at com.sun.esb.management.base.services.AbstractServiceImpl.invokeMBeanOperation(AbstractServiceImpl.java:330) at com.sun.esb.management.impl.installation.InstallationServiceImpl.installComponent(InstallationServiceImpl.java:111) at com.sun.jbi.ui.client.JBIAdminCommandsClientImpl.installComponent(JBIAdminCommandsClientImpl.java:409) at com.sun.jbi.jsf.bean.InstallationBean.installValidatedArchiveToTarget(InstallationBean.java:501) at com.sun.jbi.jsf.bean.InstallationBean.tryInstallToOneTarget(InstallationBean.java:410) at com.sun.jbi.jsf.bean.InstallationBean.installValidatedArchive(InstallationBean.java:175) at com.sun.jbi.jsf.handlers.InstallationHandlers.install(InstallationHandlers.java:1566) at com.sun.jbi.jsf.handlers.InstallationHandlers.jbiInstallValidatedArchive(InstallationHandlers.java:474) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.jsftemplating.layout.descriptors.handler.Handler.invoke(Handler.java:421) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:343) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:317) at com.sun.jsftemplating.layout.event.CommandActionListener.invokeCommandHandlers(CommandActionListener.java:133) at com.sun.jsftemplating.layout.event.CommandActionListener.processAction(CommandActionListener.java:81) at javax.faces.event.ActionEvent.processListener(ActionEvent.java:77) at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:746) at javax.faces.component.UICommand.broadcast(UICommand.java:368) at com.sun.webui.jsf.component.WebuiCommand.broadcast(WebuiCommand.java:160) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752) at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117) at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:80) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244) at com.sun.enterprise.tools.admingui.servlet.DelayedInitFacesServlet.service(DelayedInitFacesServlet.java:89) at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198) at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:240) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214) at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265) at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
    This seems to be glassfish bug.
    Also, could you please tell me where can I find the sources for com.sun.jbi.management.facade.Installer?
    Thanks in advance!
    Edited by: Koon_Tacker on May 28, 2008 6:46 AM

    The solution comes with the latest release of jbi-runtime. It appears to be fixed in March, 2008

  • Bug in XSLT SE?

    I think I found a potential bug in the XSLT SE, but Im not sure if its a bug, and where to report it. (OpenESB / OpenJBI components?)
    I am trying to use the XSLT SE, in combination with the HTTP BC to create a filter for several operations spread over various services (a canonical schema filter, if you will)
    Though in all honesty, I have not gotten very far. Before I describe the situation further, I am trying all this on Glassfish v2 beta 2 (b41d) and openESB Milestone4 (though I have also tried the lastest promoted build)
    Here is the situation.
    There is a service, let's call it databaseservice for now. It basically has 2 operations; one 'read' operation, which returns a set of records, and one 'modify' operation, which basically modifies a few attributes on a specified record.
    The idea is that there are 2 of such databaseservices, each using a slightly different SOAP message format. Now, I want to make something that collects data from these services into a central database. (not an ideal situation, but the whole use-case is too much to explain)
    So, to facilitate this, I wan to create a (one or more) XSLT service(s), which translate each databaseservice's own format to a centralized format. I would post a request in teh centralized format to the XSLT service, it would translate it to the dialect for the specific server, execute the call, and translate the response back.
    All sounds easy enough, and it works up to a degree. That is. If databaseservice would have had just one operation, it would have worked flawlessly. As it stands now however, I cannot get 2 operations to work.
    To be more specific;
    - The database service has one WSDL, with 2 operation defined it. (one porttype, and partner/role)
    - The XSLT service has one WSDL file, with 2 operations, but I have also tried to use one WSDL for one operation each.
    The problem that occurs is, that when I have more then 2 operations invoking the same WSDL (or partnerlink if you will) in my transformmap.xml, it always executes the 'last' defined operation in the transformmap.
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <transformmap
         xmlns='http://xml.netbeans.org/schema/transformmap.xsd'
         xmlns:ns1="urn:centralschema">
        <service
            xmlns:ns1="urn:centralschema"
            partnerLinkType="ns1:CentralDBServicePartnerlink"
            roleName="CentralDBServicePartnerlinkRole">
            <operation
                opName="readOperation"
                file="readOperationRequest.xsl"
                transformJBI="false">
                <invokes
                    xmlns:ns1="urn:serviceschema"
                    partnerLinkType="ns1:DBServicePartnerLink"
                    roleName="DBServicePartnerlinkRole"
                    opName="readOperation"
                    file="readOperationResponse.xsl"
                    transformJBI="false"/>
            </operation>
         <operation
                opName="modifyOperation"
                file="modifyOperationRequest.xsl"
                transformJBI="false">
                <invokes
                    xmlns:ns1="urn:serviceschema"
                    partnerLinkType="ns1:DBServicePartnerLink"
                    roleName="DBServicePartnerlinkRole"
                    opName="modifyOperation"
                    file="modifyOperationResponse.xsl"
                    transformJBI="false"/>
            </operation>
        </service> 
    </transformmap>(note, this is edited to fit example)
    So, way I would want to call readOperation on the XSLT , the first transformation would already use the xsl file of the modifyOperation operation (modifyOperationResponse.xsl), this will do nasty things to our databaseservice, in return that XSLT is unable to complete the request-response operation, and timing out the request.
    The only way i could see to go around this is to define seperate WSDLs for each operation, both for the centralizedserivce, as for each operation in the dbservice, but I doubt that would work well (more WSDL's binding to same address), not too mention that is just ...not very easy to maintain in a larger environment.
    I hope this describes the situation Im in, and the problems Im having. Any help as to if this is a bug or not, or a solution, would be, as always, greatly appreciated.

    The XSLT SE endpoints as you've defined them will resolve to a single entry in the JBI descriptor, which does not contain the operation name. One entry, one service endpoint. The single entry resolves to the last operation in the XSLT config file.
    Create a unique partnerLinkRole in the WSDL for the 2nd operation. Update the XSLT config file by adding the operation with the new role. This should cause a 2nd JBI descriptor entry to be created.
    Alternatively, I believe the CASA editor addresses this exact issue when 2 operations share the same partnerLinkType, role, and portType.
    Regards,
    Kevan

  • WSDL in JBI

    HI,
    I read the spec well lot of stress was put on WSDL based service description.But when i look at various sample components provided with JBI RI.I hardly see services describing them with WSDL. Is it something against the specs.
    most of the time i find componenets returning NULL when
    getServiceDescription( javax.jbi.servicedesc.ServiceEndpoint endpoint)
    is called on component .
    But i want to know why is it not forced that component should return a valid WSDL based description.As thats the only point of coupling supposed to be in true SOA architecture which stresses on loose coupling.
    Regards
    Pavitar Singh

    Pavitar,
    JBI uses the WSDL 2.0 services model extensively. This gives it very good alignment with WSDL described services, including WSDL 1.1. (JBI itself does not provide APIs for manipulating WSDL documents; that is for the next version of JSR 110 to provide).
    Components that are service providers MUST return appropriate WSDL descriptions of those services when they are activated. If a component returns null from its getServiceDescription() method implementation, it means that the given endpoint is not active, or that the component is behaving incorrectly.
    JBI implementations MAY check that components are supplying service descriptions, but this is up to implementations. The JBI specification tries to give implementations room to differentiate themselves. In this instance, an implementation may desire to load a service description "lazily." The NMR needs the service description only if a consumer creates a new MessageExchange instance using the createExchange(javax.xml.namespace.QName serviceName, javax.xml.namespace.QName operationName) method from the MessageExchangeFactory.
    JBI supports three types of service discovery/addressing:
    1. dynamic: a consumer finds and uses a service provider endpoint at run-time, using the service description as the sole source of information about interacting with the service.
    2. static: a consumer is configured/programmed at design-time with a knowledge of the service provider endpoint.
    3. static type: a consumer is configured/programmed at design-time with a knowledge of the service provider type (WSDL interface/portType), but doesn't know the provider's endpoint. The endpoint is discovered at run-time, either automatically by the NMR, or programmatically by the component.
    Obviously, maximum decoupling comes from using dynamic addressing, but static-type is reasonable in a SOA environment as well.
    (As an aside, the JBI service assembly "connections" metadata can be used to rewire static service dependencies, so they aren't quite as inflexible as one might suppose.)
    If you think that a component is behaving incorrectly, please inform the component supplier. If that component is part of the JBI reference implementation, please file a bug with Sun against the JBI RI.
    Best regards,
    -Ron

  • Bug. Dock now wants 2 clicks to change programs on different Spaces.

    Hi,
    This just started happening yesterday. Opening a program using the dock wasn't affected. I use Spaces, this only occurs when I want to switch to a program that is assigned to a different space than the active program.
    Previously, 1 click would select whatever program I had running, and everything would move to the appropriate Space and that would become the active program. As of yesterday I must first click on the program's dock icon, wait a second, and click again, then it would move to the space on which the program was opened.
    Say I have Safari, Pages, and Mail all open on space 1, but Firefox open on page 2. If I'm in Safari, and want to go to Mail, no problem. I just click on the Mail dock icon and it comes to the front. If, however, I want to switch to Firefox, I have to hit the dock icon twice, fairly slowly. On the first click "Firefox" will appear in the menu bar, but it will not 'move' to Firefox until I click a second time. Returning to Safari, or any program not running on the same space as Firefox requires the same action.
    If I open a new program, I click once, the program starts up, and it moves to the appropriate space - same as normal. It is just in switching programs that this happens.
    Has anyone else experienced this bug? Any ideas on how to get it to behave normally?
    Thanks - JB

    I am experiencing similar symptoms trying to get AD authentication to work in apex 3.2.1. After reading your thread, I changed to use a custom page already in the app (I'm testing with the demo app) and it seemed to accept my credentials. However... The application itself is not showing any data now. When I have the auth scheme set back to the original (I think it is using DB accounts), I see data again. So even though it seems that I had a successful auth, something else is wrong. Did you ever solve your issue with an acceptable solution or work-around?

  • Index with "or" clause (BUG still exists?)

    The change log for 2.3.10 mentions "Fixed a bug that caused incorrect query plans to be generated for predicates that used the "or" operator in conjunction with indexes [#15328]."
    But looks like the Bug still exists.
    I am listing the steps to-repro. Let me know if i have missed something (or if the bug needs to be fixed)
    DATA
    dbxml> openContainer test.dbxml
    dbxml> getDocuments
    2 documents found
    dbxml> print
    <node><value>a</value></node>
    <node><value>b</value></node>
    INDEX (just one string equality index on node "value")
    dbxml> listIndexes
    Index: unique-node-metadata-equality-string for node {http://www.sleepycat.com/2002/dbxml}:name
    Index: node-element-equality-string for node {}:value
    2 indexes found.
    QUERY
    setVerbose 2 2
    preload test.dbxml
    query 'let $temp := fn:compare("test", "test") = 0
    let $results := for $i in collection("test.dbxml")
    where ($temp or $i/node[value = ("a")])
    return $i
    return <out>{$temp}{$results}</out>'
    When $temp is true i expected the result set to contain both the records, but that was not the case with the index. It works well when there is no index!
    Result WITH INDEX
    dbxml> print
    <out>true<node><value>a</value></node></out>
    Result WITHOUT INDEX
    dbxml> print
    <out>true<node><value>a</value></node><node><value>b</value></node></out>

    Hi Vijay,
    This is a completely different bug, relating to predicate expressions that do not examine nodes. Please try the following patch, to see if it fixes this bug for you:
    --- dbxml-2.3.10-original/dbxml/src/dbxml/optimizer/QueryPlanGenerator.cpp     2007-04-18 10:05:24.000000000 +0100
    +++ dbxml-2.3.10/dbxml/src/dbxml/optimizer/QueryPlanGenerator.cpp     2007-08-08 11:32:10.000000000 +0100
    @@ -1566,11 +1572,12 @@
         else if(name == Or::name) {
              UnionQP *unionOp = new (&memMgr_) UnionQP(&memMgr_);
    +          result.operation = unionOp;
              for(VectorOfASTNodes::iterator i = args.begin(); i != args.end(); ++i) {
                   PathResult ret = generate(*i, ids);
                   unionOp->addArg(ret.operation);
    +               if(ret.operation == 0) result.operation = 0;
    -          result.operation = unionOp;
         // These operators use the presence of the node arguments, not their valueJohn

  • Bug report follow-up

    is there a way to follow-up on a bug report that i submitted?  i have the bug number, but would like to see if the report was understood, filled out properly and determine the status of the bug report.
    thanks,
    doug

    They comment on bugs if actions were taken. Otherwise - don't expect any feedback.

  • Solaris8 and 9 (possibly 7) /dev/poll driver bug report.

    Hello,
    I'd like to report a bug in the solaris 8 and 9 /dev/poll driver (poll(7d)).
    As i do not have a support account with sun or anything like that, there
    seems to be no other way to do that here (which is of course a very sad
    thing).
    Bug details:
    The /dev/poll device provides an ioctl-request (DP_ISPOLLED) for checking
    if a particular filedescriptor is currently in the set of monitored
    filedescriptors for that particular /dev/poll fd set (open /dev/poll fd).
    A quote from the documentation of the poll(7d) manual page taken from
    Solaris9:
    "DP_ISPOLLED ioctl allows you to query if a file descriptor is already in
    the monitored set represented by fd. The fd field of the pollfd structure
    indicates the file descriptor of interest. The DP_ISPOLLED ioctl returns 1
    if the file descriptor is in the set. The events field contains the
    currently polled events. The revents field contains 0. The ioctl returns 0
    if the file descriptor is not in the set. The pollfd structure pointed by
    pfd is not modified. The ioctl returns a -1 if the call fails."
    It says that when you query for an filedescriptor which is currently being
    monitored in the set, that it would return 1, and change the events field of
    the pollfd structure to the events it's currently monitoring that fd for.
    The revents field would be set to zero.
    However the only thing which actually happens here, is that FD_ISPOLLED
    returns 1 when the fd is in the set and 0 if not. When the fd is in the
    set, when FD_ISPOLLED returns 1, the events field remains unmodified, but
    the revents field gets changed.
    A small sample code to illustrate:
    #include <stdio.h>
    #include <unistd.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <sys/devpoll.h>
    main() {
    struct pollfd a;
    int dp_fd = open("/dev/poll", O_WRONLY);
    a.fd = 0; /* stdin */
    a.events = POLLIN; /* we monitor for readability, POLLIN=1 */
    a.revents = 0;
    write(dp_fd, &a, sizeof(a));
    a.fd = 0;
    a.events = 34; /* filled in with bogus number to show malfunctioning */
    a.revents = 0;
    printf("DP_ISPOLLED returns: %d\n", ioctl(dp_fd, DP_ISPOLLED, &a));
    printf("a.fd=%d, a.events=%hd, a.revents=%hd\n", a.fd, a.events,
    a.revents);
    According to the documentation of /dev/poll and namely DP_ISPOLLED this
    program is supposed to print the following:
    DP_ISPOLLED returns: 1
    a.fd=0, a.events=1, a.revents=0
    However it prints the following:
    DP_ISPOLLED returns: 1
    a.fd=0, a.events=34, a.revents=1
    You can take any number instead of '34' and it will simply remain untouched
    after the DP_ISPOLLED ioctl-request.
    I hope it's clear now that the solaris8 and solaris9 (and probably solaris7
    with /dev/poll patch too) DP_ISPOLLED implementation is broken.
    This bug is also easily illustrated by looking at the solaris8 kernel sourcecode:
    <snippet osnet_volume/usr/src/uts/common/io/devpoll.c:dpioctl()>
    case DP_ISPOLLED:
    pollfd_t pollfd;
    polldat_t *pdp;
    if (pollfd.fd < 0) {
    mutex_exit(&pcp->pc_lock);
    break;
    pdp = pcache_lookup_fd(pcp, pollfd.fd);
    if ((pdp != NULL) && (pdp->pd_fd == pollfd.fd) &&
    (pdp->pd_fp != NULL)) {
    pollfd.revents = pdp->pd_events;
    if (copyout(&pollfd, (caddr_t)arg,
    sizeof(pollfd_t))) {
    mutex_exit(&pcp->pc_lock);
    DP_REFRELE(dpep);
    return (set_errno(EFAULT));
    *rvalp = 1;
    </snippet>
    its' clearly visible that the code writes the current monitored events to
    the revents field:
    'pollfd.revents = pdp->pd_events;'
    and that it doesnt set revents to zero.
    It's funny to see that this has been like this since Solaris8 (possibly 7). That means nobody ever used DP_ISPOLLED that way or people were simply to lazy to file a bug report.
    Another funny thing related to this. is that Hewlett-Packard did seem to know about this. Since HP-UX11i version 1.6 they also support /dev/poll. From their manual page i ll quote some sentences from their WARNING session:
    "The ioctl(DP_ISPOLLED) system call also returns its result in the revents member of the pollfd structure, in order to be compatible with the implementation of the /dev/poll driver by some other vendors."
    Hopefully this will get fixed.
    I also like to reexpress my very negative feelings towards the fact that you're not able to file bug reports when you do not have a support contract. Ridiculous.
    Thanks,
    bighawk

    Have I mentioned how much i love my playbook now Great job on os 2.0

  • [bdb bug]repeatly open and close db may cause memory leak

    my test code is very simple :
    char *filename = "xxx.db";
    char *dbname = "xxx";
    for( ; ;)
    DB *dbp;
    DB_TXN *txnp;
    db_create(&dbp,dbenvp, 0);
    dbenvp->txn_begin(dbenvp, NULL, &txnp, 0);
    ret = dbp->open(dbp, txnp, filename, dbname, DB_BTREE, DB_CREATE, 0);
    if(ret != 0)
    printf("failed to open db:%s\n",db_strerror(ret));
    return 0;
    txnp->commit(txnp, 0);
    dbp->close(dbp, DB_NOSYNC);
    I try to run my test program for a long time opening and closing db repeatly, then use the PS command and find the RSS is increasing slowly:
    ps -va
    PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
    1986 pts/0 S 0:00 466 588 4999 980 0.3 -bash
    2615 pts/0 R 0:01 588 2 5141 2500 0.9 ./test
    after a few minutes:
    ps -va
    PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
    1986 pts/0 S 0:00 473 588 4999 976 0.3 -bash
    2615 pts/0 R 30:02 689 2 156561 117892 46.2 ./test
    I had read bdb's source code before, so i tried to debug it for about a week and found something like a bug:
    If open a db with both filename and dbname, bdb will open a db handle for master db and a db handle for subdb,
    both of the two handle will get an fileid by a internal api called __dbreg_get_id, however, just the subdb's id will be
    return to bdb's log region by calling __dbreg_pop_id. It leads to a id leak if I tried to open and close the db
    repeatly, as a result, __dbreg_add_dbentry will call realloc repeatly to enlarge the dbentry area, this seens to be
    the reason for RSS increasing.
    Is it not a BUG?
    sorry for my pool english :)
    Edited by: user9222236 on 2010-2-25 下午10:38

    I have tested my program using Oracle Berkeley DB release 4.8.26 and 4.7.25 in redhat 9.0 (Kernel 2.4.20-8smp on an i686) and AIX Version 5.
    The problem is easy to be reproduced by calling the open method of db handle with both filename and dbname being specified and calling the close method.
    My program is very simple:
    #include <stdlib.h>
    #include <stdio.h>
    #include <sys/time.h>
    #include "db.h"
    int main(int argc, char * argv[])
    int ret, count;
    DB_ENV *dbenvp;
    char * filename = "test.dbf";
    char * dbname = "test";
    db_env_create(&dbenvp, 0);
    dbenvp->open(dbenvp, "/home/bdb/code/test/env",DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_INIT_MPOOL, 0);
    for(count = 0 ; count < 10000000 ; count++)
    DB *dbp;
    DB_TXN *txnp;
    db_create(&dbp,dbenvp, 0);
    dbenvp->txn_begin(dbenvp, NULL, &txnp, 0);
    ret = dbp->open(dbp, txnp, filename, dbname, DB_BTREE, DB_CREATE, 0);
    if(ret != 0)
    printf("failed to open db:%s\n",db_strerror(ret));
    return 0;
    txnp->commit(txnp, 0);
    dbp->close(dbp, DB_NOSYNC);
    dbenvp->close(dbenvp, 0);
    return 0;
    DB_CONFIG is like below:
    set_cachesize 0 20000 0
    set_flags db_auto_commit
    set_flags db_txn_nosync
    set_flags db_log_inmemory
    set_lk_detect db_lock_minlocks
    Edited by: user9222236 on 2010-2-28 下午5:42
    Edited by: user9222236 on 2010-2-28 下午5:45

  • Multiple return values (Bug-ID 4222792)

    I had exactly the same request for the same 3 reasons: strong type safety and code correctness verification at compile-time, code readability and ease of mantenance, performance.
    Here is what Sun replied to me:
    Autoboxing and varargs are provided as part of
    JSRs 14 and 201
    http://jcp.org/en/jsr/detail?id=14
    http://jcp.org/en/jsr/detail?id=201
    See also:
    http://forum.java.sun.com/forum.jsp?forum=316
    http://developer.java.sun.com/developer/earlyAccess/adding_generics/index.html
    Multiple return values is covered by Bug-ID 4222792
    Typically this is done by returning an array.
    http://developer.java.sun.com/developer/bugParade/bugs/4222792.html
    That's exactly the problem: we dynamically create instances of array objects that would better fit well within the operand stack without stressing the garbage collector with temporary Array object instances (and with their backing store: 2 separate allocations that need to be recycled when it is clearly a pollution that the operand stack would clean up more efficiently)
    If you would like to engage in a discussion with the Java Language developers, the Generics forum would be a better place:
    http://forum.java.sun.com/forum.jsp?forum=316
    I know that (my report was already refering to the JSR for language extension) Generics is not what I was refering to (even if a generic could handle multiple return values, it would still be an allocated Object
    instance to pack them, i.e. just less convenient than using a static class for type safety.
    The most common case of multiple return values involve values that have known static datatypes and that should be checked with strong typesafety.
    The simple case that involves returning two ints then will require at least two object instances and will not solve the garbage collection overhead.
    Using a array of variable objects is exactly similar, except that it requires two instances for the components and one instance for the generic array container. Using extra method parameters with Integer, Byte, ... boxing objects is more efficient, but for now the only practical solution (which causes the least pollution in the VM allocator and garbage collector) is to use a custom class to store the return values in a single instance.
    This is not natural, and needlessly complexifies many interfaces.
    So to avoid this pollution, some solutions are used such as packing two ints into a long and returning a long, depacking the long after return (not quite clean but still much faster at run-time for methods that need to be used with high frequencies within the application. In some case, the only way to cut down the overhead is to inline methods within the caller code, and this does not help code maintenance by splitting the implementation into small methods (something that C++ can do very easily, both because it supports native types parameters by reference, and because it also supports inline methods).
    Finally, suppose we don't want to use tricky code, difficult to maintain, then we'll have to use boxing Object types to allow passing arguments by reference. Shamely boxed native types cannot be allocated on the operand stack as local variables, so we need to instanciate these local variables before call, and we loose the capacity to track the cases where these local variables are not really initialized by an effective call to the method that will assign them. This does not help debugging, and is against the concept of a strongly typed language like Java should be:
    Java makes lots of efforts to track uninitialized variables, but has no way to determine if an already instanciated Object instance refered in a local variable has effectively received an effective assignment because only the instanciation is kept. A typical code will then need to be written like this:
    Integer a = null;
    Integer b = null;
    if (some condition) {
    //call.method(a, b, 0, 1, "dummy input arg");
    // the method is supposed to have assigned a value to a and b,
    // but can't if a and b have not been instanciated, so we perform:
    call.method(a = new Integer(), b = new Integer(), 0, 1, "dummy input
    arg");
    // we must suppose that the method has modified (not initialized!)
    the value
    // of a and b instances.
    now.use(a.value(), b.value())
    // are we sure here that a and b have received a value????
    // the code may be detected at run-time (a null exception)
    // or completely undetected (the method() above was called but it
    // forgot to assign a value to its referenced objects a and b, in which
    // case we are calling in fact: now.use(0, 0); with the default values
    // or a and b, assigned when they were instanciated)
    Very tricky... Hard to debug. It would be much simpler if we just used:
    int a;
    int b;
    if (some condition) {
    (a, b) = call.method(0, 1, "dummy input arg");
    now.use(a, b);
    The compiler would immediately detect the case where a and b are in fact not always initialized (possible use bere initialization), and the first invoked call.method() would not have to check if its arguments are not null, it would not compile if it forgets to return two values in some code path...
    There's no need to provide extra boxing objects in the source as well as at run-time, and there's no stress added to the VM allocator or garbage collector simply because return values are only allocated on the perand stack by the caller, directly instanciated within the callee which MUST (checked at compile-time) create such instances by using the return statement to instanciate them, and the caller now just needs to use directly the variables which were referenced before call (here a and b). Clean and mean. And it allows strong typechecking as well (so this is a real help for programmers.
    Note that the signature of the method() above is:
    class call {
    (int, int) method(int, int, String) { ... }
    id est:
    class "call", member name "method", member type "(IILjava.lang.string;)II"
    This last signature means that the method can only be called by returning the value into a pair of variables of type int, or using the return value as a pair of actual arguments for another method call such as:
    call.method(call.method("dummy input arg"), "other dummy input arg")
    This is strongly typed and convenient to write and debug and very efficient at run-time...

    Can anyone give me some real-world examples where
    multiple return values aren't better captured in a
    class that logically groups those values? I can of
    course give hundreds of examples for why it's better
    to capture method arguments as multiple values instead
    of as one "logical object", but whenever I've hankered
    for multiple return values, I end up rethinking my
    strategy and rewriting my code to be better Object
    Oriented.I'd personally say you're usually right. There's almost always a O-O way of avoiding the situation.
    Sometimes though, you really do just want to return "two ints" from a function. There's no logical object you can think of to put them in. So you end up polluting the namespace:
    public class MyUsefulClass {
    public TwoInts calculateSomething(int a, int b, int c) {
    public static class TwoInts {
        //now, do I use two public int fields here, making it
        //in essence a struct?
       //or do I make my two ints private & final, which
       //requires a constructor & two getters?
      //and while I'm at it, is it worth implementing
      //equals(), how about hashCode()? clone()?
      //readResolve() ?
    }The answer to most of the questions for something as simple as "TwoInts" is usually "no: its not worth implementing those methods", but I still have to think about them.
    More to the point, the TwoInts class looks so ugly polluting the top level namespace like that, MyUsefulClass.TwoInts is public, that I don't think I've ever actually created that class. I always find some way to avoid it, even if the workaround is just as ugly.
    For myself, I'd like to see some simple pass-by-value "Tuple" type. My fear is it'd be abused as a way for lazy programmers to avoid creating objects when they should have a logical type for readability & maintainability.
    Anyone who has maintained code where someone has passed in all their arguments as (mutable!) Maps, Collections and/or Arrays and "returned" values by mutating those structures knows what a nightmare it can be. Which I suppose is an argument that cuts both ways: on the one hand you can say: "why add Tuples which would be another easy thing to abuse", on the other: "why not add Tuples, given Arrays and the Collections framework already allow bad programmers to produce unmainable mush. One more feature isn't going to make a difference either way".
    Ho hum.

  • Extensions like Ghostery, WOT or AdBlock stop working after two or three times. Restarting the webpage in a new tab the extensions will work again for several times and then stop again. Has anybody an explanation or a workaround for this bug in Safari 5?

    Extensions like Ghostery, WOT or AdBlock stop working after two or three times. Restarting the webpage in a new tab the extensions will work again for several times and then stop again. Has anybody an explanation or a workaround for this bug in Safari 5?

    Remove the extensions, redownload Safari, reload the extensions.
    http://www.apple.com/safari/download/
    And if you really want a better experience, use Firefox, tons more choices and possibilities there.
    Firefox's "NoScript" will block the Trojan going around on websites. Best web security you can get.
    https://addons.mozilla.org/en-US/firefox/addon/noscript/
    Ghostery, Ad Block Plus and thousands of add-ons more have originated on Firefox.

  • Bug? My events on the iPad iCal app aren't shown in the year view if they are more than two years in the future.

    My events on the iPad iCal app aren't shown in the year view if they are more than two years in the future even though I can see them on the month, week and day view. Any suggestions on how to fix it? I've tried it all. I called the apple support and they checked on their iPads. They all did the same and they couldn't help me. They suggested trying this way. I'd like to be able to plan a few years ahead and the year view would make thing so easy!
    Is this a bug?

    Go to the Home screen and double click the Home button. That will reveal the row of recently used apps at the bottom of the screen. Tap and hold on the app in question until it wiggles and displays a minus sign. Tap the minus sign to actually quit the app. Then tap anywhere on the screen above that bottom row to return the screen to normal. Then restart the app and see if it works normally.
    Then reboot your iPad. Press and hold the Home and Sleep buttons simultaneously ignoring the red slider until the Apple logo appears. Let go of the buttons and let the iPad restart. See if that fixes your problem.

  • HT4528 My IPhone Bugged out/It is currently in the reset mode. I need to exchange all of my contacts from my Yahoo acct. to my new IPHONE. Can you please help me?

    Hello ,
    I purchased my IPHONE about 2 months ago. I am visiting family in DE & this tuesday it starting to go off & on by itself. Then the icons looked like they were floating . Then I could not call or text . The SIRI device would not work. Then it would shut down then the apple icon would reappear. I took it to a verizon dealer in Rehoboth DE & they said it BUGGED OUT/It is in a RESTORE MODE. It will not turn on. We could not transfer anny of my pics or contacts. I never even had a chance to back up the memory on ITUNES.
    The tech @ Verizon said to contact APPLE to trouble shoot and try and transfer the contacts from my yahoo acct.
    Can you please help?
    Gina

    set up your yahoo account in mail, contacts, calendars as an Exchange Account and you should be able to get your contacts from Yahoo from there.

  • ICal bug!

    Didn't know where to post it so I decided to post it here. Not a major bug, but a bug nevertheless. Maybe someone here wants to check it out on their iCal so I get a sense if it is touching just me or anyone else.
    Follow all steps:
    - open iCal in weekly view.
    - click on a day differen than "today".
    - click on "today" on the upper left side (where "today" is written ).
    - click on the red dot to "close the app" without really closing it.
    - reopen iCal by clicking on the icon.
    Now you should have the today button greyed out, no matter which day you choose. The only way to have it back is to close and reopen iCal.
    No data loss, nothing... Just a little bug I found in iCal.
    I run Mac OSX 10.5.4 on a MacBook Pro 17" no plugins, nothing installed. Software is in italian.
    Anyway: others get the same result? (just checked it again to be really sure it is indeed not working, and it's not..)

    Has a real solution to this bug been found yet? It has been on going for me and has become annoying. The only way to get the "today" button and the search feature to work, is to quit iCal and start it again.
    Very annoying.

  • Okay, the iTunes 8.2 bug that I had on my iPod Touch is back with my iPhone

    I have new iPhone 3GS that I picked up this morning at 7 am. I love it, but the iTunes 8.2 bug that is being thoroughly discussed in the iPod Touch forum is back and affecting my iPhone 3GS. I did read one random post that a Apple Tech Support person said to unplug the internet (disconnect your internet) before plugging it in. I don't know why, but it worked and makes me wonder if this will also work for iPod Touch users. Weird, but it is definitely a nice work around for now!

    I got it again. I plug in the iPhone into my computer and it is telling that it thinks it is a camera because it is trying to launch Canon CameraWindow, MS scanner, Picasa3, etc. Then iTunes says, "An iPhone has been detected, but it could not be identified properly. Please, disconnect and reconnect the iPhone, then try again." Yes, I tried again, and completely uninstalled iTunes and all things Apple to only re-install it. I am at my whits end again!

Maybe you are looking for