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.
Summary: | I18N - web jsf project with multibyte in the name - pallette components and desgn area do not show | ||
---|---|---|---|
Product: | obsolete | Reporter: | kaa <kaa> |
Component: | visualweb | Assignee: | _ deva <deva> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | deva, kaa, kfrank, potingwu, sandipchitale |
Priority: | P2 | Keywords: | I18N |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
exception
exception exception exception |
Description
kaa
2007-04-06 15:36:42 UTC
As I tested, using multibyte for project name will have 2 issues here: 1. The context path for the 'Web Project' will show '/___' that will cause the web project can't be deployed. Please file another bug against 'web/project' and CC me. 2. The package name for Visual Web beans will show the correct multibyte name. And as I tried, the project can be compiled without any issue. But the designer cannot get the correct insync model and failed. I.e., reassign to insync. NPE is in designer. No insync code on the stack. For the comment below: 1. The context path for the 'Web Project' will show '/___' that will cause the web project can't be deployed. Please file another bug against 'web/project' and CC me. web projects can be deployed with this notation if you are talking about the mutlibyte chars in project name being replaced with underscore - web team explicitly substututed the underscore for each multibyte (or perhaps also ascii > 127) character to avoid problems of browsers that cant process the actual mbyte in the uri. j2ee/web team could tell you more about this at lower level. that is, the context root/path is seeded with the project name. ---> When you did a regular web project with no framework chosen but using mbyte chars in the project name, and thus the substitution -- did it not deploy ? ken.frank@sun.com The NPE in designer comes from code, which was changed already, and this NPE shouldn't occur anymore. However if that NPE occured it means, there could have been some underlying bigger issue (corrupted model most probably). Marking this as fixed (the NPE from designer). If there is something else, like mentioned above, please file a new bug to appropriate subcomponent. This still happens. I don't see exception anymore but it does still happen. Am modifying the summary to be more clear and adding additional details and latest npe. please change to correct subcategory. 1. details from original issue are stil l the same but dont see exception mentioned 2. during project creation (of the project with multibyte as part of the name), ide locks up and must be manually exited. 3. then restart it - you can see this new project in explorer but as mentioned in original issue, the design area is not active that can have components dropped to it, nor is the vwp pallete populated with components. 4. and there is an exception (there is not the same exception as below now) java.lang.IllegalArgumentException: Type \244\310\344\356jot\344\356webap plication9\344\345\244\355.SessionBean1 cannot be found at org.netbeans.modules.visualweb.insync.java.TreeMakerUtils.crea teType(TreeMakerUtils.java:241) at org.netbeans.modules.visualweb.insync.java.TreeMakerUtils.crea teImport(TreeMakerUtils.java:252) at org.netbeans.modules.visualweb.insync.java.JavaUnit.addImport( JavaUnit.java:213) at org.netbeans.modules.visualweb.insync.java.JavaUnit.access$200 (JavaUnit.java:52) at org.netbeans.modules.visualweb.insync.java.JavaUnit$3.run(Java Unit.java:193) at org.netbeans.modules.visualweb.insync.java.WriteTaskWrapper.ru n(WriteTaskWrapper.java:53) at org.netbeans.modules.visualweb.insync.java.WriteTaskWrapper.ru n(WriteTaskWrapper.java:36) at org.netbeans.api.java.source.JavaSource.runModificationTask(Ja vaSource.java:711) at org.netbeans.modules.visualweb.insync.java.WriteTaskWrapper.ex ecute(WriteTaskWrapper.java:70) at org.netbeans.modules.visualweb.insync.java.WriteTaskWrapper.ex ecute(WriteTaskWrapper.java:58) at org.netbeans.modules.visualweb.insync.java.JavaUnit.ensureImpo rt(JavaUnit.java:189) at org.netbeans.modules.visualweb.insync.beans.BeanStructureScann er.ensureXRefAccessor(BeanStructureScanner.java:335) at org.netbeans.modules.visualweb.insync.faces.FacesBeanStructure Scanner.scan(FacesBeanStructureScanner.java:62) at org.netbeans.modules.visualweb.insync.beans.BeansUnit.scan(Bea nsUnit.java:233) where the \244\310\344\356jot\344\356 represents the multibyte part of the project name. Created attachment 42604 [details]
exception
full exception reported in previous comment is attached; I should not have pasted it in comments area and its not complete in any case. ken.frank@sun.com Now the exception comes from insync, passing there. additional information 1. new userdir, create the project that has mbyte in its name and in the package name that is on the wizard pane where vwp choice is exception is attached as vwpexception.projectcreation 2. need to manually close the ide since it locks up 3. restart using same userdir - project is shown in explorer but with not active design area and empty vwp pallette 4. click the project node in explorer and following 2 exceptions happen vwprestart.openproj vwprestart.openproj.2 ken.frank@sun.com Created attachment 42606 [details]
exception
Created attachment 42607 [details]
exception
Created attachment 42608 [details]
exception
Deva, this may be a problem in Retouche code in termns of not being able to handle multibyte names? See the last exception. please consider fixing this soon - new nb project encoding property has been done for web projects but it means we can't use multibyte in name of web project when its a vwp one, and we want to test that situation also. this is not related to localization, so even users of milestones and beta can run into it. ken.frank@sun.com In today's build I see: java.lang.NullPointerException at org.netbeans.modules.visualweb.insync.faces.FacesPageUnit.findMarkupSectionElement(FacesPageUnit.java:644) at org.netbeans.modules.visualweb.insync.faces.FacesPageUnit.newBoundBean(FacesPageUnit.java:526) at org.netbeans.modules.visualweb.insync.beans.BeansUnit.bindBean(BeansUnit.java:476) at org.netbeans.modules.visualweb.insync.beans.BeansUnit.bindBeans(BeansUnit.java:449) at org.netbeans.modules.visualweb.insync.beans.BeansUnit.bind(BeansUnit.java:248) at org.netbeans.modules.visualweb.insync.faces.FacesPageUnit.bind(FacesPageUnit.java:393) at org.netbeans.modules.visualweb.insync.beans.BeansUnit.sync(BeansUnit.java:189) at org.netbeans.modules.visualweb.insync.live.LiveUnit.sync(LiveUnit.java:315) at org.netbeans.modules.visualweb.insync.live.LiveUnitWrapper.getLiveUnit(LiveUnitWrapper.java:92) at org.netbeans.modules.visualweb.insync.models.FacesModel.getLiveUnit(FacesModel.java:564) at org.netbeans.modules.visualweb.insync.models.FacesModel.getRootBean(FacesModel.java:658) at org.netbeans.modules.visualweb.insync.faces.FacesPageUnit.renderHtml(FacesPageUnit.java:1621) at org.netbeans.modules.visualweb.insync.models.FacesModel.getHtmlDomFragment(FacesModel.java:1569) at org.netbeans.modules.visualweb.insync.faces.FacesPageUnit.findMarkupSectionElement(FacesPageUnit.java:642) at org.netbeans.modules.visualweb.insync.faces.FacesPageUnit.newBoundBean(FacesPageUnit.java:526) at org.netbeans.modules.visualweb.insync.beans.BeansUnit.bindBean(BeansUnit.java:476) at org.netbeans.modules.visualweb.insync.beans.BeansUnit.bindBeans(BeansUnit.java:449) at org.netbeans.modules.visualweb.insync.beans.BeansUnit.bind(BeansUnit.java:248) at org.netbeans.modules.visualweb.insync.faces.FacesPageUnit.bind(FacesPageUnit.java:393) at org.netbeans.modules.visualweb.insync.beans.BeansUnit.sync(BeansUnit.java:189) at org.netbeans.modules.visualweb.insync.live.LiveUnitWrapper.sync(LiveUnitWrapper.java:130) at org.netbeans.modules.visualweb.insync.models.FacesModel.syncImpl(FacesModel.java:1048) at org.netbeans.modules.visualweb.insync.Model.sync(Model.java:197) at org.netbeans.modules.visualweb.insync.ModelSet.syncAll(ModelSet.java:770) at org.netbeans.modules.visualweb.insync.models.FacesModelSet.syncAll(FacesModelSet.java:1301) at org.netbeans.modules.visualweb.insync.models.FacesModelSet.<init>(FacesModelSet.java:356) Caused: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at org.netbeans.modules.visualweb.insync.ModelSet.getInstance(ModelSet.java:372) Caused: java.lang.RuntimeException at org.netbeans.modules.visualweb.insync.ModelSet.getInstance(ModelSet.java:378) at org.netbeans.modules.visualweb.insync.ModelSet$1$1.run(ModelSet.java:343) at org.netbeans.modules.visualweb.insync.java.ReadTaskWrapper.run(ReadTaskWrapper.java:51) at org.netbeans.modules.visualweb.insync.java.ReadTaskWrapper.run(ReadTaskWrapper.java:34) at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:564) at org.netbeans.modules.visualweb.insync.java.ReadTaskWrapper.execute(ReadTaskWrapper.java:58) at org.netbeans.modules.visualweb.insync.ModelSet$1.run(ModelSet.java:340) [catch] at java.lang.Thread.run(Thread.java:595) The cause seems to be that the template for JSP does not get instantiated correctly: <?xml version="1.0" encoding="UTF-8"?> <jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf"> <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/> <f:view> <webuijsf:page binding="#{Page1.page1}" id="page1"> <webuijsf:html binding="#{Page1.html1}" id="html1"> <webuijsf:head binding="#{Page1.head1}" id="head1"> <webuijsf:link binding="#{Page1.link1}" id="link1" url="/resources/stylesheet.css"/> </webuijsf:head> <webuijsf:body binding="#{Page1.body1}" id="body1" style="-rave-layout: grid"> <webuijsf:form binding="#{Page1.form1}" id="form1"/> </webuijsf:body> </webuijsf:html> </webuijsf:page> </f:view> <webuijsf:body binding="#{a\u65e5\u672c\u8a9eb$Page1.body1}" id="body1"/> <webuijsf:head binding="#{a\u65e5\u672c\u8a9eb$Page1.head1}" id="head1"/> <webuijsf:page binding="#{a\u65e5\u672c\u8a9eb$Page1.page1}" id="page1"/> </jsp:root> Somehow Insync does not account for the default package in computing binding attr. Actually it turns out that the following code: return (String)ReadTaskWrapper.execute( new ReadTaskWrapper.Read() { public Object run(CompilationInfo cinfo) { return cinfo.getCompilationUnit().getPackageName().toString(); } }, fobj); is returning unicode escaped package name like this: "a\u65e5\u672c\u8a9eb" for the Java source file (some code trimmed for brevity) that looks like this (the package name has japanese chars in it). The java editor displays the package name in Japanese corectly : /* * Page1.java * * Created on Jun 18, 2007, 5:00:03 PM * Copyright sc32560 */ package a日本語b; import com.sun.rave.web.ui.appbase.AbstractPageBean; import com.sun.webui.jsf.component.Body; import com.sun.webui.jsf.component.Form; import com.sun.webui.jsf.component.Head; import com.sun.webui.jsf.component.Html; import com.sun.webui.jsf.component.Link; import com.sun.webui.jsf.component.Page; import javax.faces.FacesException; /** * <p>Page bean that corresponds to a similarly named JSP page. This * class contains component definitions (and initialization code) for * all components that you have defined on this page, as well as * lifecycle methods and event handlers where you may add behavior * to respond to incoming events.</p> */ public class Page1 extends AbstractPageBean { /** * <p>Construct a new Page bean instance.</p> */ public Page1() { } } FYI: I tried to get the package name using this approach which seems to return the package name without unicode escaping the multibyte chars: CompilationUnitTree compilationUnit = cinfo.getCompilationUnit(); ExpressionTree packageNameTree = compilationUnit.getPackageName(); StringBuffer packageNameBuffer = new StringBuffer(); if (packageNameTree != null) { new TreeScanner<Void, StringBuffer>() { @Override public Void visitIdentifier(IdentifierTree node, StringBuffer p) { p.append(node.getName().toString()); return null; } @Override public Void visitMemberSelect(MemberSelectTree node, StringBuffer p) { super.visitMemberSelect(node, p); p.append('.'); p.append(node.getIdentifier().toString()); return null; } }.scan(packageNameTree, packageNameBuffer); return packageNameBuffer.toString(); } return ""; However I now get this exception in TreeMaker :( java.lang.IllegalArgumentException: Type a???b.SessionBean1 cannot be found at org.netbeans.modules.visualweb.insync.java.TreeMakerUtils.createType(TreeMakerUtils.java:241) at org.netbeans.modules.visualweb.insync.java.TreeMakerUtils.createMethod(TreeMakerUtils.java:142) at org.netbeans.modules.visualweb.insync.java.JavaClass$10.run(JavaClass.java:329) at org.netbeans.modules.visualweb.insync.java.WriteTaskWrapper.run(WriteTaskWrapper.java:53) at org.netbeans.modules.visualweb.insync.java.WriteTaskWrapper.run(WriteTaskWrapper.java:36) at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:784) at org.netbeans.modules.visualweb.insync.java.WriteTaskWrapper.execute(WriteTaskWrapper.java:70) at org.netbeans.modules.visualweb.insync.java.WriteTaskWrapper.execute(WriteTaskWrapper.java:58) at org.netbeans.modules.visualweb.insync.java.JavaClass.addMethod(JavaClass.java:321) at org.netbeans.modules.visualweb.insync.java.JavaClass.addMethod(JavaClass.java:354) at org.netbeans.modules.visualweb.insync.beans.BeanStructureScanner.addXRefAccessor (BeanStructureScanner.java:342) at org.netbeans.modules.visualweb.insync.beans.BeansUnit.addXRefAccessor(BeansUnit.java:739) at org.netbeans.modules.visualweb.insync.models.FacesModel.addXRefAccessors(FacesModel.java:1829) at org.netbeans.modules.visualweb.insync.models.FacesModelSet.<init>(FacesModelSet.java:377) Caused: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at org.netbeans.modules.visualweb.insync.ModelSet.getInstance(ModelSet.java:372) Caused: java.lang.RuntimeException at org.netbeans.modules.visualweb.insync.ModelSet.getInstance(ModelSet.java:378) at org.netbeans.modules.visualweb.insync.ModelSet$1$1.run(ModelSet.java:343) at org.netbeans.modules.visualweb.insync.java.ReadTaskWrapper.run(ReadTaskWrapper.java:51) at org.netbeans.modules.visualweb.insync.java.ReadTaskWrapper.run(ReadTaskWrapper.java:34) at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:564) at org.netbeans.modules.visualweb.insync.java.ReadTaskWrapper.execute(ReadTaskWrapper.java:58) at org.netbeans.modules.visualweb.insync.ModelSet$1.run(ModelSet.java:340) [catch] at java.lang.Thread.run(Thread.java:595) Looks like this could be an issue of file encoding? just checking back about this issue - since IMO to be compatible with web projects (ie can use mbyte in project name) - is needed to be provided. ken.frank@sun.com Sorry, but CompilationUnit.getPackageName().toString() is not going to work - the toString method on Trees is supposed to be used only for debugging. Sorry. The approach Sandip sketched in his last post should work - not sure why the exception is thrown, but this should be first investigated in visualweb, IMO. This could work too (untested though): Element e = info.getTrees().getElement(new TreePath(info.getCompilationUnit())); if (e != null && e.getKind() == ElementKind.PACKAGE) { String name = ((PackageElement) e).getQualifiedName().toString(); } Deva, can you please follow this up. Followed Jan's suggestion to compute package name and also fixed similar issue in the code which ensures import statement verified: build 0714, ja_JP Visual Web app was created properly. Design view is availabe. |