0

A Spring web application is required to be monitor with newrelic. spring-agent is being load as loadTimeWeaver , spring agent uses for jpa load enhane and custom config ,when spring-agent and newrelic configure to load with java_opts, when application deploying it throws an exception for loading jpa...

org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [spring-config.xml]: Invocation of init method failed; nested exception is java.lang.IllegalAccessError: class sun.reflect.GeneratedConstructorAccessor9 cannot access its superclass sun.reflect.ConstructorAccessorImpl Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [spring-config.xml]: Invocation of init method failed; nested exception is java.lang.IllegalAccessError: class sun.reflect.GeneratedConstructorAccessor9 cannot access its superclass sun.reflect.ConstructorAccessorImpl Caused by: java.lang.IllegalAccessError: class sun.reflect.GeneratedConstructorAccessor9 cannot access its superclass sun.reflect.ConstructorAccessorImpl at sun.misc.Unsafe.defineClass(Native Method)

how can i configure to load spring agent and newrelic(monitoring for web application performance management) without conflicts each other ?

Rupesh Yadav
  • 12,096
  • 4
  • 53
  • 70
andare
  • 21
  • 6
  • I have no Idea how newrelic works, but it looks like you can not sublcass the entityManagerFactory (needed by your AOP Strategy) To get in running, first try to exclude entityManagerFactory from monitoring – Ralph Dec 05 '11 at 18:20

1 Answers1

0

One possible way to get spring agent loading

andare
  • 21
  • 6