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 54730 - I18N - Cannot create session bean with name containing multibyte character - NPE is thrown
Summary: I18N - Cannot create session bean with name containing multibyte character - ...
Status: CLOSED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: EJB (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Martin Adamek
URL:
Keywords: I18N
: 56462 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-02-09 10:41 UTC by Marek Grummich
Modified: 2006-03-24 13:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (163.20 KB, image/gif)
2005-02-09 10:42 UTC, Marek Grummich
Details
exception (17.52 KB, text/plain)
2005-02-09 10:42 UTC, Marek Grummich
Details
Exception_2 (719 bytes, text/plain)
2005-03-11 13:40 UTC, Marek Grummich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Grummich 2005-02-09 10:41:11 UTC
Build 200502081900, jdk1.5.0_02
Steps to reproduce:
- start ide on windows xp (japanese)
- create a new EJBModule thru wizard; use a
multibyte character in the module name (ok)
- add a new session bean thru wizard; use a
multibyte character in both bean and package names
- when a Finish button is pressed, the attached
exception is thrown
The wizard is not closed, user can press Finish
button again, but *_1, *_2 files are created. The
wizard is possible to close by Cancel button.
Please, look at the attached screenshot also,
there is a difference how the multibyte characters
are displayed in the editor (wrong) and explorer
(right)
Comment 1 Marek Grummich 2005-02-09 10:42:04 UTC
Created attachment 20263 [details]
screenshot
Comment 2 Marek Grummich 2005-02-09 10:42:34 UTC
Created attachment 20264 [details]
exception
Comment 3 Ken Frank 2005-02-10 17:59:12 UTC
This also happens on solaris in non utf8 asian locales, like ja.

In this case, instead of the multibyte that is not correct in editor
(see gif), there are ????, which also is a usual sign of encoding
issue.

My guess only is, since it happens not in utf8 locale, that it could
be that code is using utf8 instead of encoding of the locale the user
is in, or else that utf8 is ok to use, but its not processing the
characters that user typed in as name for the bean as being in
the encoding of the locale the user is in.

PS - can you see if there is common code that handles other
items in new->file->enterprise like other kinds of ejb, etc
which might also have this issue ?

ken.frank@sun.com

ken.frank@sun.com
Comment 4 Ken Frank 2005-02-11 20:55:46 UTC
happens for most other file->new items like entity bean, etc
in context of an ejb project.

This includes web service also.

ken.frank@sun.com
Comment 5 Martin Adamek 2005-02-17 12:11:09 UTC
Problem is that ClassElementFinder is not able to find class in given
file which is created from template by XLS transformation. Output is
encoded as UTF-8, but input needs to be checked, problem is probably
there.
Comment 6 Ken Frank 2005-02-17 23:11:39 UTC
Can you look at other encoding handling in this module or parts
of it as to processing file/project names or data that would have
multibyte to make sure its all 
done ok (using utf8 or encoding of the users locale as required) ?
(including handling of both file creation, modifying saving and
rereading on file reopen and on ide restart)

Dev team is in process of providing some specs to us on encoding
handling for testing; they might be able to give some additional
information.

ken.frank@sun.com
Comment 7 Martin Adamek 2005-02-24 08:50:46 UTC
File was really generated with wrong characters. It is fixed now:
Checking in EjbGenerationUtil.java;
/cvs/j2ee/ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ejb/wizard/EjbGenerationUtil.java,v
 <--  EjbGenerationUtil.java
new revision: 1.12; previous revision: 1.11

But original exception is still there.
Comment 8 Martin Adamek 2005-02-24 09:01:18 UTC
In TopClassesCollection.getClass (TopClassesCollection:114)
iter.next() returns wrong object (class name has some wrong encoding
and is not complete), so I am reassigning this to java

How to reproduce:
1) New > Enterprise > EJB Module > Next > Finish
2) on project node New > Session Bean
3) Ejb Name: Výlet, package: foo > Finish
4) Exceptions (ClassElement.forName returns null)

General Java project with name Výlet is OK, it never stops on
mentioned breakpoint in TopClassesCollection
Comment 9 Martin Adamek 2005-02-24 09:06:39 UTC
Short note: after exception occured, I close IDE and I am able to run
build.xml of generated project without any errors, all classes are
compiled fine...
Comment 10 Jan Becicka 2005-02-25 14:04:15 UTC
There must be a bug in bridge. ClassElement.forName() returns null.
Dane, please take a look at it. Thanks
Comment 11 Jan Becicka 2005-02-25 15:28:48 UTC
BTW: these messages are written to console
error: __input:0,0: illegal character: \8482
error: __input:0,0: illegal character: \8482
error: __input:0,0: illegal character: \8482
error: __input:0,0: illegal character: \8482
error: __input:0,0: illegal character: \8482
Comment 12 Ken Frank 2005-02-25 17:09:58 UTC
adding keyword I18N is fine and appreciated, but please leave
I18N as first part of synopsis for other tracking purposes.
Comment 13 Daniel Prusa 2005-03-04 09:24:19 UTC
This bug has not roots in TopClassesCollection, neither in hierarchy
source bridge at all. The source is badly generated, it contains
incorrect characters, thus a class with bad name is created in the jmi
java model when the source is parsed. This is the reason, why forName
does not work. We should focus on generating of the source file.
Comment 14 Martin Adamek 2005-03-04 15:47:18 UTC
I was able to build that app, so I guess files are correct ... Maybe
we should compare our scenarios.
Comment 15 Tomas Hurka 2005-03-11 10:50:25 UTC
I was able to create Výlet session bean without problems on RH Linux running NetBeans on JDK 1.5.0 
with Czech locale (cs_CZ (nb); ISO_8859-2).
Comment 16 Marek Grummich 2005-03-11 13:39:37 UTC
I tried to repeat my previous/following steps with build 200503101100,
jdk1.5.0_02, locale ja_JP (nb):
- create a new EJB Module (named without mb chars) 
- add a new session bean (named New<3xmbchar>Session; package pkg)
Error: contents of bean's classes (names) are still corrupted (see source editor)

Note:
The attached exception I got when I expanded EJB's Local Methods node in the
Project view.
Comment 17 Marek Grummich 2005-03-11 13:40:40 UTC
Created attachment 20783 [details]
Exception_2
Comment 18 Martin Adamek 2005-03-11 14:04:42 UTC
I was able to create Výlet session bean without problems on Mandrake Linux
running NetBeans on JDK 1.5.0_01 with US locale (en_US (nb); ISO_8859-1). It
means I am not able to reproduce my previous problem, something was fixed
probably. I will play with japanese now...
Comment 19 Ken Frank 2005-03-15 17:12:36 UTC
Since this appears in j2ee project, but not in java, is this issue
really in java module area ? (vs j2ee)

If so, is this on the list of nb4.1 planned fixes ? We think its needed
for i18n/l10n.

ken.frank@sun.com
Comment 20 Martin Matula 2005-03-15 17:18:55 UTC
The question is - has anybody been able to reproduce this recently? We were
trying to investigate this issue but we were not able to since it does not seem
to be reproducible (even for the J2EE stuff)...
Comment 21 Ken Frank 2005-03-15 17:56:15 UTC
just reproduced on solaris ja locale; we've seen it happen for windows and solaris
ja but probably not for solaris ja utf8.



and as far as I know, it happens just in j2ee/websvc areas, not for java.

ken.frank@sun.com
Comment 22 Martin Adamek 2005-03-15 18:07:38 UTC
Now it looks to really J2EE problem. Moving back to J2EE.
Comment 23 Martin Adamek 2005-03-23 09:30:36 UTC
*** Issue 56462 has been marked as a duplicate of this issue. ***
Comment 24 Martin Adamek 2005-03-23 09:32:54 UTC
Problem doesn't occur with all japanese multibyte characters, only with some
subset. I have no idea which subset it is and why this subset is not working.
One of problematic characters is first MB character in attached screenshot. If
you remove it, everything will work fine. I will investigate more.
Comment 25 Martin Adamek 2005-03-23 20:18:08 UTC
Fixed. Tested with MB chars in package and bean names, with MBs in database and
tables. Everything worked well on Windows with japanese locale.

/cvs/j2ee/ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ejb/wizard/EjbGenerationUtil.java,v
 <--  EjbGenerationUtil.java; new revision: 1.17; previous revision: 1.16
Comment 26 Marek Grummich 2005-04-01 09:33:15 UTC
Verified - pseudolocalized build 200503242007