You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Niclas Hedhman <ni...@hedhman.org> on 2007/10/26 07:26:27 UTC

Better error message needed...

The "unknown error occurred" message is very vague, and it turned out to be 
that I had a 
   Export-Package: org.hedhman.niclas; version=

without the actual value following "version".

IMHO, this could be captured a bit better...


Cheers
Niclas

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unknown error occurred

[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unknown error occurred
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at 
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unknown error 
occurred
        at 
org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:289)
        at 
org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:162)
        at 
org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:154)
        at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
        ... 16 more
Caused by: java.lang.NullPointerException
        at aQute.lib.osgi.header.OSGiHeader.parseHeader(OSGiHeader.java:73)
        at aQute.lib.osgi.Processor.parseHeader(Processor.java:60)
        at aQute.lib.osgi.Processor.parseHeader(Processor.java:50)
        at aQute.lib.osgi.Builder.getHeader(Builder.java:356)
        at aQute.lib.osgi.Builder.doExpand(Builder.java:218)
        at aQute.lib.osgi.Builder.build(Builder.java:46)
        at 
org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:252)
        ... 20 more

-- 
Niclas Hedhman, Software Developer

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

Re: Better error message needed...

Posted by Stuart McCulloch <st...@jayway.net>.
On 26/10/2007, Stuart McCulloch <st...@jayway.net> wrote:
>
> On 26/10/2007, Niclas Hedhman <ni...@hedhman.org> wrote:
> >
> >
> > The "unknown error occurred" message is very vague, and it turned out to
> > be
> > that I had a
> >    Export-Package: org.hedhman.niclas; version=
> >
> > without the actual value following "version".
> >
> > IMHO, this could be captured a bit better...
>
>
I've updated the bundle-plugin to report the following when an internal
error occurs:

   [ERROR] An internal error occurred

and it is now followed by the internal exception log (no need to add any
additional -X)

if Bnd detects any configuration errors they will be logged to the console
followed by:

   [ERROR] Error(s) found in bundle configuration

hopefully this will make things clearer (any internal errors should be
considered bugs)

-- 
Cheers, Stuart

Re[2]: Better error message needed...

Posted by Peter Kriens <Pe...@aQute.biz>.
Fixed it in 0.0.209 ...

Kind regards,

     Peter Kriens
     
SM> On 26/10/2007, Stuart McCulloch <st...@jayway.net>
SM> wrote: On 26/10/2007, Niclas Hedhman <ni...@hedhman.org> wrote: 
SM>  
SM> The "unknown error occurred" message is very vague, and it turned out to be
SM> that I had a
SM>    Export-Package: org.hedhman.niclas; version=

SM> without the actual value following "version".
SM>   
SM> IMHO, this could be captured a bit better...

SM> "unknown error occurred" is the default Maven message when a runtime exception occurs
SM> without an attached message... in this case an exception from Bnd percolated up through
SM> the bundle-plugin.

SM> at the moment we report any errors detected by Bnd, but in this case without knowing what
SM> caused the exception (ie. without duplicating the various checks made by Bnd) we can't point
SM> to a line in the instructions and say this is the problem line...

SM> the best we can do here is catch these runtime exceptions and log a general error message
SM> - anything extra really has to be done inside the Bnd tool itself (in this case a header check).


SM> in this case in the Bnd file "OSGiHeader.java", line 73:

SM>    clause.put(adname.trim(), advalue.trim());

SM> it should check advalue is not null before trimming it

SM>  
SM>  Cheers
SM> Niclas

SM> [INFO]
SM> ------------------------------------------------------------------------
SM> [ERROR] BUILD ERROR
SM> [INFO]
SM> ------------------------------------------------------------------------
SM> [INFO] Unknown error occurred

SM> [INFO]
SM> ------------------------------------------------------------------------
SM> [DEBUG] Trace
SM> org.apache.maven.lifecycle.LifecycleExecutionException: Unknown error occurred
SM>         at
SM> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
SM>          at 
SM> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
SM>         at
SM> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java :459)
SM>         at
SM> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
SM>         at
SM> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments
SM> (DefaultLifecycleExecutor.java:278)
SM>         at
SM> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
SM>         at
SM> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334) 
SM>         at
SM> org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
SM>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
SM>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
SM>          at
SM> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
SM>         at
SM> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
SM>         at java.lang.reflect.Method.invoke  (Method.java:585)
SM>         at
SM> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
SM>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
SM>         at
SM> org.codehaus.classworlds.Launcher.mainWithExitCode  (Launcher.java:430)
SM>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
SM> Caused by: org.apache.maven.plugin.MojoExecutionException: Unknown error
SM> occurred
SM>         at
SM> org.apache.felix.bundleplugin.BundlePlugin.execute  (BundlePlugin.java:289)
SM>         at
SM> org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:162)
SM>         at
SM> org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:154)
SM>         at
SM> 
SM> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
SM>         at
SM> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
SM>         ... 16 more 
SM> Caused by: java.lang.NullPointerException
SM>         at
SM> aQute.lib.osgi.header.OSGiHeader.parseHeader(OSGiHeader.java:73)
SM>         at aQute.lib.osgi.Processor.parseHeader(Processor.java:60)
SM>         at aQute.lib.osgi.Processor.parseHeader  (Processor.java:50)
SM>         at aQute.lib.osgi.Builder.getHeader(Builder.java:356)
SM>         at aQute.lib.osgi.Builder.doExpand(Builder.java:218)
SM>         at aQute.lib.osgi.Builder.build(Builder.java:46)
SM>         at 
SM> org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:252)
SM>         ... 20 more

SM> --
SM> Niclas Hedhman, Software Developer

SM> I  live here;  http://tinyurl.com/2qq9er 
SM> I  work here; http://tinyurl.com/2ymelc
SM> I relax here;  http://tinyurl.com/2cgsug




SM> -- 
SM>  Cheers, Stuart 





-- 
Peter Kriens                              Tel +33467542167
9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
34160 Beaulieu, France                    ICQ 255570717
Skype pkriens                             Fax +1 8153772599


Re: Better error message needed...

Posted by Stuart McCulloch <st...@jayway.net>.
On 26/10/2007, Stuart McCulloch <st...@jayway.net> wrote:
>
> On 26/10/2007, Niclas Hedhman <ni...@hedhman.org> wrote:
> >
> >
> > The "unknown error occurred" message is very vague, and it turned out to
> > be
> > that I had a
> >    Export-Package: org.hedhman.niclas; version=
> >
> > without the actual value following "version".
> >
> > IMHO, this could be captured a bit better...
>
>
> "unknown error occurred" is the default Maven message when a runtime
> exception occurs
> without an attached message... in this case an exception from Bnd
> percolated up through
> the bundle-plugin.
>
> at the moment we report any errors detected by Bnd, but in this case
> without knowing what
> caused the exception (ie. without duplicating the various checks made by
> Bnd) we can't point
> to a line in the instructions and say this is the problem line...
>
> the best we can do here is catch these runtime exceptions and log a
> general error message
> - anything extra really has to be done inside the Bnd tool itself (in this
> case a header check).
>

in this case in the Bnd file "OSGiHeader.java", line 73:

   clause.put(adname.trim(), advalue.trim());

it should check advalue is not null before trimming it

Cheers
> > Niclas
> >
> > [INFO]
> > ------------------------------------------------------------------------
> > [ERROR] BUILD ERROR
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Unknown error occurred
> >
> > [INFO]
> > ------------------------------------------------------------------------
> > [DEBUG] Trace
> > org.apache.maven.lifecycle.LifecycleExecutionException: Unknown error
> > occurred
> >         at
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> > DefaultLifecycleExecutor.java:564)
> >         at
> >
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
> > (DefaultLifecycleExecutor.java:480)
> >         at
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
> > DefaultLifecycleExecutor.java :459)
> >         at
> >
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
> > (DefaultLifecycleExecutor.java:311)
> >         at
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
> > DefaultLifecycleExecutor.java:278)
> >         at
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
> > DefaultLifecycleExecutor.java:143)
> >         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
> >
> >         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
> >         at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >         at
> > sun.reflect.NativeMethodAccessorImpl.invoke(
> > NativeMethodAccessorImpl.java:39)
> >         at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > DelegatingMethodAccessorImpl.java:25)
> >         at java.lang.reflect.Method.invoke (Method.java:585)
> >         at org.codehaus.classworlds.Launcher.launchEnhanced(
> > Launcher.java:315)
> >         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> >         at
> > org.codehaus.classworlds.Launcher.mainWithExitCode (Launcher.java:430)
> >         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> > Caused by: org.apache.maven.plugin.MojoExecutionException: Unknown error
> > occurred
> >         at
> > org.apache.felix.bundleplugin.BundlePlugin.execute (BundlePlugin.java
> > :289)
> >         at
> > org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java
> > :162)
> >         at
> > org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java
> > :154)
> >         at
> > org.apache.maven.plugin.DefaultPluginManager.executeMojo(
> > DefaultPluginManager.java:443)
> >         at
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> > DefaultLifecycleExecutor.java:539)
> >         ... 16 more
> > Caused by: java.lang.NullPointerException
> >         at aQute.lib.osgi.header.OSGiHeader.parseHeader(OSGiHeader.java
> > :73)
> >         at aQute.lib.osgi.Processor.parseHeader(Processor.java:60)
> >         at aQute.lib.osgi.Processor.parseHeader (Processor.java:50)
> >         at aQute.lib.osgi.Builder.getHeader(Builder.java:356)
> >         at aQute.lib.osgi.Builder.doExpand(Builder.java:218)
> >         at aQute.lib.osgi.Builder.build(Builder.java:46)
> >         at
> > org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java
> > :252)
> >         ... 20 more
> >
> > --
> > Niclas Hedhman, Software Developer
> >
> > I  live here; http://tinyurl.com/2qq9er
> > I  work here; http://tinyurl.com/2ymelc
> > I relax here; http://tinyurl.com/2cgsug
> >
>
>
>
> --
> Cheers, Stuart




-- 
Cheers, Stuart

Re: Better error message needed...

Posted by Stuart McCulloch <st...@jayway.net>.
On 26/10/2007, Niclas Hedhman <ni...@hedhman.org> wrote:
>
>
> The "unknown error occurred" message is very vague, and it turned out to
> be
> that I had a
>    Export-Package: org.hedhman.niclas; version=
>
> without the actual value following "version".
>
> IMHO, this could be captured a bit better...


"unknown error occurred" is the default Maven message when a runtime
exception occurs
without an attached message... in this case an exception from Bnd percolated
up through
the bundle-plugin.

at the moment we report any errors detected by Bnd, but in this case without
knowing what
caused the exception (ie. without duplicating the various checks made by
Bnd) we can't point
to a line in the instructions and say this is the problem line...

the best we can do here is catch these runtime exceptions and log a general
error message
- anything extra really has to be done inside the Bnd tool itself (in this
case a header check).

Cheers
> Niclas
>
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Unknown error occurred
>
> [INFO]
> ------------------------------------------------------------------------
> [DEBUG] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Unknown error
> occurred
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> DefaultLifecycleExecutor.java:564)
>         at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
> (DefaultLifecycleExecutor.java:480)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
> DefaultLifecycleExecutor.java:459)
>         at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
> (DefaultLifecycleExecutor.java:311)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
> DefaultLifecycleExecutor.java:278)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
> DefaultLifecycleExecutor.java:143)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
> :39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java
> :315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Unknown error
> occurred
>         at
> org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:289)
>         at
> org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:162)
>         at
> org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:154)
>         at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(
> DefaultPluginManager.java:443)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> DefaultLifecycleExecutor.java:539)
>         ... 16 more
> Caused by: java.lang.NullPointerException
>         at aQute.lib.osgi.header.OSGiHeader.parseHeader(OSGiHeader.java
> :73)
>         at aQute.lib.osgi.Processor.parseHeader(Processor.java:60)
>         at aQute.lib.osgi.Processor.parseHeader(Processor.java:50)
>         at aQute.lib.osgi.Builder.getHeader(Builder.java:356)
>         at aQute.lib.osgi.Builder.doExpand(Builder.java:218)
>         at aQute.lib.osgi.Builder.build(Builder.java:46)
>         at
> org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:252)
>         ... 20 more
>
> --
> Niclas Hedhman, Software Developer
>
> I  live here; http://tinyurl.com/2qq9er
> I  work here; http://tinyurl.com/2ymelc
> I relax here; http://tinyurl.com/2cgsug
>



-- 
Cheers, Stuart