Announcement Announcement Module
Collapse

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
"cannot find symbol" Error on maven compile Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • "cannot find symbol" Error on maven compile

    I wrote a classe that consumes a service from other bundle. Só the package of this service is not on the classpath. When I run "mvn package" fails the compiling.

    public class IntermediarioImpl implements Intermediario {

    >> private org.sim.exemplo.springdm.Ola servico; <<

    public IntermediarioImpl() {
    super();
    System.out.println(this.fazerAlgo());
    }

    @Override
    public String fazerAlgo() {
    return servico.fazerAlgo();
    }

    public Ola getServico() {
    return servico;
    }

    public void setServico(Ola servico) {
    this.servico = servico;
    }

    }

    bundle-context.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean id="intermediarioBean" class="org.sim.exemplo.springdm.plugin.internal.In termediarioImpl">
    <property name="servico" ref="servicoOSGi" />
    </bean>

    </beans>

    bundle-context-osgi.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...ring-beans.xsd
    http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">

    <osgi:reference id="servicoOSGi" interface="org.sim.exemplo.springdm.Ola" />

    </beans>

    pom.xml:
    <build>
    <resources>
    <!-- standard Maven folder -->
    <resource>
    <directory>src/main/resources</directory>
    </resource>
    <!-- plus root folder -->
    <resource>
    <directory>.</directory>
    <includes>
    <include>plugin.xml</include>
    <include>META-INF/*</include>
    </includes>
    </resource>
    </resources>

    <plugins>
    <plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <version>${felix.bundle.plugin.version}</version>
    <extensions>true</extensions>
    </plugin>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.1</version>
    <configuration>
    <source>1.5</source>
    <target>1.5</target>
    </configuration>
    </plugin>
    </plugins>
    </build>


    Error description:

    [INFO] -------------------------------------------------------------
    [ERROR] COMPILATION ERROR :
    [INFO] -------------------------------------------------------------
    [ERROR] /home/cayo/workspace/springdm-interative-exemplo/src/main/java/org/sim/exemplo/springdm/plugin/internal/IntermediarioImpl.java:[7,33] cannot find symbol
    symbol : class Ola
    location: package org.sim.exemplo.springdm
Working...
X