プロジェクト用に JAX-RPC を使用して Web サービスを作成する必要がありerror: invalid type for JAX-RPC structure: jspf.common.ForumPost
、それをコンパイルしようとするとエラーが発生します。JDK 5 と J2EE 1.4 を使用する必要があります。JAX-RPC プラグインと Glassfish v1 サポート プラグインを備えた Netbeans 7.0 を使用して、Application Server PE 9 をコンテナーとして使用しています。
これは私のクラスです:
package jspf.common;
import java.sql.Date;
public class ForumPost extends java.lang.Object implements java.io.Serializable {
private String poster;
private String content;
private int topic_id;
private int post_id;
private Date time;
/**
* Creates a new ForumPost object.
* @param poster The username of the user that posted the post.
* @param content The body/content of the post.
* @param topic_id The topic ID that this post replies to.
* @param post_id This post's ID.
*/
public ForumPost() {
}
public ForumPost(int post_id, int topic_id, String poster, String content, Date time) {
this.poster = poster;
this.content = content;
this.topic_id = topic_id;
this.post_id = post_id;
this.time = time;
}
public Date getTime() {
return time;
}
public String getContent() {
return content;
}
public int getPost_id() {
return post_id;
}
public String getPoster() {
return poster;
}
public int getTopic_id() {
return topic_id;
}
}
はい、残念ながらこの古い技術を使用する必要があります。
私は別のクラスで同様の問題を抱えていましたが、ArrayList
その中にあった を削除することで修正されたように見えましたが、実際にはそれが必要ですArrayList
。
このエラーが発生するのはなぜですか?
編集:次のように、java.sql.Date へのすべての参照を削除しました。
package jspf.common;
public class ForumPost extends java.lang.Object implements java.io.Serializable {
private String poster;
private String content;
private int topic_id;
private int post_id;
private long time;
/**
* Creates a new ForumPost object.
* @param poster The username of the user that posted the post.
* @param content The body/content of the post.
* @param topic_id The topic ID that this post replies to.
* @param post_id This post's ID.
*/
public ForumPost() {
}
public ForumPost(int post_id, int topic_id, String poster, String content, long time) {
this.poster = poster;
this.content = content;
this.topic_id = topic_id;
this.post_id = post_id;
this.time = time;
}
public long getTime() {
return time;
}
public String getContent() {
return content;
}
public int getPost_id() {
return post_id;
}
public String getPoster() {
return poster;
}
public int getTopic_id() {
return topic_id;
}
}
そして、私はまだ同じエラーが発生します。何が問題なのかわかりません。