Sorry I'm still a newbie with maven. I encounter the following error
message when building and installing exercice 3.2 :
~/Bureau/glassfish_osgi/samples/pluggability-cli/cli > mvn clean
install
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.glassfish.pluggability:pluggability:pom:null
Reason: Cannot find parent: org.glassfish:glassfish-parent for
project: org.glassfish.pluggability:pluggability:pom:null for project
org.glassfish.pluggability:pluggability:pom:null
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find parent:
org.glassfish:glassfish-parent for project:
org.glassfish.pluggability:pluggability:pom:null for project
org.glassfish.pluggability:pluggability:pom:null
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:404)
...
I don't know what kind of problem it can be ... seems to be a
dependancy problem with a main pom.xml ?
I don't know either, but I had also the same error when trying this
exercise.
It worked after I made the last exercise, so I'm not sure at all, but
I wonder if it does not require the felix jar source. That's a wild
guess.
So, could you try the exercise 5, then retry the exercise 3, and tell
here if it works, then we could change the order of the exercises (not
very logical, but well...).
~/myosgiprojects/services/webclient > mvn install
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[INFO] Building Web client accessing Simple Provider Services
[INFO] task-segment: [install]
[INFO]
------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered
resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/matthieu/
myosgiprojects/services/webclient/src/main/resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 1 source file to /home/matthieu/myosgiprojects/
services/webclient/target/classes
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Compilation failure
/home/matthieu/myosgiprojects/services/webclient/src/main/java/
HelloWorld.java:[24,64] non-static method getClass() cannot be
referenced from a static context
...
Well ... that's obvious ... cut/paste is never a good way to
work ...
The HelloServlet.java should have lowercase "s" instead of "S" at
line 24
simpleService.getClass()...
instead of
SimpleService.getClass()
About exercise 3.2
The problem disappeared and I'm now able to build it ... and frankly I
don't know why ...
The parent project, org.glassfish:glassfish-parent:3.0-SNAPSHOT, is
not available in standard maven repositories. To get access to it you
can follow this instruction: http://wiki.glassfish.java.net/Wiki.jsp?page=V3DevelopmentInstructions
or just add the snippet included below to your pom.xml file:
<repositories>
<repository>
<id>glassfish-repository</id>
<name>GlassFish Repository</name>
<url>http://download.java.net/maven/glassfish</url>
</repository>
</repositories>
Kind regards,
--
Piotr Swiecicki
On Jan 18, 10:21 pm, matthieu vidal <m...@matthieu-vidal.com> wrote:
> About exercise 5 :
>
> Well ... that's obvious ... cut/paste is never a good way to
> work ...
>
> The HelloServlet.java should have lowercase "s" instead of "S" at
> line 24
>
> simpleService.getClass()...
> instead of
> SimpleService.getClass()
No, the first line gets the class of the interface (well it would
have, if I did not made a mistake), the second line the class of the
implementation:
SimpleService.class -> here SimpleService is a class object (well an
interface object) ==> this line gets corrected
simpleService.getClass() -> here simpleService is an instance of a
class (well an instance of SimpleService, that means really an
instance of simpleServiceImpl as SimpleService is an interface, thus
it is instantiated by its implementation).
The lab has been corrected, you should just wait till it is uploaded
on the javapassion.com ftp site.
Very sorry for the trouble.
/Peter
/PEter
On 19 Jan, 14:03, Peter Johansson <theironicprogram...@gmail.com>
wrote:
/Peter
On 19 Jan, 14:13, Peter Johansson <theironicprogram...@gmail.com>
wrote: