8 Replies Latest reply on Feb 8, 2013 6:18 AM by u005078

    How to track bundles

    u005078 Level 1

      I have compiled some source and created a bundle. The bundle looks almost the same as the original one. From my point of view it's almost all the same, I even checked the CRC-checksums of the classes to make sure it's ll the same.. The new bundle doesn't contain the maven parameters in the META-INF directory. Unfortunately, my bundle doesn't work. It can be started successfully and it becomes active, but I only get a empty page instead the expected one. The log-files are empty and from the "Recent Rerquests" I don't see any error either.

      Are the maven parameters (pom.xml and pom.properies) missed. I can't think so; Felix doesn't require this

        • 1. Re: How to track bundles
          orotas Level 4

          When you say you get an empty page what does that refer too? Does your bundle contain a servlet that outputs a page? If so how did you bind the servlet to the path? Did you use SCR annotations? If not how did you generate your SCR files in your bundle?

          • 2. Re: How to track bundles
            Jörg Hoh Adobe Employee

            It sounds like your bundle has services/components and these are not started successfully. In any case you should have indication about the status in the log. Also check the "services" and "components" tabs in the Felix Console for your services/components.



            • 3. Re: How to track bundles
              u005078 Level 1

              You are right - a JSP calls a servlet which outputs a page. Yes it uses Felix scr annotations. And to reply to Jörgs suggestion - the servlet was started successfully - I checked the status via the component-tab.

              The compiled classes had all the same CRC-checksum in the jar-file, so they are identical to the classes in the original bundle.


              My intention was to modify this servlet to get familiar to the process of deploying bundles and servlet. Until now I didn't find any documents describing the logic of creating and using servlets. There are samples in the "Developing with Eckipse/CRXDE//CRXDE Lite" pages but they don't tell much about the nature servlets in the CQ5 environment. In the Felix annotation description I found, that the annotation @Component is required to establish a component. Do the expressions "servlet" and "component" describe the same thing?


              So lacking of basic documents I tried learning by doing. And having the same classes in the bundles ( due to the checksums ) should guarantee me, that the behaviour should be the same. The first question now is, where is the difference - how can I debug this.


              • 4. Re: How to track bundles
                Jörg Hoh Adobe Employee



                No, servlets and component do not describe the same thing. Component is a term introduced by OSGI, as well as "Service". Please have a look at the OSGI specification (R4 enterprise speciification, version 4.2; you can download them from http://www.osgi.org/Release4/Download). The annotation "@Component" and "@Service" as well as some others are part of Apache Felix and you can find their documentationin http://felix.apache.org/documentation/subprojects/apache-felix-maven-scr-plugin/scr-annota tions.html. You need the Apache-Maven-SCR plugin to make them work.


                But be aware: CRXDE Lite does not support the Annotations, but only the javadoc tag-style (http://felix.apache.org/documentation/subprojects/apache-felix-maven-scr-plugin/scr-javado c-tags.html).



                • 5. Re: How to track bundles
                  u005078 Level 1

                  Thank you, I had feared this. So I have to distinct Components intrroduced by OSGi and Components introduced by CQ5. And I have to distinct Component and Service. I miss the term servlet; is it this what you call here "service". But I will probably see.

                  Thank you very much for the OSGi-Link. Right now I'm reading the "OSGi in Practice" from Neil Bartlett but I appreciate  having a formal specification; this is what I really miss with CQ5 and Sling.

                  But I still have the problem of the not working servlet. I will do more tests and post the results tomorrow.


                  • 6. Re: How to track bundles
                    Jörg Hoh Adobe Employee

                    Hi Ulrich,


                    the term "servlet" has not changed from the standard J2E world. Sling uses the very same interfaces.

                    I would recommend you to attend a developer training, where all these terms get introduced (and of course much more).


                    And if you are looking for a formal specification: What are you looking for? An API documentation? Books?



                    • 7. Re: How to track bundles
                      Davide G Adobe Employee

                      Hi Ulrich,


                      the following links contain examples of sling servlets. In the examples the doclet annotations has been used that is deprecated but it should be easy to translate into proper annotations





                      At the end of each post there are references links for deepen the understanding.




                      • 8. Re: How to track bundles
                        u005078 Level 1

                        I'm in transition. I used to be a mainframe (z/OS) systems programmer for many years, with a very well structured documentation.  Now, I'm changigng my professional subject.  I've got experience with Java batch-programming and some experience with EJB, JSP and Servlets. But hat no experiences with CMS, OSGI, Maven and Sling. And I find it hard to create me an education schedule to become familiar to CQ5. I will for sure visit a develpment training but right now I don't think I don't have the prerequisites to gain much from such a session. And I don't trust in the completeness of the list of prerequisites displayed at the advertisements for these trainings. After weeks of reading, testing and discussing I'm convinced that, to start developing with CQ5, you need a good knowledge of OSGi and Maven and of course Sling.It was even hard work to get to this opinion.

                        And the documentation, as supplied by Adobe isn't prepared  to really educate people. The documents are only loosely coupled to help people, who know their subject, to solve specific problems. It's more like picking of problems than a systematic curriculum. For any subject mentioned in any document, I have to follow lots of links (thats not really bad) or to find me more information be a searching machine because there was no link in the document (thats really bad and wastes a lot of time).


                        Yes an API wouldn't be bad. And I would love to have a book.I was glad when I found Neil Bartletts "OSGi in Pratice", it is really a valuable document for beginners.


                        I appreciate your help and admire your knowledge and that of several other participants of this forum. But I wonder how you gained your knowledge and what kind of reference you use.