0

When I try to start my alfresco-extension jetty server, I get below exception: 2014-01-05 18:00:59.754:WARN::Nested in org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.sample.san.prototype.service.JsonPostServiceImpl] for bean with name 'jsonPostServiceImplService' defined in class path resource [alfresco/module/alfresco-extensions/context/san-services-context.xml]: problem with class file or dependent class; nested exception is

Caused by: java.lang.ClassFormatError: Incompatible magic value 4022320623 in class file com/sample/san/prototype/service/JsonPostServiceImpl
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
Sanjay Tank
  • 103
  • 9
  • 2
    The magic value given from that is `0xEFBFBDEF`. Java requires a magic value of `0xCAFEBABE` for it's class files. Most likely a corrupt file? – Obicere Jan 05 '14 at 22:37
  • 1
    Java class files begin with the hexadecimal value `CAFEBABE` as a magic number that helps indicate whether the loaded class file is actually a Java class file. In this case, you're getting an error because that magic number is wrong. Can you show us the code you're using to try to load the class? – templatetypedef Jan 05 '14 at 22:37
  • 2
    You have a `.class` file somewhere that isn't _actually_ a `.class` file. – Robin Green Jan 05 '14 at 22:40
  • Here is Answer: I was able to solve this error after some debugging. The problem was spring frame work was NOT able to initialize the above spring bean. As it was located in the "testResource" folder. When I moved it to the "javaResource" folder the error was gone. – Sanjay Tank Jan 05 '14 at 22:56
  • 1
    I suggest that what really fixed it was (re-)compiling it. – user207421 Jan 05 '14 at 23:24

0 Answers0