You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Michael Hüttermann <mi...@huettermann.net> on 2008/11/14 16:27:15 UTC

Compilation failure .. symbol: method lookup(java.lang.String)

Hello,

I have an EJB 2.1 project (the relevant POM snippets below). If I want to
compile it I get a Build Failure:
Compilation failure ..
symbol: method lookup(java.lang.String)
location: interface javax.ejb.SessionContext

Why ? What is wrong with the POM ? How do I have to reference the J2EE
spec correctly ? Thank you very much !!!!!


<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>aaa</groupId>
	<artifactId>bbb</artifactId>
	<version>1.0-SNAPSHOT</version>
	<packaging>ejb</packaging>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-ejb-plugin</artifactId>
				<configuration>
	                            <generateClient>true</generateClient>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<dependencies>
...
		<dependency>
			<groupId>org.apache.geronimo.specs</groupId>
			<artifactId>geronimo-j2ee_1.4_spec</artifactId>
			<version>1.1</version>
			<scope>provided</scope>
		</dependency>
	</dependencies>
	...
</project>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Compilation failure .. symbol: method lookup(java.lang.String) -- EJB 2

Posted by Heinrich Nirschl <he...@gmail.com>.
On Sat, Nov 15, 2008 at 6:11 PM, Michael Hüttermann
<mi...@huettermann.net> wrote:
> I'm just wondering: no one did ever compile an EJB 2 project with Maven 2
> ???
>
>
> Michael Hüttermann schrieb:
>>
>> Hello,
>>
>> I have an EJB 2.1 project (the relevant POM snippets below). If I want to
>> compile it I get a Build Failure:
>> Compilation failure ..
>> symbol: method lookup(java.lang.String)
>> location: interface javax.ejb.SessionContext

I guess, that's just a problem with your Java code. The error message
indicates, that you try to use a method "lookup" which does not exist
in the interface "javax.ejb.SessionContext".

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Compilation failure .. symbol: method lookup(java.lang.String) -- EJB 2

Posted by Michael Hüttermann <mi...@huettermann.net>.
I'm just wondering: no one did ever compile an EJB 2 project with Maven 
2 ???


Michael Hüttermann schrieb:
> Hello,
>
> I have an EJB 2.1 project (the relevant POM snippets below). If I want to
> compile it I get a Build Failure:
> Compilation failure ..
> symbol: method lookup(java.lang.String)
> location: interface javax.ejb.SessionContext
>
> Why ? What is wrong with the POM ? How do I have to reference the J2EE
> spec correctly ? Thank you very much !!!!!
>
>
> <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>aaa</groupId>
> 	<artifactId>bbb</artifactId>
> 	<version>1.0-SNAPSHOT</version>
> 	<packaging>ejb</packaging>
> 	<build>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-ejb-plugin</artifactId>
> 				<configuration>
> 	                            <generateClient>true</generateClient>
> 				</configuration>
> 			</plugin>
> 		</plugins>
> 	</build>
> 	<dependencies>
> ...
> 		<dependency>
> 			<groupId>org.apache.geronimo.specs</groupId>
> 			<artifactId>geronimo-j2ee_1.4_spec</artifactId>
> 			<version>1.1</version>
> 			<scope>provided</scope>
> 		</dependency>
> 	</dependencies>
> 	...
> </project>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
>
>   






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Compilation failure .. symbol: method lookup(java.lang.String)

Posted by Wayne Fay <wa...@gmail.com>.
> I still wonder what others exactly use as J2EE dependency for compiling EJB
> 2 projects with Maven 2 ??

For our EJB2 projects, we use geronimo-spec-ejb directly... Not the
geronimo-j2ee_1.4_spec that you are using.

<dependency>
  <groupId>geronimo-spec</groupId>
  <artifactId>geronimo-spec-ejb</artifactId>
  <version>2.1-rc4</version>
</dependency>

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Compilation failure .. symbol: method lookup(java.lang.String)

Posted by Michael Hüttermann <mi...@huettermann.net>.
thanks!!!, but it does contain the "missing" class 
javax.ejb.SessionContext.
I'm not sure when to use the Geronimo artifact I used or a 
geronimo-spec-ejb.
Anyway, my j2ee geronimo dependency does contain the SessionContext 
artifact ...
why does compiling fail nevertheless?? :-(
Using a javax.ejb.SessionContext is necessary for all EJB 2 applications 
.. so
I still wonder what others exactly use as J2EE dependency for compiling 
EJB 2
projects with Maven 2 ??

Michael


Wayne Fay schrieb:
>> symbol: method lookup(java.lang.String)
>> location: interface javax.ejb.SessionContext
>>
>>                <dependency>
>>                        <groupId>org.apache.geronimo.specs</groupId>
>>                        <artifactId>geronimo-j2ee_1.4_spec</artifactId>
>>                        <version>1.1</version>
>>                        <scope>provided</scope>
>>                </dependency>
>>     
>
> Go into your Maven repo cache under ~/.m2/repository and find the jar
> file corresponding to this artifact. Open it with a zip file tool like
> WinZip etc. Dig around in the jar to confirm it has the class file
> corresponding to the interface mentioned in the error.
>
> I would be willing to bet it does not have the class. You probably
> need to use geronimo-spec-ejb or another similar artifact instead.

Re: Compilation failure .. symbol: method lookup(java.lang.String)

Posted by Wayne Fay <wa...@gmail.com>.
> symbol: method lookup(java.lang.String)
> location: interface javax.ejb.SessionContext
>
>                <dependency>
>                        <groupId>org.apache.geronimo.specs</groupId>
>                        <artifactId>geronimo-j2ee_1.4_spec</artifactId>
>                        <version>1.1</version>
>                        <scope>provided</scope>
>                </dependency>

Go into your Maven repo cache under ~/.m2/repository and find the jar
file corresponding to this artifact. Open it with a zip file tool like
WinZip etc. Dig around in the jar to confirm it has the class file
corresponding to the interface mentioned in the error.

I would be willing to bet it does not have the class. You probably
need to use geronimo-spec-ejb or another similar artifact instead.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org