This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 16365 - Problems installing custom beans
Summary: Problems installing custom beans
Status: CLOSED DUPLICATE of bug 8660
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: PC Linux
: P4 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-09 10:48 UTC by Stefan Podkowinski
Modified: 2003-06-30 18:32 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Podkowinski 2001-10-09 10:48:59 UTC
I was having a some problems installing custom java beans in NB. The main
problem was the lack of good error messages. I had a hard time making NB
recognize my beans.

After NB I tried my beans with Sun's BDK and most of the time they worked fine,
but netbeans still told me that my jar file would not include beans. I tried to
install the set of beans that come with the BDK and some of them failed, too.

Please check if those beans comming with the BDK are really invalid (e.g.
Juggler). But most of all I would appreciate good error messages why actually
some beans cannot be installed.

Software:
NB 3.2 Build 39
JDK (Blackdown) 1.3.1
Comment 1 Tomas Pavek 2001-10-12 10:28:03 UTC
This is the same problem as described in issue 8660.

JAR files in BDK contain invalid manifest files, e.g. the Juggler:
---------- %< -----------------
Manifest-Version: 1.0
Name: sunw/demo/juggler/Juggler.class
Java-Bean: True
Created-By: 1.2.2 (Sun Microsystems Inc.)
---------- %< -----------------

This is wrong. According to specification, it should look like:
---------- %< -----------------
Manifest-Version: 1.0
Created-By: 1.2.2 (Sun Microsystems Inc.)

Name: sunw/demo/juggler/Juggler.class
Java-Bean: True
---------- %< -----------------

Correcting the manifest file this way makes it work in NetBeans. 
There's no error message for the bad manifest - it is processed by 
java.util.jar.Manifest class which simply finds no bean section 
because it is not separated by an empty line from the main section as 
the spec requires. Looking at the specification on
http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html,
JAR Manifest chapter you can read:

> The main section contains security and configuration information
> about the JAR file itself, ... [snip]
> This section is terminated by an empty line.

There are bugs already reported on java bugs parade:
4280988 that java.util.jar.Manifest is not able to handle manifests 
like those from BDK - closed as not a bug because such manifests do 
not conform to specification.

4312965 that BDK contains invalid manifests in JARs with bean - 
closed as won't fix because BDK is no longer developed (BeanBox does 
not use the Manifest API).


So that's it - if you want to use beans from BDK in NetBeans, you 
must correct the manifest files.

I'll repost this also to nbusers.

*** This issue has been marked as a duplicate of 8660 ***
Comment 2 Quality Engineering 2003-06-30 18:20:14 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.
Comment 3 Quality Engineering 2003-06-30 18:32:10 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.