4

私はそれについて多くの情報を与えることができないので、この質問はばかげているように思えるかもしれませんが、問題はある種のバグでなければならないと思います...

NetBeans 7.1 で Java プログラムを作成しましたが、実行しようとするとこのエラーが発生します。10分前は完全に実行されていましたが、エラーが参照しているクラスに何も変更していません

これは何らかの NetBeans エラーでしょうか? 多分それはよく知られている問題ですか?

4

6 に答える 6

5

NB 7.2でもこの例外が発生しました

  • 「ビルドをクリーンアップ」して NB を再起動しても機能しませんでした
  • NB を最新の更新プログラムで更新し、「クリーン アンド ビルド」を実行しても機能しませんでした。

だから私はキャッシュディレクトリの名前を変更しました:

c:\Users\userabcd\AppData\Local\NetBeans\Cache\7.2\index\

NBを開始し、「バックグラウンドスキャン」が完了するのを待って、「プロジェクトのデバッグ」を押して出来上がり。キャッシュは時々壊れます:-/

于 2013-05-06T08:47:53.510 に答える
2

私もこの例外を受けました。私の解決策は次のとおりです。

  • 上記のクラスを編集して保存します (.java ファイル)
  • プロジェクトのクリーンアップとビルド
  • Tomcat サーバーにデプロイする
于 2013-02-20T12:17:30.127 に答える
1

JDK は ClassFormatError について次のように述べています。

Java 仮想マシンがクラス ファイルを読み込もうとして、ファイルの形式が正しくないか、クラス ファイルとして解釈できないと判断した場合にスローされます。

クラスファイルが壊れている可能性があります。標準の IT サポート ステートメントを実行します。NetBeans を再起動してみましたか?

それが役立つことを願っています

于 2012-05-25T15:33:23.267 に答える
0

Got right the same thing with Netbeans 7.1. Working on a project that works fine for several months. Now I changed a bean which gets persisted with javax.persistence and now this exception got thrown. Reverted my few changes, clean and compile the project, reboot the whole system: still exceptions. The curious thing about it: the generated .war works perfectly in a Tomcat at another machine.


UPDATE:

Today I got the same problem again and I couldn't recall how to solve it, but I found this post again. ;)

After a half hour I found the solution: Just change value of the property serialVersionUID, redeploy the app and then you can change the value to its original value and redeploy again -> working. Seems like Tomcat is holding that class somewhere deep inside – deleting working directories didn't led to success.

于 2012-07-10T11:25:55.180 に答える