반응형

Error: Unexpected value 'CodeTypeComponent' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@Component annotation


콤포넌트 내에서 다른 클래스 선언시 @Component 아래에다 클래스 선언시 오류난다.

@Component 정의 이전에 필요 클래스를 선언해야된다.



class Person {

  id: number;

  firstName: string;

  lastName: string;

}

@Component({

  selector: 'app-code-type',

  templateUrl: './code-type.component.html',

  styleUrls: ['./code-type.component.css']

})



위에 Person 클래스를 저렇게 @Component 위에 정의를 해야 동작된다.


반응형
반응형

ng build 나 serve 하면

기존 outDir 경로에 무언가를 하는것 같다. 

해당 폴더를 강제로 삭제해도 지워지지도 않고 

 operation not permitted 메세지만 줄기차게 나온다.

이것저것 해봤으나 안된다.

컴퓨터 재부팅후 폴더 삭제가 가능 했다.


EPERM: operation not permitted, lstat 'D:\workspace\sts\ar-cms-client\dist\assets\images\flags\16'

Error: EPERM: operation not permitted, lstat 'D:\workspace\sts\ar-cms-client\dist\assets\images\flags\16'

    at Object.fs.lstatSync (fs.js:961:11)

    at Object.lstatSync (D:\workspace\sts\ar-cms-client\node_modules\graceful-fs\polyfills.js:297:22)

    at rimrafSync (D:\workspace\sts\ar-cms-client\node_modules\fs-extra\lib\remove\rimraf.js:237:18)

    at options.readdirSync.forEach.f (D:\workspace\sts\ar-cms-client\node_modules\fs-extra\lib\remove\rimraf.js:291:39)

    at Array.forEach (<anonymous>)

    at rmkidsSync (D:\workspace\sts\ar-cms-client\node_modules\fs-extra\lib\remove\rimraf.js:291:26)

    at rmdirSync (D:\workspace\sts\ar-cms-client\node_modules\fs-extra\lib\remove\rimraf.js:281:7)

    at fixWinEPERMSync (D:\workspace\sts\ar-cms-client\node_modules\fs-extra\lib\remove\rimraf.js:167:5)

    at rimrafSync (D:\workspace\sts\ar-cms-client\node_modules\fs-extra\lib\remove\rimraf.js:260:26)

    at options.readdirSync.forEach.f (D:\workspace\sts\ar-cms-client\node_modules\fs-extra\lib\remove\rimraf.js:291:39)

    at Array.forEach (<anonymous>)

    at rmkidsSync (D:\workspace\sts\ar-cms-client\node_modules\fs-extra\lib\remove\rimraf.js:291:26)

    at rmdirSync (D:\workspace\sts\ar-cms-client\node_modules\fs-extra\lib\remove\rimraf.js:281:7)

    at fixWinEPERMSync (D:\workspace\sts\ar-cms-client\node_modules\fs-extra\lib\remove\rimraf.js:167:5)

    at rimrafSync (D:\workspace\sts\ar-cms-client\node_modules\fs-extra\lib\remove\rimraf.js:260:26)

    at options.readdirSync.forEach.f (D:\workspace\sts\ar-cms-client\node_modules\fs-extra\lib\remove\rimraf.js:291:39)

반응형
반응형

테스트코드 Junit 실행시 예외다.

말그대로 쿼리 실행할수 없는 문장이라고 한다.

아래 regist_dt 가 Not null 인데 널값을 Insert 할려고 하니 오류다.

값을 채워서 실행 했다.


javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement

at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:149)

at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:157)

at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:164)

at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1443)

at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1423)

at org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager.flush(TestEntityManager.java:172)

at org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager.persistAndFlush(TestEntityManager.java:132)

at org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager.persistFlushFind(TestEntityManager.java:112)

at com.jejunet.ar.repositories.CodeTypeRepositoryTest.getCodeType_returnCodeTypeDetails(CodeTypeRepositoryTest.java:31)

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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)

at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)

at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)

at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:73)

at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:83)

at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)

at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)

at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)

at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)

at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)

at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)

at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)

at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)

at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)

at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)

at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)

at org.junit.runners.ParentRunner.run(ParentRunner.java:363)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)

at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)

Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement

at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:59)

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

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

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

at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:178)

at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3032)

at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3547)

at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:89)

at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:600)

at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:474)

at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:337)

at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39)

at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1437)

... 36 more

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'regist_dt' cannot be null

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)

at com.mysql.jdbc.Util.getInstance(Util.java:408)

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3976)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3912)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)

at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486)

at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)

at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079)

at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013)

at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104)

at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998)

at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)

at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)

at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:175)

... 44 more



반응형

+ Recent posts