Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Testing bundle by Tycho, log4j does not work
Testing bundle by Tycho, log4j does not work [message #641690] Fri, 26 November 2010 19:04 Go to next message
guofeng zhang is currently offline guofeng zhangFriend
Messages: 49
Registered: July 2009
Member
I tried to use Tycho eclipse-test-plugin to test my bundle. When the test is launched, I got the following WARNING, and I cannot see the logs output by Spring.
log4j:WARN No appenders could be found for logger (org.springframework.osgi.extender.internal.activator.ContextLoaderListener).
log4j:WARN Please initialize the log4j system properly.

The eclipse-test-plugin compose config.ini based on the dependencies, then use org.eclipse.equinox.launcher to run the test.

I think there is no log4j.properties or logback.xml existed, so I developd a fragment bundle (org.planner.infrastructure.log4j, id:87) containing the configuration file to attach to com.springsource.org.apache.log4j:
Fragment-Host: com.springsource.org.apache.log4j;bundle-version="1.2.16"

I first tried to use log4j.properties, then tried logback.xml, but they all cannot solve the issue.

Which bundle should my bundle attach to?

Your help is appreciated.

The following are the bundles launched by the test plugin.
id      State       Bundle
0       ACTIVE      org.eclipse.osgi_3.6.1.R36x_v20100806
1       ACTIVE      com.atomikos.transactions_3.6.5
2       ACTIVE      com.atomikos.transactions-api_3.6.5
3       ACTIVE      com.atomikos.transactions-jta_3.6.5
4       ACTIVE      com.atomikos.util_3.6.5
5       ACTIVE      com.atomikos.transactions-jdbc_3.6.5
6       ACTIVE      com.springsource.javax.transaction_1.1.0
7       ACTIVE      javax.jms_1.1.0.v200906010428
8       ACTIVE      javax.resource_1.5.0.v200906010428
9       ACTIVE      com.springsource.slf4j.api_1.6.1
                    Fragments=34
10      ACTIVE      com.springsource.javax.servlet_2.5.0
11      ACTIVE      com.springsource.com.thoughtworks.qdox_1.6.3
12      ACTIVE      org.junit_4.8.1.v4_8_1_v20100427-1100
13      ACTIVE      com.springsource.javax.ejb_3.0.0
14      ACTIVE      com.springsource.javax.xml.rpc_1.1.0
15      ACTIVE      com.springsource.javax.mail_1.4.0
16      ACTIVE      javax.activation_1.1.0.v201005080500
17      ACTIVE      com.springsource.javax.portlet_2.0.0
18      ACTIVE      com.springsource.javax.el_1.0.0
19      ACTIVE      com.springsource.javax.xml.soap_1.3.0
20      ACTIVE      com.springsource.org.apache.commons.fileupload_1.2.0
21      ACTIVE      com.springsource.org.apache.commons.io_1.4.0
22      ACTIVE      com.springsource.org.apache.commons.httpclient_3.1.0
23      ACTIVE      com.springsource.org.apache.commons.codec_1.3.0
25      ACTIVE      com.springsource.org.apache.log4j_1.2.16
                    Fragments=87
26      ACTIVE      com.springsource.slf4j.org.apache.log4j_1.6.1
27      ACTIVE      javax.servlet.jsp_2.0.0.v200806031607
28      ACTIVE      com.springsource.org.apache.xbean.spring_3.6.0
29      ACTIVE      org.springframework.beans_3.0.5.RELEASE
30      ACTIVE      org.springframework.context_3.0.5.RELEASE
31      ACTIVE      org.springframework.core_3.0.5.RELEASE
32      ACTIVE      org.springframework.web_3.0.5.RELEASE
33      ACTIVE      com.springsource.org.aspectj.weaver_1.6.6.RELEASE
34      RESOLVED    com.springsource.slf4j.log4j_1.6.1
                    Master=9
35      ACTIVE      org.springframework.asm_3.0.5.RELEASE
36      ACTIVE      org.codehaus.grepo.core_1.5.1
37      ACTIVE      org.codehaus.grepo.query.commons_1.5.1
38      ACTIVE      org.codehaus.grepo.query.jpa_1.5.1
39      ACTIVE      org.springframework.osgi.extender_1.2.1
41      ACTIVE      derby_10.6.1000000.938214
42      ACTIVE      org.planner.infrastructure.datasource_1.0.0.201011262302
43      ACTIVE      org.planner.infrastructure.eclipselink_1.0.0.201011262302
44      ACTIVE      org.planner.infrastructure.jtatransaction_1.0.0.201011262302

45      ACTIVE      org.planner.repository.jpa_1.0.0.201011262302
46      ACTIVE      org.planner.service.impl_1.0.0.201011262302
47      ACTIVE      org.eclipse.equinox.launcher_1.1.0.v20100507
48      ACTIVE      org.eclipse.core.runtime_3.6.0.v20100505
49      ACTIVE      javax.persistence_2.0.2.v201008061442
50      ACTIVE      org.apache.ant_1.7.1.v20100518-1145
51      ACTIVE      org.apache.felix.configadmin_1.2.4
52      ACTIVE      org.apache.felix.log_1.0.0
53      ACTIVE      org.apache.felix.eventadmin_1.0.0
54      ACTIVE      com.springsource.org.aopalliance_1.0.0
55      ACTIVE      com.springsource.org.apache.commons.lang_2.4.0
56      ACTIVE      org.springframework.aop_3.0.5.RELEASE
57      ACTIVE      org.springframework.transaction_3.0.5.RELEASE
58      ACTIVE      org.codehaus.grepo.statistics_1.5.1
59      ACTIVE      org.springframework.orm_3.0.5.RELEASE
60      ACTIVE      org.eclipse.equinox.common_3.6.0.v20100503
61      ACTIVE      org.eclipse.core.contenttype_3.4.100.v20100505-1235
62      ACTIVE      org.eclipse.equinox.preferences_3.3.0.v20100503
63      ACTIVE      org.eclipse.equinox.registry_3.5.0.v20100503
64      ACTIVE      org.eclipse.core.jobs_3.5.1.R36x_v20100824
65      ACTIVE      org.eclipse.core.runtime.compatibility.auth_3.2.200.v20100517
66      ACTIVE      org.eclipse.equinox.app_1.3.1.R36x_v20100803
67      ACTIVE      org.eclipse.persistence.asm_2.1.1.v20100817-r8050
68      ACTIVE      org.eclipse.persistence.core_2.1.1.v20100817-r8050
69      ACTIVE      org.eclipse.persistence.antlr_2.1.1.v20100817-r8050
70      ACTIVE      org.eclipse.persistence.jpa_2.1.1.v20100817-r8050
71      ACTIVE      org.hamcrest.core_1.1.0.v20090501071000
72      ACTIVE      org.planne.repository_1.0.0.201011262302
73      ACTIVE      org.planner.domain_1.0.0.201011262302
74      ACTIVE      org.springframework.aspects_3.0.5.RELEASE
75      ACTIVE      org.planner.service_1.0.0.201011262302
76      ACTIVE      org.planner.service.impl.test_1.0.0.qualifier
77      ACTIVE      com.springsource.org.apache.commons.pool_1.5.3
78      ACTIVE      org.springframework.instrument_3.0.5.RELEASE
79      ACTIVE      org.springframework.expression_3.0.5.RELEASE
80      ACTIVE      org.springframework.jdbc_3.0.5.RELEASE
81      ACTIVE      org.springframework.osgi.core_1.2.1
82      ACTIVE      org.springframework.osgi.io_1.2.1
83      ACTIVE      org.springframework.oxm_3.0.5.RELEASE
84      ACTIVE      org.sonatype.tycho.surefire.osgibooter_0.10.0
                    Fragments=85
85      RESOLVED    org.sonatype.tycho.surefire.junit4_0.10.0
                    Master=84
87      RESOLVED    org.planner.infrastructure.log4j_1.0.0.201011270232
                    Master=25
88      ACTIVE      com.springsource.org.apache.commons.logging_1.1.1

Re: Testing bundle by Tycho, log4j does not work [message #641928 is a reply to message #641690] Mon, 29 November 2010 09:45 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
I think you need to configure Virgo's Logback logging framework by editing config/serviceability.xml. There is some help on this in the Virgo User Guide.
Re: Testing bundle by Tycho, log4j does not work [message #641940 is a reply to message #641928] Mon, 29 November 2010 10:30 Go to previous messageGo to next message
guofeng zhang is currently offline guofeng zhangFriend
Messages: 49
Registered: July 2009
Member
Does Spring DM also use $SERVER_HOME/config/serviceability.xml to configure itself?

My test does not run on the Virgo Kernel. Based on the dependencies in my test bundle, Tycho create a config.ini and launch Equniox directly to run these bundles (include Spring DM).

Re: Testing bundle by Tycho, log4j does not work [message #641992 is a reply to message #641940] Mon, 29 November 2010 13:39 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Apologies, I thought this was a Virgo question. I'm afraid you'll need to ask on the Spring DM or Gemini (in relation to Blueprint) forums.
Re: Testing bundle by Tycho, log4j does not work [message #642051 is a reply to message #641690] Mon, 29 November 2010 17:05 Go to previous messageGo to next message
guofeng zhang is currently offline guofeng zhangFriend
Messages: 49
Registered: July 2009
Member
The issue is solved by defining the fragment bundle as the following:
Fragment-Host: com.springsource.org.apache.log4j;bundle-symbolic-name="com.springsource.org.apache.log4j";bundle-version="1.2.16"


I understand it. Next time I will post to Spring OSGi forum or Gemini forum for the Spring DM question.

Thanks.
Re: Testing bundle by Tycho, log4j does not work [message #642901 is a reply to message #642051] Fri, 03 December 2010 09:46 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Glad you got going. Smile
Previous Topic:Installing OpenEJB in Eclipse Virgo
Next Topic:Bundle Classpath Container not populated from Virgo repository
Goto Forum:
  


Current Time: Sat Dec 07 18:00:45 GMT 2024

Powered by FUDForum. Page generated in 0.03599 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top