2016-08-04 6 views
0

私は私が私の要求をlanchとき、私はこれが正面側で私のサービスである403WebサービスAngular2を使用して休息し、春

をエラーFET型のenum を持つ属性を持っている形式のJSONを持つオブジェクトをシードしたいです

export enum DocumentComponentType { 
    DIV_12, 
    DIV_4_4_4, 
    DIV_4_8, 
    DIV_8_4, 
    DIV_6_6, 
} 
export interface DocumentComponent { 
    id: number; 
    type: DocumentComponentType; 
    // documentContents: DocumentContent[]; 
} 

this.gridService.addDocumentComponent({id: 0, type: DocumentComponentType.DIV_8_4}, 6) 
        .subscribe(data => { 
          this.documentComponent = data; 
         }, 
         error => alert('Erreur ' + error), 
         () => { 
          console.log("finished "); 
         } 
        ); 

とサーバ側の

これは私のクラスである

public class DocumentComponent { 
    @Id 
    @GeneratedValue(strategy = GenerationType.IDENTITY) 
    private Long id; 
    DocumentComponentType type; 
    @OneToMany(mappedBy = "documentComponent") 
    private List<DocumentContent> documentContents; 
    @ManyToOne 
    Document document; 
    DocumentComponent(){ 

    } 
} 

と私の列挙

public enum DocumentComponentType { 
    DIV_12, 
    DIV_4_4_4, 
    DIV_4_8, 
    DIV_8_4, 
    DIV_6_6, 
} 

私はエラー500(内部サーバーエラー)を取得エラー500(内部サーバーエラー)

+0

サーバのログファイルを調べます。そこに例外の根本的な原因が表示されるはずです – Jens

+0

これはサーバでの私のエラーです NULLはNULL "NOT"制約に違反していますが、私はgeneratedValue –

答えて

0

を取得

これは、エラーが上があることを意味サーバー。あなたが掲示したコードはクライアント側のコードです。サーバー側のログ(およびまたは)で

修正

ルックはそこに何が起こっているかを確認するために、サーバーにデバッガをアタッチ。

もっと

https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#5xx_Server_Errorエラーは、本質的に予期しない何かがが起こったことを意味し、一般的なエラーメッセージです。

関連する問題