7 Replies Latest reply on Mar 18, 2011 7:13 AM by valdar

    Missing Constraint: Import-Package: javax.persistence; version="3.0.0"

    larasith

      I don't know what bundled i need to finx this error:

       

      Error executing command: The bundle "persistence-service_0.0.1.SNAPSHOT " could not be resolved. Reason: Missing Constraint: Import-Package: javax.persistence; version="3.0.0"

        • 1. Re: Missing Constraint: Import-Package: javax.persistence; version="3.0.0"
          njiang

          Hi

           

          Which version of Fuse ESB are you using?

          Can you provide more information about your test case?

           

          Willem

          • 2. Re: Missing Constraint: Import-Package: javax.persistence; version="3.0.0"
            gertv

            L.S.,

             

            I don't think there's a bundle to provide javax.persistence version 3.0.0 -- afaik, the latest version of JPA is 2.0.  You probably need to configure the Felix maven-bundle-plugin to generate the right version.

             

            Regards,

             

            Gert

            • 3. Re: Missing Constraint: Import-Package: javax.persistence; version="3.0.0"
              larasith

              My FUSE version is 4.3.1, but i get this error since FUSE 4.2.0

              • 4. Re: Missing Constraint: Import-Package: javax.persistence; version="3.0.0"
                valdar

                Same version of fuse esb (4.3.1) adn same problem here...

                • 5. Re: Missing Constraint: Import-Package: javax.persistence; version="3.0.0"
                  dlo1957

                  Just a note on this. I am using version 4.3.0-fuse-03-00.

                   

                  After I:

                   

                  features:install jpa-hibernate

                   

                  After I restart ServiceMix, I get this error on the console:

                   

                  Could not find matching export for Import-Package: javax.persistence; version="3.0.0"

                  Could not find matching export for Import-Package: javax.persistence.spi; version="3.0.0"

                  • 6. Re: Missing Constraint: Import-Package: javax.persistence; version="3.0.0"
                    valdar

                    For a strange reason maven bundle plug-in doesn't recognize the correct version of java; you have to specify it manually in the POM file:

                     

                    <plugin>
                         <groupId>org.apache.felix</groupId>
                         <artifactId>maven-bundle-plugin</artifactId>
                         <extensions>true</extensions>
                         <configuration>
                              <instructions>
                                   <Bundle-SymbolicName>
                                               ${pom.artifactId}
                                            </Bundle-SymbolicName>
                                   <Private-Package>
                                        _your_private_package_
                                   </Private-Package>
                                   <Import-Package>
                                        *,
                                        org.hibernate.ejb,
                                                    org.hibernate.proxy,
                                                    org.hibernate.hql.ast,
                                        org.hsqldb,
                                                    org.hsqldb.util,
                                                    org.hsqldb.jdbc,
                                                   javax.persistence;version=1.1.1
                                   </Import-Package>
                              </instructions>
                         </configuration>
                    </plugin>
                    

                     

                    The 1.1.1 is the correct version for fuse esb 4.3.1, for 4.3.0 you have to modify it accordingly (maybe 1.2.0 or 1.0.2.GA ?)

                     

                    Best regards,

                    Andrea.

                    • 7. Re: Missing Constraint: Import-Package: javax.persistence; version="3.0.0"
                      ffang

                      Hi,

                       

                      This is caused by somehow your customer bundle import wrong version of javax.persistence package, you need specify the correct version for your customer bundle in maven-bundle-plugin to fix it.

                       

                      Freeman