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 17652 - details for: Adding a Bean to the Component Palette
Summary: details for: Adding a Bean to the Component Palette
Status: RESOLVED FIXED
Alias: None
Product: usersguide
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: Other Other
: P3 blocker (vote)
Assignee: John Jullion-ceccarelli
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-14 10:16 UTC by Dennis Daniels
Modified: 2003-07-10 13:35 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 Dennis Daniels 2001-11-14 10:16:23 UTC
this fix for converting BDK beans to NB beans would be very useful to new bean 
players...

Tomas Pavek (tomas.pavek@czech.sun.com) writes on 2001-10-12 (display as raw 
message)  
From: "Tomas Pavek" <tomas.pavek@czech.sun.com>
Date: Fri, 12 Oct 2001 11:28:28 +0200
Content-Type: text/plain;
	charset="iso-8859-1"
Subject: Re: [nbusers] Bean Installation Problems


 
> I've downloaded the BDK from sun and my bean is working fine in their 
> beanbox. When I took over some of the BDK beans to NB the installation 
> failed for most of them, too, but not for all which surprissed me since 
> I could not figure out what exactly made the point there.

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 (resp. just the first one) 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: java.util.jar.Manifest is not able to handle manifests like those from
BDK. This was closed as not a bug because such manifests do not conform
to specification.

4312965: BDK contains invalid manifests in JARs with bean. This was closed
as won't fix because BDK is no longer developed (it works in BeanBox because
it does not use the Manifest API from JDK).


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

  - Tomas
Comment 1 Patrick Keegan 2001-11-14 18:03:57 UTC
probably not appropriate for the online help. But this would be a good 
addition to the Knowledge Base/FAQs available on the web site.
Comment 2 Jan Chalupa 2001-11-27 17:24:24 UTC
Target milestone -> 3.3.1.
Comment 3 John Jullion-ceccarelli 2002-03-01 11:42:42 UTC
I'm just getting back to this after a long time, sorry. I'd like to 
put this on the FAQ but I can't find a beans-specific FAQ. Where 
should this go? http://java.netbeans.org/doc/faq.html?
Comment 4 Marek Grummich 2002-07-22 11:46:15 UTC
Set target milestone to TBD
Comment 5 Marek Grummich 2002-07-22 11:49:31 UTC
Set target milestone to TBD
Comment 6 Patrick Keegan 2003-07-10 13:35:25 UTC
Already answered in the FAQs
http://www.netbeans.org/kb/faqs/all-nbuser-faqs.html#FAQ_1_44