-
1. Re: Can't resolve @Clustered in session bean
sfcoy Jan 28, 2012 8:03 PM (in response to foutjo)Hi there,
You need to compile againt this jar:
{code:xml} <dependency>
<groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-ext-api</artifactId>
<version>2.0.0-beta-2</version>
</dependency>{code}
and the package name has changed to
{code:java}org.jboss.ejb3.annotation.Clustered{code}
-
2. Re: Can't resolve @Clustered in session bean
foutjo Jan 28, 2012 8:49 PM (in response to sfcoy)Thanks Stephen.
Is it just a matter of adding this dependency definition to some configuration file?
If yes what is the file name?
Also do I have to get the jar file or is it already part of AS7?
-
3. Re: Can't resolve @Clustered in session bean
sfcoy Jan 28, 2012 9:03 PM (in response to foutjo)That's a maven build time dependency.
If you're not using maven it can be found in the modules/org/jboss/ejb3/main directory of your AS7 installation, where it will be named jboss-ejb3-ext-api-2.0.0-beta-2.jar
-
4. Re: Can't resolve @Clustered in session bean
foutjo Jan 28, 2012 10:57 PM (in response to sfcoy)I see the jar but where and how do I support it?
Do I put something in the standalone.xml file?
Thanks.
-
5. Re: Can't resolve @Clustered in session bean
sfcoy Jan 28, 2012 11:01 PM (in response to foutjo)You don't need to do anything except compile against it.
It will be automatically available to you at runtime.
-
6. Re: Can't resolve @Clustered in session bean
foutjo Jan 28, 2012 11:28 PM (in response to sfcoy)I must be missing something.
I must have screwed something up.
Here is a list of what I have setup.
I have the latest version of Eclipse Indigo installed.
In Eclipse I installed Jboss tools.
I setup the server for as7.
In the classpath of my project it points to both the jbossv7 runtime and the jave 1.6 runtime.
I have a SLSB that has the @Clustered annotation.
Get can resolve @Clustered error on clean.
Tried organize imports and still could not find the jar.
Thanks.
-
7. Re: Can't resolve @Clustered in session bean
sfcoy Jan 28, 2012 11:48 PM (in response to foutjo)It looks like this jar is missing from the JBoss Tools eclipse runtime.
You can add it in the Preferences from Server/Runtime Environments/Default Classpath Entries/
The path you're looking for on AS7.0.2 is "modules/org/jboss/ejb3/main/jboss-ejb3-ext-api-2.0.0-beta-1.jar".
This assumes current Eclipse Indigo and JBoss Tools as described at JBoss Tools 3.3 M5 is coming to town.
-
8. Re: Can't resolve @Clustered in session bean
foutjo Jan 29, 2012 12:19 PM (in response to sfcoy)I started from scratch.
Downloaded jbossv7.1.0.CR1b
Latest Version of Indigo
Installed JBoss Tools 3.3 M5
Setup project with classpath to jbossv7.1.0.CR1b runtime and the jave 1.6 runtime.
Without even setting up the server as soon as I put @Clustered in my java bean I get the error can't resolve @Clustered type.
Tried organize imports and still does not find the jar file.
I then setup the server for 7.1.0
Did your suggestion:
"modules/org/jboss/ejb3/main/jboss-ejb3-ext-api-2.0.0-beta-1.jar".
Still get java error for @Clustered.
Not sure what I'm missing but if you try and put the @Clustered into a java program do you get the same error?
Thanks again for all of your help.
-
9. Re: Can't resolve @Clustered in session bean
sfcoy Jan 29, 2012 4:17 PM (in response to foutjo)I believe the package name changed (as above) between 5.1 and 7.x. Did you check that?
-
10. Re: Can't resolve @Clustered in session bean
foutjo Jan 30, 2012 8:54 AM (in response to sfcoy)Stephen,
Using Jboss 5.1 I remember that I had to include the following jar files in my classpath:
jboss-j2ee.jar and jboss.ejb3x.jar
In your previous answer you seemed to think that it was in:
modules/org/jboss/ejb3/main directory of your AS7 installation, where it will be named jboss-ejb3-ext-api-2.0.0-beta-2.jar
The problem is how do I get my Eclipse workspace to recognize it?
I would have thought that the @Clustered support would have been part of the standard as7 runtime jar file.
In your current AS7 eclipse workspace can you create a bean with the @Clustered annotation without getting an error?
Thanks.
-
11. Re: Can't resolve @Clustered in session bean
sfcoy Jan 30, 2012 10:33 AM (in response to foutjo)Yes I can.
Does your import statement look like:
{code:java}import org.jboss.ejb3.annotation.Clustered;{code}
?
-
12. Re: Can't resolve @Clustered in session bean
foutjo Jan 30, 2012 11:02 AM (in response to sfcoy)Yes when using 5.1 my code had the following:
import org.jboss.ejb3.annotation.Clustered;
After update to v7.1 this was an error: Could not resolve type.
Removed old import and did an organize import in Eclipse.
Eclipse found no match so it is still an error with unknown type.
-
13. Re: Can't resolve @Clustered in session bean
rhusar Jan 31, 2012 6:03 AM (in response to sfcoy)Stephen Coy wrote:
I believe the package name changed (as above) between 5.1 and 7.x. Did you check that?
No it hasnt, it's still and always been org.jboss.ejb3.annotation.Clustered. You shoud update the dependency to the AS7 one for sure.
-
14. Re: Can't resolve @Clustered in session bean
rhusar Jan 31, 2012 6:07 AM (in response to foutjo)After update to v7.1 this was an error: Could not resolve type.
Is this in Eclipse or in runtime? If you have problem only with IDE just build it manually (mvn install). For this annotation to work, make sure you are starting HA profile.
./bin/standalone.sh -c standalone-ha.xml