Posts

Showing posts with the label java-ee

Java ee api rest error: java.lang.IllegalArgumentException

Image
Clash Royale CLAN TAG #URR8PPP Java ee api rest error: java.lang.IllegalArgumentException I'm creating a api rest with Tomcat 7.0 + Maven + Java EE + JDK 10.0.2 in eclipse and I got this error: Error: HTTP Status 500 - Servlet.init() for servlet api threw exception type Exception report message Servlet.init() for servlet api threw exception description The server encountered an internal error that prevented it from fulfilling this request. exception javax.servlet.ServletException: Servlet.init() for servlet api threw exception org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) org.apache.coyote.AbstractP...

Why @Embeddable and @Embedded provided by Hibernate

Image
Clash Royale CLAN TAG #URR8PPP Why @Embeddable and @Embedded provided by Hibernate Have Entity objects properly defined. Able to save data successfully. @Embeddable public class Address { private Integer houseNo; private String streetName; private String state, country; } @Entity public class College { @Id @GeneratedValue private Integer collegeId; private String cName; @Embedded Address address; } But, When I use @Embeddable and @Embedded in hibernate application the final result looks like below. mysql> select * from college; +-----------+---------+---------+----------+--------------+-------+ | collegeId | country | houseNo | state | streetName | cName | +-----------+---------+---------+----------+--------------+-------+ | 1 | Makkah | 121 | Al-Azeed | Bilaal Stree | SMust | +-----------+---------+---------+----------+--------------+-------+ My doubt is if Address fields have been saved in same table why we are using @Embeddabl...