Thanks! That reduced it to one stupefying problem. Can you advise?

[ERROR] Error building bundle soakit:soakit.jdom:bundle:1.0-SNAPSHOT : Unresolved references to [.] by class(es) on the Bundle-Classpath[Jar:dot]: [JDOMAbout$Info.class, JDOMAbout.class, JDOMAbout$Author.class]
[ERROR] Error(s) found in bundle configuration

Here's the changed POM:

<project xmlns="http://maven.apache.org/POM/4.0.0";
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";>

    <modelVersion>4.0.0</modelVersion>

    <groupId>soakit</groupId>
    <artifactId>soakit.jdom</artifactId>
    <version>1.0-SNAPSHOT</version>

    <name>soakit.jdom</name>
    <description>org.jdom and commons.collections</description>
    <packaging>bundle</packaging>

    <parent>
        <groupId>soakit</groupId>
        <artifactId>soakit</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>

    <dependencies>
                        <dependency>
                                <!--
                          <groupId>org.jdom</groupId>
                          <artifactId>jdom</artifactId>
                        <version>1.1</version>
                                -->
                                <groupId>org.jdom</groupId>
                                
<artifactId>com.springsource.org.jdom</artifactId>
                                <version>1.0.0</version>
                        </dependency>
                        <dependency>
                                 <groupId>commons-collections</groupId>
                                 <artifactId>commons-collections</artifactId>
                                 <version>3.1</version>
                        </dependency>
                        <!--
                        <dependency>
                                        <groupId>com.sun.xml.bind</groupId>
                                        <artifactId>jaxb-xjc</artifactId>
                                        <version>2.1.6</version>
                        </dependency>
                        <dependency>
                                <groupId>com.oracle.xml</groupId>
                                
<artifactId>com.springsource.oracle.xml</artifactId>
                                <version>10.2.0.2</version>
                        </dependency>
                        <dependency>
                                <groupId>javax.sql</groupId>
                                <artifactId>jdbc-stdext</artifactId>
                                <version>2.0</version>
                        </dependency>
                        <dependency>
                                <groupId>javax.security</groupId>
                                <artifactId>jaas</artifactId>
                                <version>1.0.01</version>
                        </dependency>
                        <dependency>
                                <groupId>javax.security</groupId>
                                <artifactId>jacc</artifactId>
                                <version>1.0</version>
                        </dependency>
                        <dependency>
                                <groupId>javax.activation</groupId>
                                <artifactId>activation</artifactId>
                                <version>1.1</version>
                        </dependency>
                        -->
                        <!--
                        <dependency>
                                <groupId>javax.xml.parsers</groupId>
                                <artifactId>jaxp-api</artifactId>
                                <version>1.4</version>
                        </dependency>
                        <dependency>
                                <groupId>xerces</groupId>
                                <artifactId>xercesImpl</artifactId>
                                <version>2.4.0</version>
                        </dependency>
                        <dependency>
        <groupId>xerces</groupId>
        <artifactId>xercesImpl</artifactId>
        <version>2.8.1</version>
      </dependency>
                        <dependency>
                                <groupId>org.w3c</groupId>
                                <artifactId>dom</artifactId>
                                <version>2.3.0-jaxb-1.0.6</version>
                        </dependency>
                        -->
<!--
javax.security.auth.x500
oracle.xml.parser
oracle.xml.parser.v2
org.apache.env
org.apache.xml.resolver
org.apache.xml.resolver.readers
sun.io
-->
    </dependencies>

    <build>
        <plugins>
                                                <plugin>
                                                        
<artifactId>maven-compiler-plugin</artifactId>
                                                        <configuration>
                                                                
<source>1.5</source>
                                                                
<target>1.5</target>
                                                        </configuration>
                                                </plugin>
                                                <plugin>
                                                        
<groupId>org.apache.felix</groupId>
                                                        
<artifactId>maven-scr-plugin</artifactId>
                                                </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                                                                
<version>1.4.3</version>
                <extensions>true</extensions>
                <configuration>
                                                                                
<manifestLocation>META-INF</manifestLocation>
                    <instructions>
                        <Bundle-Version>${pom.version}</Bundle-Version>
                        <Bundle-Name>${pom.artifactId}</Bundle-Name>
                        <Bundle-Vendor>Gestalt</Bundle-Vendor>

<Bundle-Description>${pom.description}</Bundle-Description>

<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
                                                                                            
    <Embed-Transitive>true</Embed-Transitive>
<Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
                                                                                            
    <Embed-Directory>target/dependency</Embed-Directory>
<Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
                                                                                   
             <!--
                                                                                      
          <Bundle-ClassPath>
                                                                                
                        lib/jaxen-core.jar,
                                                                                
                        lib/jaxen-jdom.jar,
                                                                                
                        lib/saxpath.jar,
                                                                                
                        lib/xalan.jar,
                                                                                
                        lib/xerces.jar,
                                                                                
                        lib/xml-apis.jar,
                                                                                
                        lib/activation.jar,
                                                                                
                        lib/jndi.jar,
                                                                                      
          </Bundle-ClassPath>
                                                                                      
          <Include-Resource>
                                                                                
                        lib=lib
                                                                                      
          </Include-Resource>
                                                                                   
             -->
                                                                                      
          <Import-Bundle>
                                                                                          
              com.springsource.org.jdom;version="[1.0.0,1.0.0]"
                                                                                      
          </Import-Bundle>
                        <Export-Package>
                                                                                          
              org.apache.commons.collections.*;version="3.1",
                                                                                
                        org.jdom.*,
                        </Export-Package>
                        <Import-Package>
                          *;resolution:=optional
                        </Import-Package>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>



David Bosschaert wrote:
Hi Brad,

Have a look at the SpringSource bundle repository. They have a JDom
jar that is wrapped as a bundle.
See http://www.springsource.com/repository/app/search?query=jdom

Cheers,

David

2008/10/21 Brad Cox <[EMAIL PROTECTED]>:
Surely such a simple problem can't be so difficult. Can someone help?

I need to use org.jdom in an OSGI application. But it is not (to my
knowledge) available as a bundle, just a jar. So I've been trying to wrap
the jar as a bundle; soakit.jdom.

The problem then is getting dependent jars into that bundle. All
permutations I've tried all wind up in errors like this one. Adding the
unresolved ones (oracle, javax, jaxen, etc) to the lib just makes the
problem worse; the unresolved references list just grows and grows.

I'm using Java 1.5 on MacOSX.

[ERROR] Error building bundle soakit:soakit.core:bundle:1.0-SNAPSHOT :
Unresolved references to [javax.security.auth.x500, javax.xml.parsers,
javax.xml.transform, javax.xml.transform.sax, javax.xml.transform.stream,
oracle.xml.parser, oracle.xml.parser.v2, org.apache.xerces.dom,
org.apache.xerces.parsers, org.jaxen, org.jaxen.jdom, org.w3c.dom,
org.xml.sax, org.xml.sax.ext, org.xml.sax.helpers] by class(es) on the
Bundle-Classpath[Jar:dot]: [org/jdom/adapters/XML4JDOMAdapter.class,
org/jdom/adapters/XercesDOMAdapter.class,
org/jdom/transform/JDOMResult.class, org/jdom/xpath/JaxenXPath.class,
org/jdom/input/BuilderErrorHandler.class,
org/jdom/transform/JDOMResult$FragmentHandler.class,
org/jdom/adapters/CrimsonDOMAdapter.class, org/jdom/input/DOMBuilder.class,
org/jdom/JDOMException.class, org/jdom/input/JAXPParserFactory.class,
org/eclipse/osgi/internal/signedcontent/PKCS7Processor.class,
org/jdom/adapters/DOMAdapter.class,
org/jdom/adapters/OracleV1DOMAdapter.class,
org/eclipse/core/runtime/internal/adaptor/PluginParser.class,
org/jdom/output/JDOMLocator.class,
org/jdom/transform/JDOMSource$DocumentReader.class,
org/jdom/xpath/JaxenXPath$NSContext.class,
org/jdom/transform/JDOMSource$JDOMInputSource.class,
org/jdom/transform/XSLTransformer.class,
org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook.class,
org/jdom/adapters/JAXPDOMAdapter.class,
org/jdom/input/JDOMParseException.class, org/jdom/output/SAXOutputter.class,
org/jdom/output/DOMOutputter.class,
org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook$DomParsingService.class,
org/jdom/transform/JDOMResult$DocumentBuilder.class,
org/jdom/input/SAXBuilder.class, org/jdom/input/SAXHandler.class,
org/jdom/adapters/AbstractDOMAdapter.class,
org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook$SaxParsingService.class,
org/eclipse/osgi/internal/signedcontent/DNChainMatching.class,
org/jdom/adapters/OracleV2DOMAdapter.class,
org/jdom/transform/JDOMSource.class]

Here's the pom. The commented sections show various permutations I've tried.

<project xmlns="http://maven.apache.org/POM/4.0.0";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";>

   <modelVersion>4.0.0</modelVersion>

   <groupId>soakit</groupId>
   <artifactId>soakit.jdom</artifactId>
   <version>1.0-SNAPSHOT</version>

   <name>soakit.jdom</name>
   <description>org.jdom and commons.collections</description>
   <packaging>bundle</packaging>

   <parent>
       <groupId>soakit</groupId>
       <artifactId>soakit</artifactId>
       <version>1.0-SNAPSHOT</version>
   </parent>

   <dependencies>
                       <dependency>
                         <groupId>org.jdom</groupId>
                         <artifactId>jdom</artifactId>
                       <version>1.1</version>
                       </dependency>
                       <dependency>
                                <groupId>commons-collections</groupId>
                                <artifactId>commons-collections</artifactId>
                                <version>3.1</version>
                       </dependency>
                       <!--
                       <dependency>
                                       <groupId>com.sun.xml.bind</groupId>
                                       <artifactId>jaxb-xjc</artifactId>
                                       <version>2.1.6</version>
                       </dependency>
                       <dependency>
                               <groupId>com.oracle.xml</groupId>

 <artifactId>com.springsource.oracle.xml</artifactId>
                               <version>10.2.0.2</version>
                       </dependency>
                       <dependency>
                               <groupId>javax.sql</groupId>
                               <artifactId>jdbc-stdext</artifactId>
                               <version>2.0</version>
                       </dependency>
                       <dependency>
                               <groupId>javax.security</groupId>
                               <artifactId>jaas</artifactId>
                               <version>1.0.01</version>
                       </dependency>
                       <dependency>
                               <groupId>javax.security</groupId>
                               <artifactId>jacc</artifactId>
                               <version>1.0</version>
                       </dependency>
                       <dependency>
                               <groupId>javax.activation</groupId>
                               <artifactId>activation</artifactId>
                               <version>1.1</version>
                       </dependency>
                       -->
                       <!--
                       <dependency>
                               <groupId>javax.xml.parsers</groupId>
                               <artifactId>jaxp-api</artifactId>
                               <version>1.4</version>
                       </dependency>
                       <dependency>
                               <groupId>xerces</groupId>
                               <artifactId>xercesImpl</artifactId>
                               <version>2.4.0</version>
                       </dependency>
                       <dependency>
       <groupId>xerces</groupId>
       <artifactId>xercesImpl</artifactId>
       <version>2.8.1</version>
     </dependency>
                       <dependency>
                               <groupId>org.w3c</groupId>
                               <artifactId>dom</artifactId>
                               <version>2.3.0-jaxb-1.0.6</version>
                       </dependency>
                       -->
<!--
javax.security.auth.x500
oracle.xml.parser
oracle.xml.parser.v2
org.apache.env
org.apache.xml.resolver
org.apache.xml.resolver.readers
sun.io
-->
   </dependencies>

   <build>
       <plugins>
                                               <plugin>

 <artifactId>maven-compiler-plugin</artifactId>
                                                       <configuration>

 <source>1.5</source>

 <target>1.5</target>
                                                       </configuration>
                                               </plugin>
                                               <plugin>

 <groupId>org.apache.felix</groupId>

 <artifactId>maven-scr-plugin</artifactId>
                                               </plugin>
           <plugin>
               <groupId>org.apache.felix</groupId>
               <artifactId>maven-bundle-plugin</artifactId>

 <version>1.4.3</version>
               <extensions>true</extensions>
               <configuration>

   <manifestLocation>META-INF</manifestLocation>
                   <instructions>
                       <Bundle-Version>${pom.version}</Bundle-Version>
                       <Bundle-Name>${pom.artifactId}</Bundle-Name>
                       <Bundle-Vendor>Gestalt</Bundle-Vendor>

<Bundle-Description>${pom.description}</Bundle-Description>

<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>

                   <Embed-Transitive>true</Embed-Transitive>


<Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>

                   <Embed-Directory>target/dependency</Embed-Directory>


<Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>

                   <Bundle-ClassPath>

                           lib/jaxen-core.jar,

                           lib/jaxen-jdom.jar,

                           lib/saxpath.jar,

                           lib/xalan.jar,

                           lib/xerces.jar,

                           lib/xml-apis.jar,

                           lib/activation.jar,

                           lib/jndi.jar,

                   </Bundle-ClassPath>

                   <Include-Resource>

                           lib=lib

                   </Include-Resource>
                       <Export-Package>

                           org.apache.commons.collections.*;version="3.1",

                           org.jdom.*,
                       </Export-Package>
                       <Import-Package>
                         *;resolution:=optional
                       </Import-Package>
                   </instructions>
               </configuration>
           </plugin>
       </plugins>
   </build>
</project>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to