Javafree
Página Inicial do Fórum > Java Básico

ERRO @MANYTOONE - "Column 'USUARIO_CPF' cannot be null"



Criar novo tópico   Responder tópico


  1. mayque
    Posts:1


    Comment Arrow

    Publicado em: 19/09/2016 10:00:22

    Bom dia,

    Estou com o seguinte problema ao tentar utilizar a anotação @ManyToOne em meu projeto, em diversas fonte estudadas, utilizei os exemplos base, porém, em meu projeto ele acusa como se estivesse NULL.
    Segue as classes para análise:

    ERRO DO CONSOLE:

    [set 19, 2016 9:29:40 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    ADVERTÊNCIA: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:projetoCalc-me' did not find a matching property.
    set 19, 2016 9:29:40 AM org.apache.catalina.startup.VersionLoggerListener log
    INFORMAÇÕES: Server version: Apache Tomcat/9.0.0.M9
    set 19, 2016 9:29:40 AM org.apache.catalina.startup.VersionLoggerListener log
    INFORMAÇÕES: Server built: Jul 4 2016 18:22:47 UTC
    set 19, 2016 9:29:40 AM org.apache.catalina.startup.VersionLoggerListener log
    INFORMAÇÕES: Server number: 9.0.0.0
    set 19, 2016 9:29:40 AM org.apache.catalina.startup.VersionLoggerListener log
    INFORMAÇÕES: OS Name: Windows 10
    set 19, 2016 9:29:40 AM org.apache.catalina.startup.VersionLoggerListener log
    INFORMAÇÕES: OS Version: 10.0
    set 19, 2016 9:29:40 AM org.apache.catalina.startup.VersionLoggerListener log
    INFORMAÇÕES: Architecture: amd64
    set 19, 2016 9:29:40 AM org.apache.catalina.startup.VersionLoggerListener log
    INFORMAÇÕES: Java Home: C:\Program Files\Java\jre1.8.0_101
    set 19, 2016 9:29:40 AM org.apache.catalina.startup.VersionLoggerListener log
    INFORMAÇÕES: JVM Version: 1.8.0_101-b13
    set 19, 2016 9:29:40 AM org.apache.catalina.startup.VersionLoggerListener log
    INFORMAÇÕES: JVM Vendor: Oracle Corporation
    set 19, 2016 9:29:40 AM org.apache.catalina.startup.VersionLoggerListener log
    INFORMAÇÕES: CATALINA_BASE: C:\Users\Mayque.silva\workspace\MayqueWorkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
    set 19, 2016 9:29:40 AM org.apache.catalina.startup.VersionLoggerListener log
    INFORMAÇÕES: CATALINA_HOME: C:\Program Files\Apache Software Foundation\Tomcat 9.0
    set 19, 2016 9:29:40 AM org.apache.catalina.startup.VersionLoggerListener log
    INFORMAÇÕES: Command line argument: -Dcatalina.base=C:\Users\Mayque.silva\workspace\MayqueWorkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
    set 19, 2016 9:29:40 AM org.apache.catalina.startup.VersionLoggerListener log
    INFORMAÇÕES: Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 9.0
    set 19, 2016 9:29:40 AM org.apache.catalina.startup.VersionLoggerListener log
    INFORMAÇÕES: Command line argument: -Dwtp.deploy=C:\Users\Mayque.silva\workspace\MayqueWorkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
    set 19, 2016 9:29:40 AM org.apache.catalina.startup.VersionLoggerListener log
    INFORMAÇÕES: Command line argument: -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 9.0\endorsed
    set 19, 2016 9:29:40 AM org.apache.catalina.startup.VersionLoggerListener log
    INFORMAÇÕES: Command line argument: -Dfile.encoding=Cp1252
    set 19, 2016 9:29:40 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
    INFORMAÇÕES: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_101\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_101/bin/server;C:/Program Files/Java/jre1.8.0_101/bin;C:/Program Files/Java/jre1.8.0_101/lib/amd64;C:\Program Files\Java\jdk1.8.0_101\bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\Doctrine extensions for PHP\;C:\Users\Mayque.silva\AppData\Local\Microsoft\WindowsApps;;C:\Users\Mayque.silva\Desktop;;.
    set 19, 2016 9:29:40 AM org.apache.coyote.AbstractProtocol init
    INFORMAÇÕES: Initializing ProtocolHandler ["http-nio-8080"]
    set 19, 2016 9:29:40 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
    INFORMAÇÕES: Using a shared selector for servlet write/read
    set 19, 2016 9:29:40 AM org.apache.coyote.AbstractProtocol init
    INFORMAÇÕES: Initializing ProtocolHandler ["ajp-nio-8009"]
    set 19, 2016 9:29:40 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
    INFORMAÇÕES: Using a shared selector for servlet write/read
    set 19, 2016 9:29:40 AM org.apache.catalina.startup.Catalina load
    INFORMAÇÕES: Initialization processed in 847 ms
    set 19, 2016 9:29:40 AM org.apache.catalina.core.StandardService startInternal
    INFORMAÇÕES: Starting service Catalina
    set 19, 2016 9:29:40 AM org.apache.catalina.core.StandardEngine startInternal
    INFORMAÇÕES: Starting Servlet Engine: Apache Tomcat/9.0.0.M9
    set 19, 2016 9:29:44 AM org.apache.jasper.servlet.TldScanner scanJars
    INFORMAÇÕES: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
    set 19, 2016 9:29:44 AM com.sun.faces.config.ConfigureListener contextInitialized
    INFORMAÇÕES: Inicializando Mojarra 2.2.8 ( 20140814-1418 https://svn.java.net/svn/mojarra~svn/tags/2.2.8@13507) para o contexto '/projetoCalc-me'
    set 19, 2016 9:29:44 AM com.sun.faces.spi.InjectionProviderFactory createInstance
    INFORMAÇÕES: JSF1048: Anotações PostConstruct/PreDestroy presentes. Os métodos ManagedBeans marcados com essas anotações informarão as anotações processadas.
    set 19, 2016 9:29:45 AM org.primefaces.webapp.PostConstructApplicationEventListener processEvent
    INFORMAÇÕES: Running on PrimeFaces 6.0
    set 19, 2016 9:29:45 AM com.sun.faces.config.ConfigureListener contextInitialized
    INFORMAÇÕES: Inicializando Mojarra 2.2.8 ( 20140814-1418 https://svn.java.net/svn/mojarra~svn/tags/2.2.8@13507) para o contexto '/projetoCalc-me'
    set 19, 2016 9:29:45 AM com.sun.faces.spi.InjectionProviderFactory createInstance
    INFORMAÇÕES: JSF1048: Anotações PostConstruct/PreDestroy presentes. Os métodos ManagedBeans marcados com essas anotações informarão as anotações processadas.
    set 19, 2016 9:29:46 AM com.sun.faces.mgbean.BeanManager addBean
    ADVERTÊNCIA: JSF1074: O bean gerenciado denominado 'rendaBean' já foi registrado. Substituindo o tipo de classe do bean gerenciado control.RendaBean por control.RendaBean.
    set 19, 2016 9:29:46 AM com.sun.faces.mgbean.BeanManager addBean
    ADVERTÊNCIA: JSF1074: O bean gerenciado denominado 'usuarioBean' já foi registrado. Substituindo o tipo de classe do bean gerenciado control.UsuarioBean por control.UsuarioBean.
    set 19, 2016 9:29:46 AM com.sun.faces.mgbean.BeanManager addBean
    ADVERTÊNCIA: JSF1074: O bean gerenciado denominado 'despesaBean' já foi registrado. Substituindo o tipo de classe do bean gerenciado control.DespesaBean por control.DespesaBean.
    set 19, 2016 9:29:46 AM org.primefaces.webapp.PostConstructApplicationEventListener processEvent
    INFORMAÇÕES: Running on PrimeFaces 6.0
    set 19, 2016 9:29:46 AM org.primefaces.webapp.PostConstructApplicationEventListener processEvent
    INFORMAÇÕES: Running on PrimeFaces 6.0
    set 19, 2016 9:29:46 AM org.apache.coyote.AbstractProtocol start
    INFORMAÇÕES: Starting ProtocolHandler [http-nio-8080]
    set 19, 2016 9:29:46 AM org.apache.coyote.AbstractProtocol start
    INFORMAÇÕES: Starting ProtocolHandler [ajp-nio-8009]
    set 19, 2016 9:29:46 AM org.apache.catalina.startup.Catalina start
    INFORMAÇÕES: Server startup in 5958 ms
    set 19, 2016 9:29:47 AM org.apache.catalina.core.StandardWrapperValve invoke
    GRAVE: Servlet.service() for servlet [Faces Servlet] in context with path [/projetoCalc-me] threw exception [javax/servlet/jsp/jstl/core/Config] with root cause
    java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1274)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:110
    at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:344)
    at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:153)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:10
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)

    [EL Info]: 2016-09-19 09:29:58.393--ServerSession(212885370)--EclipseLink, version: Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd
    Mon Sep 19 09:29:58 BRT 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    Mon Sep 19 09:29:58 BRT 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    [EL Info]: connection: 2016-09-19 09:29:58.879--ServerSession(212885370)--file:/C:/Users/Mayque.silva/workspace/MayqueWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/projetoCalc-me/WEB-INF/classes/_calcPU login successful
    [EL Warning]: 2016-09-19 09:29:59.051--UnitOfWork(1489335654)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'USUARIO_CPF' cannot be null
    Error Code: 1048
    Call: INSERT INTO RENDA (CATEGORIA, DATARENDA, VALOR, USUARIO_CPF) VALUES (?, ?, ?, ?)
    bind => [4 parameters bound]
    Query: InsertObjectQuery(model.Renda@32f70e93)
    javax.persistence.RollbackException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'USUARIO_CPF' cannot be null
    Error Code: 1048
    Call: INSERT INTO RENDA (CATEGORIA, DATARENDA, VALOR, USUARIO_CPF) VALUES (?, ?, ?, ?)
    bind => [4 parameters bound]
    Query: InsertObjectQuery(model.Renda@32f70e93)
    at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:157)
    at dao.RendaDAO.SalvarRenda(RendaDAO.java:31)
    at control.RendaBean.SalvaRenda(RendaBean.java:32)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.el.parser.AstValue.invoke(AstValue.java:247)
    at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:267)
    at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
    at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
    at javax.faces.component.UICommand.broadcast(UICommand.java:315)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:19
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:10
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)
    Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'USUARIO_CPF' cannot be null
    Error Code: 1048
    Call: INSERT INTO RENDA (CATEGORIA, DATARENDA, VALOR, USUARIO_CPF) VALUES (?, ?, ?, ?)
    bind => [4 parameters bound]
    Query: InsertObjectQuery(model.Renda@32f70e93)
    at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:331)
    at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:900)
    at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:962)
    at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:631)
    at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:55
    at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:2002)
    at org.eclipse.persistence.sessions.server.ClientSession.executeCall(ClientSession.java:29
    at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:242)
    at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:22
    at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:377)
    at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:165)
    at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:180)
    at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:489)
    at org.eclipse.persistence.queries.InsertObjectQuery.executeCommit(InsertObjectQuery.java:80)
    at org.eclipse.persistence.queries.InsertObjectQuery.executeCommitWithChangeSet(InsertObjectQuery.java:90)
    at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:301)
    at org.eclipse.persistence.queries.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:5
    at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:899)
    at org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:79
    at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:10
    at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:85)
    at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896)
    at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1804)
    at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1786)
    at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1737)
    at org.eclipse.persistence.internal.sessions.CommitManager.commitNewObjectsForClassWithChangeSet(CommitManager.java:226)
    at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:125)
    at org.eclipse.persistence.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:4207)
    at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1441)
    at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1531)
    at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:277)
    at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1169)
    at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:132)
    ... 40 more
    Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'USUARIO_CPF' cannot be null
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
    at com.mysql.jdbc.Util.getInstance(Util.java:387)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:934)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3966)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2526)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2673)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
    at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2073)
    at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2009)
    at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:509
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1994)
    at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:890)
    ... 71 more
    set 19, 2016 9:29:59 AM org.apache.catalina.core.StandardWrapperValve invoke
    GRAVE: Servlet.service() for servlet [Faces Servlet] in context with path [/projetoCalc-me] threw exception [javax/servlet/jsp/jstl/core/Config] with root cause
    java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
    at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:344)
    at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:153)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:10
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)

    [EL Info]: connection: 2016-09-19 09:31:05.408--ServerSession(212885370)--file:/C:/Users/Mayque.silva/workspace/MayqueWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/projetoCalc-me/WEB-INF/classes/_calcPU logout successful
    ]



    CLASSE RENDA.JAVA



    package model;

    import java.util.Date;

    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.JoinColumn;
    import javax.persistence.ManyToOne;
    import javax.persistence.Temporal;
    import javax.persistence.TemporalType;

    @Entity
    public class Renda {

    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE)
    private int idrenda;
    private double valor;
    private String categoria;
    @Temporal(value=TemporalType.DATE)
    private Date dataRenda;
    private Usuario usuario;

    public int getIdRenda() {
    return idrenda;
    }
    public void setIdRenda(int id) {
    this.idrenda = id;
    }
    public double getValor() {
    return valor;
    }
    public int getIdrenda() {
    return idrenda;
    }
    public void setIdrenda(int idrenda) {
    this.idrenda = idrenda;
    }
    @ManyToOne
    public Usuario getUsuario() {
    return usuario;
    }
    public void setUsuario(Usuario usuario) {
    this.usuario = usuario;
    }
    public void setValor(double valor) {
    this.valor = valor;
    }
    public String getCategoria() {
    return categoria;
    }
    public void setCategoria(String categoria) {
    this.categoria = categoria;
    }

    public Date getDataRenda() {
    return dataRenda;
    }
    public void setDataRenda(Date dataRenda) {
    this.dataRenda = dataRenda;
    }
    }[/code]

    CLASSE USUARIO.JAVA

    package model;

    import java.util.List;

    import javax.persistence.Entity;
    import javax.persistence.FetchType;
    import javax.persistence.Id;
    import javax.persistence.OneToMany;
    import javax.persistence.Table;

    import model.Usuario;

    @Entity
    @Table(name="usuario"
    public class Usuario {

    private String nome;
    @Id
    private String cpf;
    private String telefone;
    private String email;
    private String senha;


    public String getNome() {
    return nome;
    }
    public void setNome(String nome) {
    this.nome = nome;
    }

    public String getCpf() {
    return cpf;
    }

    public void setCpf(String cpf) {
    this.cpf = cpf;
    }
    public String getTelefone() {
    return telefone;
    }
    public void setTelefone(String telefone) {
    this.telefone = telefone;
    }
    public String getEmail() {
    return email;
    }
    public void setEmail(String email) {
    this.email = email;
    }
    public String getSenha() {
    return senha;
    }
    public void setSenha(String senha) {
    this.senha = senha;
    }
    }

    [/code]
    _________________

    Mayque Souza.



  1. Relacionados