해석javax에 관하여.persistence.Table 오류 보고

3985 단어 table
오늘 해석javax를 썼습니다.persistence.Table 방법
/**
	 *  anno Mapping 
	 * @param clazz  
	 * @return
	 * @throws Exception
	 */
	public static String getTableName(Class<?> clazz) throws Exception {  
        if (clazz.isAnnotationPresent(Table.class)) {  
        	Table table = clazz.getAnnotation(Table.class);  
            return table.name();
        } else {  
            throw new Exception(clazz.getName() + " is not Entity Annotation.");  
        }  
    }

토마토캣을 시작할 때 오류를 보고했습니다.
java.lang.ClassNotFoundException: javax.persistence.Table
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
	at com.faj.util.XSAnnoDeal.getTableName(XSAnnoDeal.java:23)
	at com.faj.util.SqlCreater.<init>(SqlCreater.java:25)
	at com.sucsoft.springmvc.dao.impl.BaseDaoImpl.createSQLAndExcute(BaseDaoImpl.java:31)
	at com.sucsoft.springmvc.dao.impl.BaseDaoImpl.add(BaseDaoImpl.java:39)
	at com.sucsoft.springmvc.service.impl.UserService.createUser(UserService.java:19)
	at com.sucsoft.springmvc.controller.UserController.add(UserController.java:76)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
	at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440)
	at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:920)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:816)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:619)

밤새 찾았더니 드디어 답을 찾았다.
위 링크:http://www.blogjava.net/jvict/articles/225646.html
왜냐하면tomcat에javaee-api-5.0-1이 없어요.jar 이jar 가방, 저는 javaee 5.0을 사용합니다.

좋은 웹페이지 즐겨찾기