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 47616 - [40cat] 4.0 project fails with preverifying error. Works in 3.6.
Summary: [40cat] 4.0 project fails with preverifying error. Works in 3.6.
Status: CLOSED FIXED
Alias: None
Product: javame
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Adam Sotona
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-21 01:30 UTC by IntOne
Modified: 2006-10-23 16:41 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Complete Java source for one of two classes in package (1.84 KB, patch)
2004-08-23 15:12 UTC, IntOne
Details | Diff
Stub version of java source for midlet - Most guts removed (5.92 KB, patch)
2004-08-23 15:14 UTC, IntOne
Details | Diff
Build.xml output with Use Obfuscation ON (75.48 KB, patch)
2004-08-23 15:16 UTC, IntOne
Details | Diff
Build.xml output with Use Obfuscation OFF (62.29 KB, patch)
2004-08-23 15:16 UTC, IntOne
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description IntOne 2004-08-21 01:30:52 UTC
[ JDK VERSION : J2SE 1.5.0 ]

I get the following error when building my project.  This is a simple two file / two class project that involves a callback.  I tried a couple of things and everything I do continues to work under 3.6 but fails with this same error under 4.0.  I have no idea how to troubleshoot/debug a preverify error.

Do you think it's a bug?  If so, what do you need from me in the way of files?

Created dir: C:\Documents and Settings\Owner\ImportedProject-Directions\build\preverified
Preverifying 12 file(s) into C:\Documents and Settings\Owner\ImportedProject-Directions\build\preverified directory.
Error preverifying class httpConnectionHelper$Callback
    Class loading error: Wrong name
C:\Documents and Settings\Owner\ImportedProject-Directions\nbproject\build-impl.xml:198: Preverification failed with error code 1.
BUILD FAILED (total time: 9 seconds)
Comment 1 Martin Ryzl 2004-08-21 11:25:27 UTC
could you attach/send us the application? Also, if you set Tools |
Options | Building | Ant Settings | Verbosity Level, to Verbose you
will be able to see the command line used for compilation and
preverification. 
Comment 2 IntOne 2004-08-23 14:35:31 UTC
Hi,

I cut the guts out of the main midlet (mapMagic) as it is one I'm 
about to go commercial with and didn't want the source to get out.  
Even in the gutted state, it compiles, preverifies and executes (at 
least the emulator comes up to the launch point) in 3.6.  Still get 
the same preverify error in 4.0.  Even with verbose on in Ant, I 
can't tell what it's upset about.

Perhaps something has tightened up in 4.0 that 3.6 used to let me get 
away with.  I'm not a Java guru, so I certainly could be doing 
something wrong, but I don't think so.

Anyway, attached are the two java src files.  Let me know if you need 
anything else.

Robin

PS:  I could not get the attachment screen to work.  It's mostly 
blank with very few options to choose from and it complains no matter 
what I try.  I even disable Norton to see if it was mucking with the 
screen and still mo luck.  Tell me another way to get the source to 
you and I will try.

Comment 3 IntOne 2004-08-23 15:12:49 UTC
Created attachment 17030 [details]
Complete Java source for one of two classes in package
Comment 4 IntOne 2004-08-23 15:14:25 UTC
Created attachment 17031 [details]
Stub version of java source for midlet - Most guts removed
Comment 5 IntOne 2004-08-23 15:16:06 UTC
Created attachment 17032 [details]
Build.xml output with Use Obfuscation ON
Comment 6 IntOne 2004-08-23 15:16:36 UTC
Created attachment 17033 [details]
Build.xml output with Use Obfuscation OFF
Comment 7 Adam Sotona 2004-08-23 16:48:32 UTC
Thanks, now it is clear.
Your "ImportedProject-Test\src" folder should contain the only sources
and resources that you want to include in application jar.
I see that your "ImportedProject-Test\src" contains even some classes
and other files.
These classes override the compiled ones during build process and
makes the preverification to fail.

So the reult is:

1. we should avoid to import classes and other possible problematic files

2. build process should filter classes and may be other possible
problematic files and do not treat them as resources

3. you can manually clean your "ImportedProject-Test\src" folder and
let there just sources and resources (no compiled classes, no
distribution jars, etc...)

Comment 8 IntOne 2004-08-23 17:56:48 UTC
Can you be more specific??? 

I went back thru the imports and there was only one that definitely 
wasn't required (java.lang.System)  Are you saying that I shouldn't 
wildcard them (as in java.io.*)?

With regards to other files in the project directories, all I 
imported in were the two java src files.  All other were placed there 
by nb 4.0.

Are you saying this is user error or bug?  If user, will this level 
of manual intervention always be required?
Comment 9 Tomas Brandalik 2004-08-24 08:49:16 UTC
This is not about imports in your source files, but about importing
source files to the project.
The problem is that Project created from existing sources copies
everything from your old place to the newly created project. Have look
at it with some file browser. You will see that src folder in newly
created project contains not only *.java files and that's the problem,
which preverifier cannot handle. You have to remove all *.class and
other unnecessary files from src folder.
Mobility has to be more careful when importing existing sources. 
Comment 10 Adam Sotona 2004-08-24 10:39:43 UTC
fixed, the fix will be available in a next release

following files are now filtered during copy from existing sources
when new project created:
  *.class
  *.addContent
  *.jad
  .nbattrs
  *~
  #*#
  .#*
  %*%
  ._*
  CVS/**
  .cvsignore
  SCCS/**
  vssver.scc
  .svn/**
  .DS_Store

following files are now filtered during copy from "src" to
"build/compiled" folder in build process:
  *.java
  *.form
  *.class
Comment 11 Lukas Hasik 2005-04-22 10:43:06 UTC
closing