[JBoss OSGi Development] - Re: Service integration with MC
by adrian@jboss.org
It should be done on the calls to (un)getTarget()
Having the calling code do all this work would inefficient and error prone.
And besides a context may want to change the way this work, e.g. by providing
a specific ServiceTracker rather than using the one determined from the MDR.
You need a signature like I suggested above,
i.e. something like the following:
| // Mixin interface for service tracking
| public interface ServiceTracking
| {
| /**
| * Get the service tracker associated with this context
| *
| * @return the tracker or null if it doesn't have one
| */
| ServiceTracker getServiceTracker();
|
| /**
| * Get the target and update the service tracking
| *
| * @param me the controller context that will use the target
| * @return the object
| * @throws Exception for any error
| */
| Object getTarget(ControllerContext me) throws Exception;
|
| /**
| * Unget the target and update the service tracking
| *
| * @param me the controller context that used the target
| */
| void ungetTarget(ControllerContext me);
| }
|
| public Object ControllerContext::getTarget(ControllerContext me) throws Exception
| {
| Object result = getTarget();
| if (result != null)
| {
| ServiceTracker myTracker = getServiceTracker();
| if (myTracker != null)
| myTracker.incrementInUse(me, this);
| if (me instanceOf ServiceTracking)
| {
| ServiceTracker otherTracker = me.getServiceTracker();
| if (otherTracker != null)
| otherTracker.incrementUsing(this);
| }
| }
| return result;
| }
|
| public void ControllerContext::ungetTarget(ControllerContext me)
| {
| Object result = getTarget();
| if (result != null)
| {
| ServiceTracker myTracker = getServiceTracker();
| if (myTracker != null)
| myTracker.decrementInUse(me, this);
| if (me instanceOf ServiceTracking)
| {
| ServiceTracker otherTracker = me.getServiceTracker();
| if (otherTracker != null)
| otherTracker.decrementUsing(this);
| }
| }
| }
|
The instanceOf ServiceTracking is for backwards compatibilty in case
some old ControllerContext doesn't know about ServiceTracking.
You should make AbstractControllerContext implement the getServiceTracker() by
looking in the MDR (probably during the original install for performance and
consistency - or you could do it lazily on first request?).
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4267018#4267018
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4267018
16 years, 4 months
[JBoss OSGi Development] - Re: Service integration with MC
by adrian@jboss.org
"alesj" wrote :
| I fail to see why I would need two different levels of ServiceTracker.
| As I also always have to check the "global" list.
|
| When would I check just deployment level ServiceTracker?
| For non-system bundle, to lookup non-osgi services that belong just to this bundle / jar / deployment?
|
It is the stats that are at different levels.
* The queries are global.
* The inuse tracking is at system/application/deployment level, i.e. this deployment
uses a service from some other deployment and the some other deployment's service
has its "in use" count integrated.
See the current OSGi code. The queries run against the OSGiBundleManager (should be Controller).
The other statistics are at BundleState level (should be ServiceTracker at whatever
level the deployers setup for that context).
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266980#4266980
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266980
16 years, 4 months
[JBoss OSGi Development] - Re: Define non OSGi bundle handling by the Framework
by adrian@jboss.org
"thomas.diesler(a)jboss.com" wrote :
| What we do with the OSGi example and functional test is a specific solution to the general problem of Maven integration testing
|
| http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testing
|
| Anyhow, the MC framework needs to work in AS and the OSGi examples must run in AS. This is not something you can do in an Eclipse unit test.
|
| I realize, that building the installer, installing the framework, starting the target container, running the examples against the target container is not a practical prerequisite for an SVN commit.
|
| However, everybody should at least be aware of the functionality that already works and is being tested. One click on the public hudson instance can pickup potential integration issues, which can then be looked at and fixed locally.
|
That's not what I'm saying. I mean why isn't this feature being properly unit tested in
framework/reactor?
The FrameworkTest lets you setup a "minimal" JBoss instance (without all
the other JavaEE services - just the basic OSGi stuff).
So it should be possible to write a unit test for something that is broken in the integration
tests so it won't regress in future by a bad commit in framework/reactor.
On the thirdparty library stuff. The integration tests should not be running off
reactor/framework trunk. The version used there should only be updated
when the AS and osgi framework agree about thirdparty dependencies.
i.e. once the thirdparty stuff has been updated into the AS at the end of the
latest changes (once they are stable).
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266979#4266979
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266979
16 years, 4 months
[Embedded JBoss Development] - Re: Tried to check out & build with cygwin - OOME
by pgmjsd
Whaddaya know... 'argLine' worked!
| $ mvn test
| [INFO] Scanning for projects...
| WAGON_VERSION: 1.0-beta-2
| [INFO] ------------------------------------------------------------------------
| [INFO] Building JBossAS Embedded TestSuite
| [INFO] task-segment: [test]
| [INFO] ------------------------------------------------------------------------
| [INFO] [enforcer:enforce {execution: enforce-plugin-versions}]
| [INFO] [enforcer:enforce {execution: enforce-java-version}]
| [INFO] [enforcer:enforce {execution: enforce-maven-version}]
| [INFO] [enforcer:enforce {execution: ban-bad-dependencies}]
| [INFO] [enforcer:enforce {execution: enforce-maven-environment}]
| [INFO] [resources:resources]
| [INFO] Using 'UTF-8' encoding to copy filtered resources.
| [INFO] skip non existing resourceDirectory i:\devel\yajul\sandbox\embedded-jboss\embedded-trunk\testsuite\src\main\resources
| [INFO] [compiler:compile]
| [INFO] No sources to compile
| [INFO] [resources:testResources]
| [INFO] Using 'UTF-8' encoding to copy filtered resources.
| [INFO] Copying 8 resources
| [INFO] [compiler:testCompile]
| [INFO] Nothing to compile - all classes are up to date
| [INFO] [surefire:test]
| [INFO] Surefire report directory: i:\devel\yajul\sandbox\embedded-jboss\embedded-trunk\testsuite\target\surefire-reports
|
| -------------------------------------------------------
| T E S T S
| -------------------------------------------------------
| Running org.jboss.embedded.testsuite.ServerTestCase
| Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 108.906 sec
|
| Results :
|
| Tests run: 7, Failures: 0, Errors: 0, Skipped: 0
|
| [INFO] ------------------------------------------------------------------------
| [INFO] BUILD SUCCESSFUL
| [INFO] ------------------------------------------------------------------------
| [INFO] Total time: 3 minutes 21 seconds
| [INFO] Finished at: Sun Nov 22 19:38:07 EST 2009
| [INFO] Final Memory: 19M/127M
| [INFO] ------------------------------------------------------------------------
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266950#4266950
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266950
16 years, 4 months
[Embedded JBoss Development] - Re: Tried to check out & build with cygwin - OOME
by pgmjsd
"ALRubinger" wrote : "pgmjsd" wrote : It still blows up though.
|
| Need stacktraces, and more context.
|
| S,
| ALR
The context: running 'mvn test' in testsuite after seeing that there were failed tests when running 'mvn clean install' in the embedded/trunk directory.
Here's what it looks like on the command line:
| $ mvn test
| [INFO] Scanning for projects...
| WAGON_VERSION: 1.0-beta-2
| [INFO] ------------------------------------------------------------------------
| [INFO] Building JBossAS Embedded TestSuite
| [INFO] task-segment: [test]
| [INFO] ------------------------------------------------------------------------
| [INFO] [enforcer:enforce {execution: enforce-plugin-versions}]
| [INFO] [enforcer:enforce {execution: enforce-java-version}]
| [INFO] [enforcer:enforce {execution: enforce-maven-version}]
| [INFO] [enforcer:enforce {execution: ban-bad-dependencies}]
| [INFO] [enforcer:enforce {execution: enforce-maven-environment}]
| [INFO] [resources:resources]
| [INFO] Using 'UTF-8' encoding to copy filtered resources.
| [INFO] skip non existing resourceDirectory i:\devel\yajul\sandbox\embedded-jboss\embedded-trunk\testsuite\src\main\resources
| [INFO] [compiler:compile]
| [INFO] No sources to compile
| [INFO] [resources:testResources]
| [INFO] Using 'UTF-8' encoding to copy filtered resources.
| [INFO] Copying 8 resources
| [INFO] [compiler:testCompile]
| [INFO] Nothing to compile - all classes are up to date
| [INFO] [surefire:test]
| [INFO] Surefire report directory: i:\devel\yajul\sandbox\embedded-jboss\embedded-trunk\testsuite\target\surefire-reports
|
| -------------------------------------------------------
| T E S T S
| -------------------------------------------------------
| Running org.jboss.embedded.testsuite.ServerTestCase
| Tests run: 7, Failures: 0, Errors: 7, Skipped: 0, Time elapsed: 77.234 sec <<< FAILURE!
|
| Results :
|
| Tests in error:
| testSlsb(org.jboss.embedded.testsuite.ServerTestCase)
| testWarServletJsp(org.jboss.embedded.testsuite.ServerTestCase)
| testJmsAndMdb(org.jboss.embedded.testsuite.ServerTestCase)
| testDataSourceAndEntity(org.jboss.embedded.testsuite.ServerTestCase)
| testWs(org.jboss.embedded.testsuite.ServerTestCase)
| testUrlDeployment(org.jboss.embedded.testsuite.ServerTestCase)
| testFileDeployment(org.jboss.embedded.testsuite.ServerTestCase)
|
| Tests run: 7, Failures: 0, Errors: 7, Skipped: 0
|
| [INFO] ------------------------------------------------------------------------
| [ERROR] BUILD FAILURE
| [INFO] ------------------------------------------------------------------------
| [INFO] There are test failures.
|
| Please refer to i:\devel\yajul\sandbox\embedded-jboss\embedded-trunk\testsuite\target\surefire-reports for the individual test results.
| [INFO] ------------------------------------------------------------------------
| [INFO] For more information, run Maven with the -e switch
| [INFO] ------------------------------------------------------------------------
| [INFO] Total time: 1 minute 24 seconds
| [INFO] Finished at: Sun Nov 22 19:03:27 EST 2009
| [INFO] Final Memory: 19M/127M
| [INFO] ------------------------------------------------------------------------
|
The stacktrace:
| 19:02:49,593 ERROR [AbstractKernelController] Error installing to Start: name=jboss.remoting:protocol=rmi,service=JMXConnectorServer state=Create mode=Manual requiredState=Installed
| java.rmi.server.ExportException: Port already in use: 1090; nested exception is:
| java.net.BindException: Address already in use: JVM_Bind
| at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:310)
|
So, that's actually used by iTunes. After shutting down iTunes (guess I'll have to use something else to play music while I'm coding :P ):
| 19:08:44,796 INFO [ServerTestCase] webservice.war:
| /WEB-INF/web.xml
| /WEB-INF/classes/org/jboss/embedded/testsuite/ws/EmbeddedWs.class
|
| 19:08:46,109 INFO [WSDLFilePublisher] WSDL published to: file:/I:/devel/yajul/sandbox/embedded-jboss/jboss-as/build/output/jboss-6.0.0.M1/server/all/data/wsdl/webservice.war/Embedded6569855392570828391.wsdl
| 19:08:46,140 INFO [DefaultEndpointRegistry] register: jboss.ws:context=webservice,endpoint=embedded
| 19:08:46,203 INFO [TomcatDeployment] deploy, ctxPath=/webservice
| Nov 22, 2009 7:08:46 PM org.jboss.embedded.testsuite.ServerTestCase testWs
| INFO: Create Web Service client...
| 19:08:46,921 INFO [ServerTestCase] Create Web Service client...
| Nov 22, 2009 7:08:47 PM org.jboss.embedded.testsuite.ServerTestCase testWs
| INFO: Call Web Service Operation...
| 19:08:47,375 INFO [ServerTestCase] Call Web Service Operation...
| 19:08:47,531 ERROR [CommonClient] Exception caught while (preparing for) performing the invocation:
| java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage
| at javax.xml.soap.SOAPMessage.setProperty(SOAPMessage.java:441)
| at org.jboss.ws.core.soap.SOAPMessageImpl.<init>(SOAPMessageImpl.java:87)
| at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:169)
| at org.jboss.ws.core.CommonSOAP11Binding.createMessage(CommonSOAP11Binding.java:57)
| at org.jboss.ws.core.CommonSOAPBinding.bindRequestMessage(CommonSOAPBinding.java:158)
| at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:291)
| at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:290)
| at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:170)
| at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
| at $Proxy197.hello(Unknown Source)
| at org.jboss.embedded.testsuite.ServerTestCase.testWs(ServerTestCase.java:479)
| 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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
| at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
| at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
| at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
| at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
| at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
| at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
| at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:44)
| at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
| at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
| at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
| at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
| at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
| at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
| at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
| at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
| at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:165)
| at org.apache.maven.surefire.Surefire.run(Surefire.java:107)
| 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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:289)
| at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1005)
| Nov 22, 2009 7:08:47 PM org.jboss.embedded.testsuite.ServerTestCase stopEmbeddedAS
|
Maybe I didn't get that 'extra classpath' thing exactly right. I was pretty sure that the surefire plugin wouldn't understand a '*' in the classpath entries, so I just put in the reference to jbossws-native-client.jar in.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266946#4266946
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266946
16 years, 4 months