Storm and spring framework integration

Source: Internet
Author: User

Storm and spring framework integration problems during storm and spring integration, we thought we could succeed at once, with a lot of hope, but a java was reported during the runtime. io. notSerializableException. This exception requires the injection-dependent jar package to implement the serialization interface, but those jar packages are developed by others. You cannot change the source code one by one before using them in the project. Someone has encountered a similar problem on the Internet. The specific reason is that they do not have a deep understanding of storm's spout and bolt lifecycles. Generally, the spout/bolt lifecycle is as follows: 1. after submitting a topology (on the machine where nimbus is located), create a spout/bolt instance (called component in storm) and serialize it. 2. send the serialized component to the machine where all tasks are located. deserializing component.4. before starting a task, execute the component initialization method (bolt is prepare and spout is open ). therefore, the component initialization operation should be performed in the prepare/open method, rather than during component instantiation. according to this statement, the structure problem disappears. But then there is a new problem: Caused by: org. xml. sax. SAXParseException: Content is not allowed in prolog. this exception was found after searching on the internet due *. xml file encoding. The reason is that the BOM header is added to the file encoding when editing from other projects or editing tools. Therefore, you can use notePad ++ to open the xml file and choose to remove the BOM header information, save it again. When running again, everything is OK.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.