Quantcast
Channel: SCN : Popular Discussions - SAP HANA Cloud Platform Developer Center
Viewing all articles
Browse latest Browse all 1318

How to start with Java agent to use InstrumentationLoadTimeWeaver (Spring + JPA)

$
0
0

I tried a testing project using springframework.

When I launch the project via Tomcat 7.0 Server, it show the errors as below:

____________________________________________________________________________________________________________________________

[RAM] 2013-01-10 10:50:39,488 ERROR [org.springframework.web.context.ContextLoader]:Context initialization failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [file:/C:/Users/i073799/workspace/Servers/Local Test Server for SAP NetWeaver Cloud-config/webapps/ReportAnalytics-App-Web/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.reflect.UndeclaredThrowableException

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1486)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)

........................................................................

........................................................................

........................................................................

... 86 more

Caused by: java.lang.reflect.InvocationTargetException

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.orm.jpa.persistenceunit.DefaultPersistenceUnitManager$Jpa2PersistenceUnitInfoDecorator.invoke(DefaultPersistenceUnitManager.java:617)

... 94 more

Caused by: java.lang.IllegalStateException: Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation.

at org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver.addTransformer(InstrumentationLoadTimeWeaver.java:87)

at org.springframework.orm.jpa.persistenceunit.SpringPersistenceUnitInfo.addTransformer(SpringPersistenceUnitInfo.java:111)

... 99 more

___________________________________________________________________________________________________________________________I

 

Then I set the VN argument "-javaagent:c:\temp\spring-instrument-3.2.0.RELEASE.jar"
The setting is as below:

 

20130110110319.jpg

after that, the project can be launched well on tomcat 7 now.

 

But when I use NW cloud server to launch the project, it will still occor same errors as above, no matter whether set VM arguments as below or not:

 

20130110111350.jpg


Viewing all articles
Browse latest Browse all 1318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>