Ini lagi satu error yang membuatkan Tedi stuck tiga hari tiga malam. 

ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - invalid column name 'companyMain'

Padahal property companyMain tu dah memang ada dalam CmsUser tu dan mapping-nya semua betul.

Fikir punya fikir dan selepas solat hajat, tiba-tiba didatangkan ilham untuk rever satu class yang lain yang juga property foreign key dalam CmsUser, nama class tu StaffMain.

Tedi check dalam tu memang ada companyMain juga, maka Tedi pun segera menghapuskannya.

Selepas run apps, memang benarlah, itulah puncanya. Benda kecil yang menjadi besar.... huhuhu...

Inilah masalahnya berkongsi kod dengan orang lain tapi tidak berada di tempat sama. Masalahnya mereka okay sahaja jadi environment dalam local machine Tedi sahajalah yang tak okay.

how to set up my sql / jdbc on ubuntu

 


Mar 18, 2018 7:29:37 AM org.apache.tomcat.util.digester.SetPropertiesRule begin

WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SystemNameStaging' did not find a matching property.

Mar 18, 2018 7:29:37 AM org.apache.catalina.startup.VersionLoggerListener log

INFO: Server version:        Apache Tomcat/8.5.24

Mar 18, 2018 7:29:37 AM org.apache.catalina.startup.VersionLoggerListener log

INFO: Server built:          Nov 27 2017 13:05:30 UTC

Mar 18, 2018 7:29:37 AM org.apache.catalina.startup.VersionLoggerListener log

INFO: Server number:         8.5.24.0

Mar 18, 2018 7:29:37 AM org.apache.catalina.startup.VersionLoggerListener log

INFO: OS Name:               Windows 10

Mar 18, 2018 7:29:37 AM org.apache.catalina.startup.VersionLoggerListener log

INFO: OS Version:            10.0

Mar 18, 2018 7:29:37 AM org.apache.catalina.startup.VersionLoggerListener log

INFO: Architecture:          amd64

Mar 18, 2018 7:29:37 AM org.apache.catalina.startup.VersionLoggerListener log

INFO: Java Home:             C:\Program Files\Java\jdk1.8.0_162\jre

Mar 18, 2018 7:29:37 AM org.apache.catalina.startup.VersionLoggerListener log

INFO: JVM Version:           1.8.0_162-b12

Mar 18, 2018 7:29:37 AM org.apache.catalina.startup.VersionLoggerListener log

INFO: JVM Vendor:            Oracle Corporation

Mar 18, 2018 7:29:37 AM org.apache.catalina.startup.VersionLoggerListener log

INFO: CATALINA_BASE:         F:\sts-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0

Mar 18, 2018 7:29:37 AM org.apache.catalina.startup.VersionLoggerListener log

INFO: CATALINA_HOME:         C:\apache-tomcat-8.5.24

Mar 18, 2018 7:29:37 AM org.apache.catalina.startup.VersionLoggerListener log

INFO: Command line argument: -Dcatalina.base=F:\sts-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0

Mar 18, 2018 7:29:37 AM org.apache.catalina.startup.VersionLoggerListener log

INFO: Command line argument: -Dcatalina.home=C:\apache-tomcat-8.5.24

Mar 18, 2018 7:29:37 AM org.apache.catalina.startup.VersionLoggerListener log

INFO: Command line argument: -Dwtp.deploy=F:\sts-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps

Mar 18, 2018 7:29:37 AM org.apache.catalina.startup.VersionLoggerListener log

INFO: Command line argument: -Djava.endorsed.dirs=C:\apache-tomcat-8.5.24\endorsed

Mar 18, 2018 7:29:37 AM org.apache.catalina.startup.VersionLoggerListener log

INFO: Command line argument: -Dfile.encoding=Cp1252

Mar 18, 2018 7:29:37 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent

INFO: 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\jdk1.8.0_162\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jdk1.8.0_162/bin/../jre/bin/server;C:/Program Files/Java/jdk1.8.0_162/bin/../jre/bin;C:/Program Files/Java/jdk1.8.0_162/bin/../jre/lib/amd64;C:\Program Files\Java\jdk1.8.0_162\bin;C:\apache-tomcat-8.5.24\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Git\cmd;C:\Gradle\gradle-4.5.1\bin;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files\SlikSvn\bin;C:\Program Files\PuTTY\;C:\Users\MYCOMPUTER\AppData\Local\Microsoft\WindowsApps;;C:\sts-3.9.2.RELEASE;;.]

Mar 18, 2018 7:29:37 AM org.apache.coyote.AbstractProtocol init

INFO: Initializing ProtocolHandler ["http-nio-8888"]

Mar 18, 2018 7:29:37 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector

INFO: Using a shared selector for servlet write/read

Mar 18, 2018 7:29:37 AM org.apache.coyote.AbstractProtocol init

INFO: Initializing ProtocolHandler ["ajp-nio-8009"]

Mar 18, 2018 7:29:37 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector

INFO: Using a shared selector for servlet write/read

Mar 18, 2018 7:29:37 AM org.apache.catalina.startup.Catalina load

INFO: Initialization processed in 643 ms

Mar 18, 2018 7:29:37 AM org.apache.catalina.core.StandardService startInternal

INFO: Starting service [Catalina]

Mar 18, 2018 7:29:37 AM org.apache.catalina.core.StandardEngine startInternal

INFO: Starting Servlet Engine: Apache Tomcat/8.5.24

Mar 18, 2018 7:29:39 AM org.apache.jasper.servlet.TldScanner scanJars

INFO: 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.

Mar 18, 2018 7:29:44 AM org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory getObjectInstance

WARNING: Name = vurfin_dev Property maxActive is not used in DBCP2, use maxTotal instead. maxTotal default value is 8. You have set value of "20" for "maxActive" property, which is being ignored.

Mar 18, 2018 7:29:44 AM org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory getObjectInstance

WARNING: Name = vurfin_dev Property maxWait is not used in DBCP2 , use maxWaitMillis instead. maxWaitMillis default value is -1. You have set value of "-1" for "maxWait" property, which is being ignored.

Mar 18, 2018 7:29:45 AM org.apache.jasper.servlet.TldScanner scanJars

INFO: 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.

Mar 18, 2018 7:29:45 AM org.apache.catalina.core.ApplicationContext log

INFO: No Spring WebApplicationInitializer types detected on classpath

Mar 18, 2018 7:29:45 AM org.apache.catalina.core.ApplicationContext log

INFO: Initializing Spring root WebApplicationContext

Mar 18, 2018 7:30:02 AM org.apache.catalina.core.ApplicationContext log

INFO: Initializing Spring FrameworkServlet 'SystemName'

Mar 18, 2018 7:30:06 AM org.apache.coyote.AbstractProtocol start

INFO: Starting ProtocolHandler ["http-nio-8888"]

Mar 18, 2018 7:30:06 AM org.apache.coyote.AbstractProtocol start

INFO: Starting ProtocolHandler ["ajp-nio-8009"]

Mar 18, 2018 7:30:06 AM org.apache.catalina.startup.Catalina start

INFO: Server startup in 28245 ms

2018-03-18 07:30:20,653 [http-nio-8888-exec-4] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Invalid column name 'companyMain'.

Mar 18, 2018 7:30:20 AM org.apache.catalina.core.StandardWrapperValve invoke

SEVERE: Servlet.service() for servlet [SystemName] in context with path [/SystemName] threw exception

org.springframework.orm.jpa.JpaSystemException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet

at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:418)

at org.springframework.orm.jpa.aspectj.JpaExceptionTranslatorAspect.ajc$afterThrowing$org_springframework_orm_jpa_aspectj_JpaExceptionTranslatorAspect$1$18a1ac9(JpaExceptionTranslatorAspect.aj:37)

at my.appzz.admin.domain.security.CmsUser.findUserByUsernameAndCompany_aroundBody18(CmsUser.java:329)

at my.appzz.admin.domain.security.CmsUser.findUserByUsernameAndCompany(CmsUser.java:1)

at my.appzz.admin.security.IMSAuthProvider.authenticate(IMSAuthProvider.java:43)

at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:156)

at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:177)

at org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.attemptAuthentication(UsernamePasswordAuthenticationFilter.java:92)

at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:211)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)

at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)

at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)

at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)

at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)

at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:748)

Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet

at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692)

at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602)

at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:492)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:372)

at com.sun.proxy.$Proxy103.getResultList(Unknown Source)

... 46 more

Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet

at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:106)

at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)

at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109)

at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:95)

at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:79)

at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.getResultSet(AbstractLoadPlanBasedLoader.java:434)

at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeQueryStatement(AbstractLoadPlanBasedLoader.java:186)

at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:121)

at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:86)

at org.hibernate.loader.entity.plan.AbstractLoadPlanBasedEntityLoader.load(AbstractLoadPlanBasedEntityLoader.java:167)

at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:4019)

at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:508)

at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:478)

at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:219)

at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:278)

at org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:121)

at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:89)

at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1129)

at org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:1022)

at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:639)

at org.hibernate.type.EntityType.resolve(EntityType.java:431)

at org.hibernate.engine.internal.TwoPhaseLoad.doInitializeEntity(TwoPhaseLoad.java:154)

at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:128)

at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:1133)

at org.hibernate.loader.Loader.processResultSet(Loader.java:992)

at org.hibernate.loader.Loader.doQuery(Loader.java:930)

at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336)

at org.hibernate.loader.Loader.doList(Loader.java:2617)

at org.hibernate.loader.Loader.doList(Loader.java:2600)

at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2429)

at org.hibernate.loader.Loader.list(Loader.java:2424)

at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:501)

at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:371)

at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216)

at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1326)

at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87)

at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606)

at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:483)

... 52 more

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name 'companyMain'.

at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:232)

at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1672)

at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:460)

at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:405)

at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7535)

at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2438)

at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:208)

at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:183)

at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:317)

at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)

at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)

at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70)

... 85 more

20180318