I fully accept that this may be my own lack of Java/iPOJO knowledge, but I have 
a curious error being tossed out by the iPOJO maven plugin.

The following code:

        @Validate
        public final void start() throws Exception {
                preStart();

                try {
                        String test  = 
ResourceBundle.getBundle("config").getString("com.itslm.omneity.localdb");
                        LOGGER.debug("READ CONFIG: " + test);
                        connectLocalDB("target/db");
                } catch (Exception ex) {
                        
LOGGER.error(LOGMSG.getString("failedToConnectOnStart"));
                        throw new 
Exception(LOGMSG.getString("failedToConnectOnStart"), ex);
                }

                // FIXME Remove from code. This is a test only...
                try {
                        Vertex a = addVertex(null);
                        Vertex b = addVertex(null);
                } finally {
                        stopTransaction(Conclusion.SUCCESS);
                }
                
                
                postStart();
        }

Throws the following exception at build time:

[ERROR] Failed to execute goal 
org.apache.felix:maven-ipojo-plugin:1.8.2:ipojo-bundle (default) on project 
com.itslm.omneity.data: Execution default of goal 
org.apache.felix:maven-ipojo-plugin:1.8.2:ipojo-bundle failed: 
java.lang.ClassNotFoundException: com.tinkerpop.blueprints.Vertex -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
org.apache.felix:maven-ipojo-plugin:1.8.2:ipojo-bundle (default) on project 
com.itslm.omneity.data: Execution default of goal 
org.apache.felix:maven-ipojo-plugin:1.8.2:ipojo-bundle failed: 
java.lang.ClassNotFoundException: com.tinkerpop.blueprints.Vertex
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)


However, if the code is changed to:

        @Validate
        public final void start() throws Exception {
                preStart();

                String test;
                try {
                        test  = 
ResourceBundle.getBundle("config").getString("com.itslm.omneity.localdb");
                        LOGGER.debug("READ CONFIG: " + test);
                        connectLocalDB("target/db");
                } catch (Exception ex) {
                        
LOGGER.error(LOGMSG.getString("failedToConnectOnStart"));
                        throw new 
Exception(LOGMSG.getString("failedToConnectOnStart"), ex);
                }

                // FIXME Remove from code. This is a test only...
                try {
                        Vertex a = addVertex(null);
                        Vertex b = addVertex(null);
                } finally {
                        stopTransaction(Conclusion.SUCCESS);
                }
                
                
                postStart();
        }

Just moving the declaration of test outside the initial try block. Everything 
processes correctly.

Am I misunderstanding something, or is this an issue with the Maven iPOJO 
plugin?

Regards, 
Mark

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to