felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Göktürk Gezer <gokturk.ge...@gmail.com>
Subject Re: Instantiating Manipulated Class without IPojo
Date Wed, 19 Oct 2011 09:03:02 GMT
On Wed, Oct 19, 2011 at 11:02 AM, Karl Pauls <karlpauls@gmail.com> wrote:

> Can you show your maven pom maybe?
>
> regards,
>
> Karl
>
> This pom belongs to project which exposes some of its classes using
@Component@Provides
..................................
......................................
    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.apache.felix.ipojo.annotations</artifactId>
      <version>1.8.0</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <configuration />
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>antlr-maven-plugin</artifactId>
        <configuration>
          <grammars>*.g</grammars>
        </configuration>
        <executions>
           <execution>
              <goals>
                 <goal>generate</goal>
              </goals>
           </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**/Abstract*</exclude>
            <exclude>**/*RegressionTest*</exclude>
          </excludes>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestFile>META-INF/MANIFEST.MF</manifestFile>
            <addMavenDescriptor>false</addMavenDescriptor>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <inherited>true</inherited>
        <extensions>true</extensions>
        <configuration>
          <manifestLocation>META-INF</manifestLocation>
          <instructions>

<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
            <Export-Package>
                {local-packages};version=${project.version};-noimport:=true
            </Export-Package>
          </instructions>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-ipojo-plugin</artifactId>
        <version>1.8.0</version>
        <executions>
          <execution>
            <goals>
              <goal>ipojo-bundle</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>

And that one belongs to a one that tries to instantiate normally

..........................
.........................................

    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.apache.felix.ipojo</artifactId>
      <version>1.8.0</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-tests</id>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <inherited>true</inherited>
        <extensions>true</extensions>
        <configuration>
          <instructions>

<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
            <Export-Package>
                {local-packages};version=${project.version};-noimport:=true,

org.apache.directory.server.core.partition.impl.avl;version="${project.version}";-noimport:=true,

org.apache.directory.server.core.partition.impl.btree;version="${project.version}";-noimport:=true,

org.apache.directory.server.log.impl.avl;version="${project.version}";-noimport:=true,

org.apache.directory.server.xdbm.impl.avl;version="${project.version}";-noimport:=true,

org.apache.directory.server.xdbm.search.impl;version="${project.version}";-noimport:=true
            </Export-Package>
          </instructions>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-ipojo-plugin</artifactId>
        <version>1.8.0</version>
        <executions>
          <execution>
            <goals>
              <goal>ipojo-bundle</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

to give some example, We have LdapComparator<?> base type

@Component
@Provides
BinaryComparator extends LdapComparator<String>

In class that's under second pom,
we have something like

LdapComparator<?> comparator = new BinaryComparator( "1.0.4.3" ); //This is
where the error is given.

That BinaryComparator's _ctor(String) is calling base constructor and that
chain goes all the way to top base class without calling parameterless
constructor at any level.


Regards,
Gokturk

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message