11장 예제 실행시 에러 문의

106 views
Skip to first unread message

Seungwon Lee

unread,
Apr 3, 2011, 4:56:16 AM4/3/11
to OSGi &SpringDM
책에 나와 있는 예제를 따라해보고 있는데
11장의 target platform을 실행해 보면 다음과 같은 에러가 나네요.
제공하신 소스코드를 사용했는데 제가 설정을 변경해야 하는 부분이 있나요?


!STACK 0
org.osgi.framework.BundleException: Exception in
org.springframework.osgi.test.internal.support.Activator.start() of
bundle org.springframework.osgi.test.
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:
1028)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:
984)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:
346)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:
355)
at
org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:
1074)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:
616)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:
508)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:
299)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:
489)
at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:
211)
at org.eclipse.osgi.framework.eventmgr.EventManager
$EventThread.run(EventManager.java:321)
Caused by: java.lang.ExceptionInInitializerError
at
org.springframework.osgi.test.internal.support.Activator.start(Activator.java:
45)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl
$2.run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:
1003)
... 10 more
Caused by: java.lang.IllegalStateException: spring-osgi-test.jar is
not available on the boot class path; are you deploying the test
frameworkas a bundle by any chance?
at
org.springframework.osgi.test.internal.holder.HolderLoader.<init>(HolderLoader.java:
61)
at
org.springframework.osgi.test.internal.holder.HolderLoader.<clinit>(HolderLoader.java:
47)
... 14 more
Caused by: java.lang.ClassNotFoundException:
org.springframework.osgi.test.internal.holder.OsgiTestInfoHolder
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at
org.springframework.osgi.test.internal.holder.HolderLoader.<init>(HolderLoader.java:
57)
... 15 more
Root exception:
java.lang.ExceptionInInitializerError
at
org.springframework.osgi.test.internal.support.Activator.start(Activator.java:
45)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl
$2.run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:
1003)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:
984)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:
346)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:
355)
at
org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:
1074)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:
616)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:
508)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:
299)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:
489)
at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:
211)
at org.eclipse.osgi.framework.eventmgr.EventManager
$EventThread.run(EventManager.java:321)
Caused by: java.lang.IllegalStateException: spring-osgi-test.jar is
not available on the boot class path; are you deploying the test
frameworkas a bundle by any chance?
at
org.springframework.osgi.test.internal.holder.HolderLoader.<init>(HolderLoader.java:
61)
at
org.springframework.osgi.test.internal.holder.HolderLoader.<clinit>(HolderLoader.java:
47)
... 14 more
Caused by: java.lang.ClassNotFoundException:
org.springframework.osgi.test.internal.holder.OsgiTestInfoHolder
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at
org.springframework.osgi.test.internal.holder.HolderLoader.<init>(HolderLoader.java:
57)
... 15 more

Seungwon Lee

unread,
Apr 3, 2011, 4:42:30 AM4/3/11
to OSGi &SpringDM
책에 나온 예제를 하나씩 따라해보고 있습니다.
그런데 11장에서 만든 target platform을 실행 해 보면 다음과 같은 에러가 납니다.
제공해 주신 소스코드를 그대로 import하여 실행해봐도 동일한 오류가 나는데 제가 설정을 잘못한건가요?

xguru

unread,
Apr 3, 2011, 7:45:18 AM4/3/11
to OSGi &SpringDM
이 에러메시지는 osgi log 파일에 있는것 아닌가요 ?
이건 spring-osgi-test 가 일반상태에서는 시작이 불가능한것인데
시작하려고 시도하다 실패하는것이라 동작과는 상관이 없습니다.
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleCont extImpl.java:
> 984)
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost. java:
> 346)
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBund le.java:
> 355)
> at
> org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.j ava:
> 1074)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(St artLevelManager.java:
> 616)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLev elManager.java:
> 508)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel( StartLevelManager.java:
> 299)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(St artLevelManager.java:
> 489)
> at
> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager .java:
> 211)
> at org.eclipse.osgi.framework.eventmgr.EventManager
> $EventThread.run(EventManager.java:321)
> Caused by: java.lang.IllegalStateException: spring-osgi-test.jar is
> not available on the boot class path; are you deploying the test
> frameworkas a bundle by any chance?
> at
> org.springframework.osgi.test.internal.holder.HolderLoader.<init>(HolderLoa der.java:
> 61)
> at
> org.springframework.osgi.test.internal.holder.HolderLoader.<clinit>(HolderL oader.java:

Seungwon Lee

unread,
Apr 3, 2011, 8:07:03 AM4/3/11
to OSGi &SpringDM
답변 감사합니다.

제 경우 log 파일이 아니라 Run 하면 eclipse console에 바로 출력됩니다.
아무튼 Run Configuration에서 spring-osgi-test를 제외하고 나니 11장, 12장의 예제는 잘 동작하더군
요.

근데 13장 예제에서 또 막히네요.

13장 예제에서 WEB_INF 폴더를 추가하고 웹브라우저에 확인해 봤을 때
Contexts know to this server are: 에 아무것도 표시되지 않습니다.

그리고 다운받은 소스로 그 다음 예제를 실행해보면 브라우저에 다음과 같이 출력됩니다.
HTTP ERROR: 404

NOT_FOUND

RequestURI=/HelloSpringDM

Powered by jetty://


ss 명령으로 확인해보면 나머지 번들은 모두 active 상태인데
org.springframework.osgi.jetty.web.extender.fragment.osgi_1.0.1만
resolve 상태입니다.
이것과 관련된 문제일까요?

이 번들을 start해 보면 A fragment bundle cannot be started라고 BundleException이
발생합니다.

xguru

unread,
Apr 3, 2011, 8:24:20 AM4/3/11
to OSGi &SpringDM
fragment 번들은 원래 시작이 불가능합니다. resolve 상태여도 상관이 없구요.

/HelloSpringDM 에 URI 등록이 안된것으로 봐서는 HelloSpringDM_Web 번들이 제대로 등록이 되지 않은
것 같습니다.
WEB-INF 및 web.xml 을 체크해보셔야 할것 같습니다.
Reply all
Reply to author
Forward
0 new messages