You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by helio <he...@buscape-inc.com> on 2007/11/23 14:59:33 UTC
cannot find symbol
Hi,
I've encountered a strange error executing "mvn compile", as follows:
[DEBUG]
/home/helio/buscape/projetos/tsunami/eclipse-desenv/SOA-Ofertas-modulos/src/main/java
[INFO] Compiling 17 source files to
/home/helio/buscape/projetos/tsunami/eclipse-desenv/SOA-Ofertas-modulos/target/classes
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Compilation failure
/home/helio/buscape/projetos/tsunami/eclipse-desenv/SOA-Ofertas-modulos/src/main/java/com/buscape/oferta/lookup/OfferLookupManager.java:[126,39]
cannot find symbol
symbol : method
binarySearch(java.util.List<byte[]>,byte[],java.util.Comparator<byte[]>)
location: class java.util.Collections
as you see, it can not find the method "binarySearch" of the class
"java.util.Collections". That method does exist and the call is correct
-- I've tried to create another project using the same method
"binarySearch" and the new application works fine. But I can not
understand why this error has happened. If I try to remove the class
"OfferLookupManager", the project can be compiled by maven.
I'm using the maven 2.0.7 and Java 1.5.0_09. Could anybody help me,
please? Follows the pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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>buscape.offer</groupId>
<artifactId>buscape-soaofertas-modulos</artifactId>
<name>buscape-soaofertas-modulos</name>
<version>1.0.1</version>
<packaging>jar</packaging>
<description>
Este projeto inclui os modulos que fazem parte do SOA-Ofertas:
Acumulador, Lookup e Persistencia.
</description>
<url>http://www.buscape.com.br</url>
<scm>
<connection>
scm:svn:http://192.168.0.112/svn/operacoes/ofertas_modulos
</connection>
<developerConnection>
scm:svn:https://192.168.0.112/svn/operacoes/ofertas_modulos/trunk
</developerConnection>
<url>
scm:svn:http://192.168.0.112/svn/operacoes/ofertas_modulos
</url>
</scm>
<inceptionYear>2007</inceptionYear>
<developers>
<developer>
<id>helio</id>
<name>Helio Marci de Oliveira</name>
<email>helio@buscape-inc.com</email>
<organization>BuscaPe</organization>
<roles>
<role>Desenvolvedor Java</role>
</roles>
<timezone>-3</timezone>
</developer>
</developers>
<organization>
<name>BuscaPe</name>
<url>http://www.buscape.com.br</url>
</organization>
<repositories>
<repository>
<id>central</id>
<url>http://192.168.0.123:8081/artifactory/repo</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>http://192.168.0.123:8081/artifactory/repo</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://192.168.0.123:8081/artifactory/repo</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>snapshots</id>
<url>http://192.168.0.123:8081/artifactory/repo</url>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<configuration>
<outputEncoding>ISO-8859-1</outputEncoding>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
</dependency>
<dependency>
<groupId>buscape.offer</groupId>
<artifactId>buscape-soaofertas-beans</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>buscape.offer</groupId>
<artifactId>buscape-soaofertas-frmk</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>buscape.offer</groupId>
<artifactId>buscape-soaofertas-logging</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>buscape.offer</groupId>
<artifactId>buscape-soaofertas-torque</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>buscape.apache</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>buscape.apache</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>buscape.apache</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>buscape.apache</groupId>
<artifactId>commons-pool</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>buscape.apache</groupId>
<artifactId>jcs</artifactId>
<version>1.0-dev</version>
</dependency>
<dependency>
<groupId>buscape.sqlserver</groupId>
<artifactId>jtds</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.12</version>
</dependency>
<dependency>
<groupId>buscape.mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.0.4</version>
<classifier>bin</classifier>
</dependency>
<dependency>
<groupId>buscape.torque</groupId>
<artifactId>torque</artifactId>
<version>3.2</version>
</dependency>
<dependency>
<groupId>buscape.workingdogs</groupId>
<artifactId>village</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
<reporting>
<plugins>
<plugin>
<artifactId>maven-clover-plugin</artifactId>
</plugin>
<plugin>
<artifactId>
maven-project-info-reports-plugin
</artifactId>
</plugin>
<plugin>
<artifactId>maven-surefire-report-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>buscape_checks.xml</configLocation>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jxr-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<!-- DESCOMENTAR APENAS QUANDO SVN ESTIVER OK -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>changelog-maven-plugin</artifactId>
</plugin>
<!-- Verifica fonte procurando por comentarios TODO, FIXME -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>taglist-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jdepend-maven-plugin</artifactId>
<version>2.0-beta-1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<configuration>
<formats>
<format>html</format>
</formats>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>1.1.1</version>
<configuration>
<xmlOutput>false</xmlOutput>
<threshold>Normal</threshold>
<effort>Max</effort>
<excludeFilterFile>
findbugs-exclude.xml
</excludeFilterFile>
<includeFilterFile>
findbugs-include.xml
</includeFilterFile>
<visitors>
FindDeadLocalStores,UnreadFields
</visitors>
<omitVisitors>
FindDeadLocalStores,UnreadFields
</omitVisitors>
<onlyAnalyze>com.buscape.-</onlyAnalyze>
<debug>false</debug>
<relaxed>true</relaxed>
</configuration>
</plugin>
<plugin>
<artifactId>maven-pmd-plugin</artifactId>
<configuration>
<linkXref>true</linkXref>
<targetJdk>1.5</targetJdk>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
--
* Helio Marci de Oliveira *
Departamento de Tecnologia
helio@buscape-inc.com <ma...@buscape-inc.com>
tel: + 55 11 3848 8700 ramal:8780
skype: helio.marci
<http://www.buscape.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: cannot find symbol
Posted by helio <he...@buscape-inc.com>.
Dirk,
thanks for your answer! But the problem is not the Java version. I
verify that JAVA_HOME points to 1.5 and maven shows this when I run it
with "-X" option:
[helio@tecnologia37 SOA-Ofertas-modulos]$ mvn -X compile
+ Error stacktraces are turned on.
Maven version: 2.0.7
Java version: 1.5.0_09
OS name: "linux" version: "2.6.20-1.2925.fc6" arch: "i386"
...
Helio
Dirk Olmes escreveu:
> helio wrote:
>
>> Hi,
>>
>> I've encountered a strange error executing "mvn compile", as follows:
>>
>> [DEBUG]
>> /home/helio/buscape/projetos/tsunami/eclipse-desenv/SOA-Ofertas-modulos/src/main/java
>>
>> [INFO] Compiling 17 source files to
>> /home/helio/buscape/projetos/tsunami/eclipse-desenv/SOA-Ofertas-modulos/target/classes
>>
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] BUILD FAILURE
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Compilation failure
>>
>> /home/helio/buscape/projetos/tsunami/eclipse-desenv/SOA-Ofertas-modulos/src/main/java/com/buscape/oferta/lookup/OfferLookupManager.java:[126,39]
>> cannot find symbol
>> symbol : method
>> binarySearch(java.util.List<byte[]>,byte[],java.util.Comparator<byte[]>)
>> location: class java.util.Collections
>>
>> as you see, it can not find the method "binarySearch" of the class
>> "java.util.Collections". That method does exist and the call is correct
>> -- I've tried to create another project using the same method
>> "binarySearch" and the new application works fine. But I can not
>> understand why this error has happened. If I try to remove the class
>> "OfferLookupManager", the project can be compiled by maven.
>>
>> I'm using the maven 2.0.7 and Java 1.5.0_09. Could anybody help me,
>> please?
>>
>
> Are you sure that your JAVA_HOME points to the 1.5 JDK? I have seen
> cases where the java that's invoked from the commandline is not in sync
> with where JAVA_HOME points, leading to all kinds of trouble.
>
> -dirk
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
--
* Helio Marci de Oliveira *
Departamento de Tecnologia
helio@buscape-inc.com <ma...@buscape-inc.com>
tel: + 55 11 3848 8700 ramal:8780
skype: helio.marci
<http://www.buscape.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: cannot find symbol
Posted by Dirk Olmes <di...@xanthippe.ping.de>.
helio wrote:
> Hi,
>
> I've encountered a strange error executing "mvn compile", as follows:
>
> [DEBUG]
> /home/helio/buscape/projetos/tsunami/eclipse-desenv/SOA-Ofertas-modulos/src/main/java
>
> [INFO] Compiling 17 source files to
> /home/helio/buscape/projetos/tsunami/eclipse-desenv/SOA-Ofertas-modulos/target/classes
>
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Compilation failure
>
> /home/helio/buscape/projetos/tsunami/eclipse-desenv/SOA-Ofertas-modulos/src/main/java/com/buscape/oferta/lookup/OfferLookupManager.java:[126,39]
> cannot find symbol
> symbol : method
> binarySearch(java.util.List<byte[]>,byte[],java.util.Comparator<byte[]>)
> location: class java.util.Collections
>
> as you see, it can not find the method "binarySearch" of the class
> "java.util.Collections". That method does exist and the call is correct
> -- I've tried to create another project using the same method
> "binarySearch" and the new application works fine. But I can not
> understand why this error has happened. If I try to remove the class
> "OfferLookupManager", the project can be compiled by maven.
>
> I'm using the maven 2.0.7 and Java 1.5.0_09. Could anybody help me,
> please?
Are you sure that your JAVA_HOME points to the 1.5 JDK? I have seen
cases where the java that's invoked from the commandline is not in sync
with where JAVA_HOME points, leading to all kinds of trouble.
-dirk
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org