EhCache on 3.0.0-SNAPSHOT

45 views
Skip to first unread message

Teemu Hiltunen

unread,
Aug 26, 2015, 6:49:56 AM8/26/15
to fabric3
Hi!

This is a bit old issue (https://fabric3.atlassian.net/browse/FABRIC-18) already but here we go again. I hope to have time to get this thing finished now.

There is EhCache extension in Fabric3 (extension/other/cache/fabric3-cache-ehcache/). I would like to use it with Spring @Cacheable annotations and also as a Hibernate 2nd level cache.

I builded the latest 3.0.0-SNAPSHOT just now and installed Spring profile into it. Then I dropped EhCache extension jar under /extensions as well. This gave me the following error when launching Fabric3:

teemu@teemu2013:~/Temp/fabric3$ java -jar bin/server.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/fabric3/spi/contribution/ContributionServiceListener
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at org.fabric3.spi.classloader.MultiParentClassLoader.findClass(MultiParentClassLoader.java:233)
    at org.fabric3.spi.classloader.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:200)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.fabric3.implementation.system.introspection.SystemImplementationLoader.load(SystemImplementationLoader.java:71)
    at org.fabric3.implementation.system.introspection.SystemImplementationLoader.load(SystemImplementationLoader.java:42)
    at org.fabric3.introspection.xml.LoaderRegistryImpl.load(LoaderRegistryImpl.java:86)
    at org.fabric3.introspection.xml.composite.ComponentLoader.load(ComponentLoader.java:134)
    at org.fabric3.introspection.xml.composite.ComponentLoader.load(ComponentLoader.java:66)
    at org.fabric3.introspection.xml.LoaderRegistryImpl.load(LoaderRegistryImpl.java:86)
    at org.fabric3.introspection.xml.composite.CompositeLoader.handleComponent(CompositeLoader.java:195)
    at org.fabric3.introspection.xml.composite.CompositeLoader.load(CompositeLoader.java:132)
    at org.fabric3.introspection.xml.composite.CompositeLoader.load(CompositeLoader.java:65)
    at org.fabric3.introspection.xml.LoaderRegistryImpl.load(LoaderRegistryImpl.java:86)
    at org.fabric3.introspection.xml.LoaderRegistryImpl.load(LoaderRegistryImpl.java:118)
    at org.fabric3.introspection.xml.LoaderRegistryImpl.load(LoaderRegistryImpl.java:94)
    at org.fabric3.contribution.processor.CompositeResourceProcessor.process(CompositeResourceProcessor.java:123)
    at org.fabric3.contribution.ProcessorRegistryImpl.processResource(ProcessorRegistryImpl.java:97)
    at org.fabric3.contribution.archive.ArchiveContributionProcessor.lambda$process$22(ArchiveContributionProcessor.java:76)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
    at org.fabric3.contribution.archive.ArchiveContributionProcessor.process(ArchiveContributionProcessor.java:76)
    at org.fabric3.contribution.ProcessorRegistryImpl.processContribution(ProcessorRegistryImpl.java:85)
    at org.fabric3.contribution.ContributionServiceImpl.processContents(ContributionServiceImpl.java:419)
    at org.fabric3.contribution.ContributionServiceImpl.processContents(ContributionServiceImpl.java:200)
    at java.util.ArrayList.forEach(ArrayList.java:1249)
    at org.fabric3.fabric.runtime.DefaultCoordinator.loadExtensions(DefaultCoordinator.java:125)
    at org.fabric3.fabric.runtime.DefaultCoordinator.load(DefaultCoordinator.java:82)
    at org.fabric3.fabric.runtime.DefaultCoordinator.start(DefaultCoordinator.java:64)
    at org.fabric3.runtime.standalone.server.Fabric3Server.start(Fabric3Server.java:181)
    at org.fabric3.runtime.standalone.server.Fabric3Server.main(Fabric3Server.java:85)
Caused by: java.lang.ClassNotFoundException: org.fabric3.spi.contribution.ContributionServiceListener
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at org.fabric3.spi.classloader.MultiParentClassLoader.findClass(MultiParentClassLoader.java:233)
    at org.fabric3.spi.classloader.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:200)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 46 more


Do I need to add some other extension(s) as well or is there some other problem here? The mentioned class org.fabric3.spi.contribution.ContributionServiceListener is in /kernel/api/fabric3-spi module - why cannot it be found?

The Hibernate 2nd level cache is another topic altogether.


--teemu

Teemu Hiltunen

unread,
Oct 21, 2015, 7:40:09 AM10/21/15
to fabric3
Hi!


This cache support has expanded to more general new features but I would like to know when there would be a version that supported EhCache and Spring @Cacheable? What exactly needs to be done for it? We are in a bit of a jam with our older version of forked fabric3 that includes EhCache and Spring support for caching because that version is so old that it does not work on Java 8. So, we need to wait for the 3.0 but our client is demanding some sort of schedule for it. Therefore, I can put more effort myself into this. Tell me what to do? :-)


--teemu

Jim Marino

unread,
Oct 21, 2015, 4:32:22 PM10/21/15
to fabric3
Hi Teemu,

Can you enumerate the specific cache features you need? The general solution we are putting in place will let you create a cache in a DSL class and set it as part of a composite using a name. Clients that need to access the cache can wire it using @Resource(name="..") and the container will inject it.

Do you need something different or in addition? For example, did your forked version intercept method calls and return cached results? If you can detail those, I can provide some direct pointers on what to do and also help out. 

In terms of a 3.0 timeframe, I would like to wrap things up soon. What we really need is testing and to resolve a few outstanding issues:

1. Testing of the new etcd clustering and support for Hazelcast.  Hazelcast support is not an absolute need but I would like to at least have an initial version in place to test out the new clustering support.

2. Fix stability issues with the ZeroMQ binding

3. Finish up the Spring boot support. We still have not implemented native support for Spring applications in the Fabric3 server, but we could slip this to 3.1 if people wanted.

4. Move Fabric3 NATS and Kafka support into the core repo (this is housekeeping, the bindings work)

5. Resolve a few small outstanding issues with transport startup in the JMS and REST bindings.

Getting help on some of the testing would speed things up a lot. I know Tomas and Stano had offered to help on cluster testing and the ZeroMQ issues so hopefully they will have some spare time in this period.

Jim
 


--
You received this message because you are subscribed to the Google Groups "fabric3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabric3+u...@googlegroups.com.
To post to this group, send email to fab...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fabric3/86616d60-ae02-4fab-a814-aa524dc02c13%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Teemu Hiltunen

unread,
Oct 22, 2015, 4:23:39 AM10/22/15
to fabric3
Hello Jim!

Our old forked version was based on Fabric3 1.9.6. The modifications we did were these:

  1. fabric3-hibernate-library
    • in pom.xml we added:
      <dependency>
          <groupId>net.sf.ehcache</groupId>
          <artifactId>ehcache-core</artifactId>
          <version>2.5.2</version>
      </dependency>
    • in sca-contribution.xml we added:
      <export.java package="net.sf.ehcache.*" version="2.5.2" />
  2. fabric3-spring-library
    • in sca-contribution.xml we added:
      <import.java package="net.sf.ehcache.*" version="2.5.2"/>

With these little changes (at least I cannot recall now that there were any other change needed) we were able to something like this:
  • In Spring-implemented SCA components' Spring configuration file:
            <cache:annotation-driven cache-manager="myCacheManager" />
           
    <bean id="myCacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager"
                   
    p:cache-manager-ref="myEhcache" />
           
    <bean id="myEhcache"
                   
    class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"
                   
    p:config-location="classpath:my-ehcache.xml" p:shared="false"
                   
    p:cacheManagerName="my" />
  • In Spring Java code:
    ...

        @Cacheable(value = "koodistot", key = "#koodistonimi + '_' + #lang")
       
    public Koodisto getKoodisto(Koodistonimi koodistonimi, String lang) {
           
    ...
       
    }
    ...
  • and we needed to import ehcache packages in sca-contribution.xml:
    <import.java package="net.sf.ehcache.*" />


This was all we needed at the time (as I said above, at least I cannot recall other things needed). Especially the ability to use Spring @Cacheable made things really easy for us.


We would need this same functionality in Fabric3 version that is compatible with Java 8. Or something very similar at least.


I will try now to do those same changes into Fabric3 2.5.3 and see if our application works with it. If it does work, then could it be possible to make an official 2.5.4 release with just these changes? I take it that 2.5.3 is Java 8 compatible?



--teemu

Jim Marino

unread,
Oct 26, 2015, 4:26:25 AM10/26/15
to fabric3
Hi Teemu,

2.5.3 is Java 8 compatible. I'll take a look on the 3.0 branch to see if I can get this working. In the meantime, if you can try with the 2.5.3 branch and there is not a lot of additional work (I don't anticipate there would be), we can do a 2.5.4 maintenance release.

Jim


Teemu Hiltunen

unread,
Oct 26, 2015, 4:45:32 AM10/26/15
to fabric3
Hi!

I tried it with 2.5.3 but I bumped into some other things when deploying our application into fabric8.

We have used Motitors and Channels for logging purposes like this (in component.composite file):
        <component name="MyServiceMonitor">
               
<implementation.monitor>
                       
<configuration>
                               
<appender name="MY_SERVICE_LOG_FILE"
                                       
class="ch.qos.logback.core.rolling.RollingFileAppender">
                                       
<file>my-service.log</file>
                                       
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
                                               
<fileNamePattern>my-service.%d{yyyy-MM-dd}.log</fileNamePattern>
                                               
<maxHistory>60</maxHistory>
                                       
</rollingPolicy>
                                       
<encoder>
                                               
<pattern>%date [%thread] %-5level %logger{35} - %msg%n</pattern>
                                       
</encoder>
                               
</appender>
                       
</configuration>
               
</implementation.monitor>
               
<consumer name="monitor" source="MyServiceChannel" />
       
</component>

Is this deprecated in 2.x? Or changed otherwise? At deployment it gives an error like this:

Caused by: org.codehaus.stax2.typed.TypedXMLStreamException: ParseError at [row,col]:[17,6]
Message: Element content can not contain child START_ELEMENT when using Typed Access methods
    at com.ctc.wstx.sr.BasicStreamReader._constructTypeException(BasicStreamReader.java:5497)
    at com.ctc.wstx.sr.BasicStreamReader._constructUnexpectedInTyped(BasicStreamReader.java:5490)
    at com.ctc.wstx.sr.BasicStreamReader.getElementText(BasicStreamReader.java:708)
    at org.fabric3.introspection.xml.common.ConfigurationLoader.load(ConfigurationLoader.java:56)
    at org.fabric3.introspection.xml.common.ConfigurationLoader.load(ConfigurationLoader.java:46)
    at org.fabric3.introspection.xml.LoaderRegistryImpl.load(LoaderRegistryImpl.java:87)
    at org.fabric3.introspection.xml.composite.CompositeLoader.handleExtensionElement(CompositeLoader.java:270)
    at org.fabric3.introspection.xml.composite.CompositeLoader.load(CompositeLoader.java:238)
    at org.fabric3.introspection.xml.composite.CompositeLoader.load(CompositeLoader.java:86)
    at org.fabric3.introspection.xml.LoaderRegistryImpl.load(LoaderRegistryImpl.java:87)
    at org.fabric3.introspection.xml.LoaderRegistryImpl.load(LoaderRegistryImpl.java:124)
    at org.fabric3.introspection.xml.LoaderRegistryImpl.load(LoaderRegistryImpl.java:100)



Is there some other way in 2.x to channel component logging into different log files?



--teemu

Jim Marino

unread,
Oct 26, 2015, 5:11:07 AM10/26/15
to fabric3
Hi Teemu,

Logging and monitoring was changed in 2.5.0. Tomas did a good write-up on how to configure it in the documentation, particularly around log file reuse. Let me know if you run into any problems.

Jim
 

Teemu Hiltunen

unread,
Oct 26, 2015, 5:15:47 AM10/26/15
to fabric3
Ah, yes, I did not look at the docs so much. This will help: https://fabric3.atlassian.net/wiki/display/FABRIC/Monitor+Configuration

Thank you!

Teemu Hiltunen

unread,
Oct 26, 2015, 6:38:56 AM10/26/15
to fabric3
Hi!

I cannot seem to find an answer to a question about monitoring a channel in F3 docs.

We have a use case where an admin page contains controls to initiate a long-running task. The task components log their doings using a monitor which is named after a channel. The monitor is configured to consume a channel and the channel is configured to provide a web binding. With this configuration the component logging is captured both into log files and the admin web page (Atmosphere push). But how do we do this with the new 2.x monitor configuration?

The old way:
Java:
@Management(path = "/koodistoLoader", group = "URA-T", description = "Koodisto Loader")
@Scope("COMPOSITE")
public class KoodistoLoaderComponent {

   
private KoodistoLoader koodistoLoader;

   
private MonitorChannel koodistoLoaderMonitor;

   
/**
     * @param koodistoLoaderMonitor the code set loader monitor for reporting how the loading proceeds
     */

   
public KoodistoLoaderComponent(
           
@Reference(name = "koodistoLoader") KoodistoLoader koodistoLoader,
           
@Monitor("KoodistoLoaderChannel") MonitorChannel koodistoLoaderMonitor) {
       
this.koodistoLoader = koodistoLoader;
       
this.koodistoLoaderMonitor = koodistoLoaderMonitor;
   
}

   
@ManagementOperation(path = "loadAll", description = "Load all code sets")
   
public void loadAllKoodistot() throws KoodistoLoaderException {
       
try {
           
long beginTime = System.currentTimeMillis();
           
for (Koodistonimi koodistonimi : Koodistonimi.values()) {
               
this.loadKoodisto(koodistonimi);
           
}
           
this.koodistoLoaderMonitor.info(String.format(
                   
"FINISHED! All code sets loaded in %d seconds",
                   
((System.currentTimeMillis() - beginTime) / 1000)));
       
} catch (KoodistoLoaderException e) {
           
this.koodistoLoaderMonitor
                   
.severe("Failed to load all code sets - see log file for errors!");
           
throw e;
       
}
   
}

   
private void loadKoodisto(Koodistonimi koodistonimi)
           
throws KoodistoLoaderException {
       
this.koodistoLoader.loadKoodisto(koodistonimi);
       
this.koodistoLoaderMonitor.info(String.format("Code set %s loaded",
                koodistonimi
));
   
}
}


Composite configuration:
    <channel name="KoodistoLoaderChannel" requires="f3:synchronous">
       
<f3:binding.web allowed="subscribe" />
   
</channel>

   
<component name="KoodistoLoaderMonitor">
       
<implementation.monitor>
           
<configuration>
               
<appender name="URA_T_KOODISTOLOADER_FILE"
                   
class="ch.qos.logback.core.rolling.RollingFileAppender">
                   
<file>ura-t-koodistopalvelu/ura-t-koodistoLoader.log</file>
                   
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
                       
<fileNamePattern>ura-t-koodistopalvelu/ura-t-koodistoLoader.%d{yyyy-MM-dd}.log</fileNamePattern>

                       
<maxHistory>60</maxHistory>
                   
</rollingPolicy>
                   
<encoder>
                       
<pattern>%date [%thread] %-5level %logger{35} - %msg%n</pattern>
                   
</encoder>
               
</appender>
           
</configuration>
       
</implementation.monitor>

       
<consumer name="monitor" source="KoodistoLoaderChannel" />
   
</component>


Now, as far as I can see based on documentation we cannot use that <consumer> element for <f3:monitor>. Would it work if we named them using the same name:


    <channel name="KoodistoLoaderChannel" requires="f3:synchronous">
       
<f3:binding.web allowed="subscribe" />
   
</channel>


   
<f3:monitor name="KoodistoLoaderChannel">
       
<appenders>
           
<appender.file="ura-t-koodistopalvelu/ura-t-koodistopalvelu.log" roll.type="size" roll.size="104857600" max.backups="60" />
       
</appenders>
   
</f3:monitor>



And Java code would remain the same.

Well, I might just as well try this out...


--teemu


PS. a date-based rolling for log files would be nice in addition to size-based.

Jim Marino

unread,
Oct 29, 2015, 2:16:30 PM10/29/15
to fabric3
Hi Teemu,

The Atmosphere binding was deprecated back in 2.0 with the idea of replacing it using native servlet support for websockets, which we haven't yet had the chance to work on yet. 

The good news is the new monitor infrastructure is a lot easier to extend and custom appenders can be added that forward to alternative destinations or even channels. To do this, you extend org.fabric3.monitor.spi.appender.Appender. A full exampe that forwards all monitor events to a NATS topic is included in the NATS extension here: https://github.com/Fabric3/fabric3-nats/tree/master/fabric3-binding-nats/src/main/java/org/fabric3/binding/nats/monitor. This could be used as a template for a websocket channel.

Another option is to forward monitor messages to a browser using Server Sent Events. Support for SSE is in the 3.0 stream of the JAX-RS binding. The advantage of SSE is that it works with existing firewall HTTP configurations and load balancers.

Let me know if the SSE approach would be best or you need support for websockets. 

Jim
 



Jim Marino

unread,
Oct 29, 2015, 2:17:12 PM10/29/15
to fabric3
I forgot to mention about date-based rolling. Can you file a new feature request on JIRA so we don't forget about it?

Jim

Teemu Hiltunen

unread,
Oct 30, 2015, 2:42:00 AM10/30/15
to fabric3
Hi!

I created an issue in Jira for the date-based rolling:
https://fabric3.atlassian.net/browse/FABRIC-67

Atmosphere support not being a part of F3 anymore is a bit of a bummer for us. Even though we undestand that the technology is a bit out-dated and should be replaced with something more modern.

We need to think about how to procede. There are currently a few options which also include replacing Fabric3 with JEE/Spring technologies. Which in our case would not be such a big task since our application is rather small and does not have so many SCA services and wirings in it. I think that the customer is not able (or willing) to pay us for the work needed to make Fabric3 Java 8 compatible - or replacing F3 with something else either. We will probably stick with the old modified 1.9.6 version and Java 6 until this project is renewed (in a few years maybe). We will see. The customer will decide what they want us to do.


--teemu

PS. I am a bit frustrated again of my work all together. Creating customer projects is sometimes very nice; one get to see many different projects and think about different designs and architectures etc. But sometimes it is not so nice because the project lives only as long as the customer wants it to live. If they decide not to pay for modernizations or even simple refactorings for better design or making the source code more readable and better organized and they just want something that "works" - it can be really frustrating. Well, I guess it all depends how the contracts between my employer and the customer are drafted. And now in general those contracts make our software projects to be delivered unpolished and then left to rot and thrown to garbage later when they turn into big balls of mud because there is no time or resources to make anything else than bubble-gum bug fixes and after a while no one can use the bloated and leaking code base as a basis for new versions and even adding new features becomes too hard and risky. And then the customer orders a new system - perhaps from some other company - and the cycle continues... until something is fundamentally changed in all this.
Well, instead of whining about this on this forum I might write an email to my boss and whine to him :-)
...

Jim Marino

unread,
Nov 4, 2015, 3:05:32 AM11/4/15
to fabric3
Hi Teemu,

I'm surprised Fabric3 1.6 is not working with Java 8. What errors are you receiving?

It's unfortunate the client does not see the business value in regular maintenance of their applications. I have seen this quite frequently with well-written applications where the client takes for granted the value being provided by the application since it "just works". The analogy I like to make is with a house: there's the initial outlay to purchase it, but you also have to protect your investment through regular maintenance.   

If the old F3 version (1.6) does not work on 1.6 let's look to getting websocket support added back in ASAP. It sounds as if what you need is:

1. A websocket binding for channels
2. A monitor appender that sends monitor messages to a channel that can be bound with websockets

Let me know the status of your testing with 1.6 and we can decide how to proceed.

Jim
 

--
You received this message because you are subscribed to the Google Groups "fabric3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabric3+u...@googlegroups.com.
To post to this group, send email to fab...@googlegroups.com.

Teemu Hiltunen

unread,
Nov 4, 2015, 4:03:39 AM11/4/15
to fabric3
Hi Jim!

I tested our modified 1.9.6 on Java 8:

java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

[main] INFO  fabric3://runtime/ContributionService - JPA API installed
[main] INFO  fabric3://runtime/ContributionService - DataSource extension installed
[main] INFO  fabric3://runtime/ContributionService - Atomikos library extension installed
[main] INFO  fabric3://runtime/ContributionService - JTA extension installed
[main] INFO  fabric3://runtime/ContributionService - Hibernate library extension installed
[main] INFO  fabric3://runtime/ContributionService - Hibernate JPA extension installed
[main] INFO  fabric3://runtime/ContributionService - Spring extension installed
[main] INFO  fabric3://runtime/ContributionService - Web binding extension installed
[main] INFO  fabric3://runtime/ContributionService - HTTP extension installed
[main] INFO  fabric3://runtime/ContributionService - JMX management extension installed
[main] INFO  fabric3://runtime/ContributionService - JNDI extension installed
[main] INFO  fabric3://runtime/ContributionService - JMS extension installed
[main] INFO  fabric3://runtime/ContributionService - WAR extension installed
[main] INFO  fabric3://runtime/ContributionService - Timer service extension installed
[main] INFO  fabric3://runtime/ContributionService - WAR scanner extension installed
[main] INFO  fabric3://runtime/ContributionService - JAX-RS (REST) extension installed
[main] INFO  fabric3://runtime/ContributionService - JAX-RS Jersey extension installed
[main] INFO  fabric3://runtime/ContributionService - Timer implementation extension installed
[main] INFO  fabric3://runtime/ContributionService - Web services extension installed
[main] INFO  fabric3://runtime/JettyService - HTTP listener started on port 8181
[main] ERROR fabric3://runtime/JettyService - Jetty exception: FAILED SocketC...@0.0.0.0:8181: java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException: null
    at org.fabric3.timer.impl.ExecutorTimerService.execute(ExecutorTimerService.java:230)
    at org.fabric3.transport.jetty.impl.JettyServiceImpl$Fabric3ThreadPool.dispatch(JettyServiceImpl.java:708)
    at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:332)
    at org.eclipse.jetty.server.bio.SocketConnector.doStart(SocketConnector.java:156)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.Server.doStart(Server.java:288)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.fabric3.transport.jetty.impl.JettyServiceImpl.init(JettyServiceImpl.java:347)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.fabric3.implementation.pojo.reflection.MethodEventInvoker.invokeEvent(MethodEventInvoker.java:70)
    at org.fabric3.implementation.pojo.reflection.ReflectiveImplementationManager.start(ReflectiveImplementationManager.java:126)
    at org.fabric3.implementation.pojo.component.PojoComponent.startInstance(PojoComponent.java:163)
    at org.fabric3.fabric.component.scope.SingletonScopeContainer.getInstance(SingletonScopeContainer.java:200)
    at org.fabric3.implementation.pojo.component.PojoComponent.getInstance(PojoComponent.java:144)
    at org.fabric3.implementation.pojo.injection.ComponentObjectFactory.getInstance(ComponentObjectFactory.java:66)
    at org.fabric3.implementation.pojo.reflection.ReflectiveObjectFactory.getInstance(ReflectiveObjectFactory.java:80)
    at org.fabric3.implementation.pojo.reflection.ReflectiveImplementationManager.newInstance(ReflectiveImplementationManager.java:105)
    at org.fabric3.implementation.pojo.component.PojoComponent.createInstance(PojoComponent.java:155)
    at org.fabric3.fabric.component.scope.SingletonScopeContainer.getInstance(SingletonScopeContainer.java:197)
    at org.fabric3.fabric.component.scope.SingletonScopeContainer.initializeComponents(SingletonScopeContainer.java:284)
    at org.fabric3.fabric.component.scope.SingletonScopeContainer.eagerInitialize(SingletonScopeContainer.java:268)
    at org.fabric3.fabric.component.scope.SingletonScopeContainer.startContext(SingletonScopeContainer.java:136)
    at org.fabric3.fabric.executor.StartContextCommandExecutor.execute(StartContextCommandExecutor.java:100)
    at org.fabric3.fabric.executor.StartContextCommandExecutor.execute(StartContextCommandExecutor.java:70)
    at org.fabric3.fabric.executor.CommandExecutorRegistryImpl.execute(CommandExecutorRegistryImpl.java:76)
    at org.fabric3.fabric.domain.LocalDeployer.execute(LocalDeployer.java:113)
    at org.fabric3.fabric.domain.LocalDeployer.deploy(LocalDeployer.java:93)
    at org.fabric3.fabric.domain.AbstractDomain.allocateAndDeploy(AbstractDomain.java:650)
    at org.fabric3.fabric.domain.AbstractDomain.instantiateAndDeploy(AbstractDomain.java:536)
    at org.fabric3.fabric.domain.AbstractDomain.include(AbstractDomain.java:249)
    at org.fabric3.fabric.runtime.DefaultCoordinator.loadExtensions(DefaultCoordinator.java:162)
    at org.fabric3.fabric.runtime.DefaultCoordinator.prepare(DefaultCoordinator.java:110)
    at org.fabric3.fabric.runtime.DefaultCoordinator.start(DefaultCoordinator.java:93)
    at org.fabric3.runtime.standalone.server.Fabric3Server.start(Fabric3Server.java:193)
    at org.fabric3.runtime.standalone.server.Fabric3Server.main(Fabric3Server.java:106)
[main] ERROR fabric3://runtime/JettyService - Jetty exception: FAILED org.eclipse.jetty.server.Server@70b2fa10: java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException: null
    at org.fabric3.timer.impl.ExecutorTimerService.execute(ExecutorTimerService.java:230)
    at org.fabric3.transport.jetty.impl.JettyServiceImpl$Fabric3ThreadPool.dispatch(JettyServiceImpl.java:708)
    at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:332)
    at org.eclipse.jetty.server.bio.SocketConnector.doStart(SocketConnector.java:156)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.Server.doStart(Server.java:288)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.fabric3.transport.jetty.impl.JettyServiceImpl.init(JettyServiceImpl.java:347)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.fabric3.implementation.pojo.reflection.MethodEventInvoker.invokeEvent(MethodEventInvoker.java:70)
    at org.fabric3.implementation.pojo.reflection.ReflectiveImplementationManager.start(ReflectiveImplementationManager.java:126)
    at org.fabric3.implementation.pojo.component.PojoComponent.startInstance(PojoComponent.java:163)
    at org.fabric3.fabric.component.scope.SingletonScopeContainer.getInstance(SingletonScopeContainer.java:200)
    at org.fabric3.implementation.pojo.component.PojoComponent.getInstance(PojoComponent.java:144)
    at org.fabric3.implementation.pojo.injection.ComponentObjectFactory.getInstance(ComponentObjectFactory.java:66)
    at org.fabric3.implementation.pojo.reflection.ReflectiveObjectFactory.getInstance(ReflectiveObjectFactory.java:80)
    at org.fabric3.implementation.pojo.reflection.ReflectiveImplementationManager.newInstance(ReflectiveImplementationManager.java:105)
    at org.fabric3.implementation.pojo.component.PojoComponent.createInstance(PojoComponent.java:155)
    at org.fabric3.fabric.component.scope.SingletonScopeContainer.getInstance(SingletonScopeContainer.java:197)
    at org.fabric3.fabric.component.scope.SingletonScopeContainer.initializeComponents(SingletonScopeContainer.java:284)
    at org.fabric3.fabric.component.scope.SingletonScopeContainer.eagerInitialize(SingletonScopeContainer.java:268)
    at org.fabric3.fabric.component.scope.SingletonScopeContainer.startContext(SingletonScopeContainer.java:136)
    at org.fabric3.fabric.executor.StartContextCommandExecutor.execute(StartContextCommandExecutor.java:100)
    at org.fabric3.fabric.executor.StartContextCommandExecutor.execute(StartContextCommandExecutor.java:70)
    at org.fabric3.fabric.executor.CommandExecutorRegistryImpl.execute(CommandExecutorRegistryImpl.java:76)
    at org.fabric3.fabric.domain.LocalDeployer.execute(LocalDeployer.java:113)
    at org.fabric3.fabric.domain.LocalDeployer.deploy(LocalDeployer.java:93)
    at org.fabric3.fabric.domain.AbstractDomain.allocateAndDeploy(AbstractDomain.java:650)
    at org.fabric3.fabric.domain.AbstractDomain.instantiateAndDeploy(AbstractDomain.java:536)
    at org.fabric3.fabric.domain.AbstractDomain.include(AbstractDomain.java:249)
    at org.fabric3.fabric.runtime.DefaultCoordinator.loadExtensions(DefaultCoordinator.java:162)
    at org.fabric3.fabric.runtime.DefaultCoordinator.prepare(DefaultCoordinator.java:110)
    at org.fabric3.fabric.runtime.DefaultCoordinator.start(DefaultCoordinator.java:93)
    at org.fabric3.runtime.standalone.server.Fabric3Server.start(Fabric3Server.java:193)
    at org.fabric3.runtime.standalone.server.Fabric3Server.main(Fabric3Server.java:106)
[main] ERROR fabric3://runtime - Error initializing component fabric3://runtime/CachingAuthenticationService ({urn:fabric3.org}SecurityExtension)
org.fabric3.spi.component.InstanceInitException: Error creating instance for: fabric3://runtime/CachingAuthenticationService
    at org.fabric3.fabric.component.scope.SingletonScopeContainer.getInstance(SingletonScopeContainer.java:219)
    at org.fabric3.fabric.component.scope.SingletonScopeContainer.initializeComponents(SingletonScopeContainer.java:284)
    at org.fabric3.fabric.component.scope.SingletonScopeContainer.eagerInitialize(SingletonScopeContainer.java:268)
    at org.fabric3.fabric.component.scope.SingletonScopeContainer.startContext(SingletonScopeContainer.java:136)
    at org.fabric3.fabric.executor.StartContextCommandExecutor.execute(StartContextCommandExecutor.java:100)
    at org.fabric3.fabric.executor.StartContextCommandExecutor.execute(StartContextCommandExecutor.java:70)
    at org.fabric3.fabric.executor.CommandExecutorRegistryImpl.execute(CommandExecutorRegistryImpl.java:76)
    at org.fabric3.fabric.domain.LocalDeployer.execute(LocalDeployer.java:113)
    at org.fabric3.fabric.domain.LocalDeployer.deploy(LocalDeployer.java:93)
    at org.fabric3.fabric.domain.AbstractDomain.allocateAndDeploy(AbstractDomain.java:650)
    at org.fabric3.fabric.domain.AbstractDomain.instantiateAndDeploy(AbstractDomain.java:536)
    at org.fabric3.fabric.domain.AbstractDomain.include(AbstractDomain.java:249)
    at org.fabric3.fabric.runtime.DefaultCoordinator.loadExtensions(DefaultCoordinator.java:162)
    at org.fabric3.fabric.runtime.DefaultCoordinator.prepare(DefaultCoordinator.java:110)
    at org.fabric3.fabric.runtime.DefaultCoordinator.start(DefaultCoordinator.java:93)
    at org.fabric3.runtime.standalone.server.Fabric3Server.start(Fabric3Server.java:193)
    at org.fabric3.runtime.standalone.server.Fabric3Server.main(Fabric3Server.java:106)
Caused by: org.fabric3.spi.objectfactory.ObjectCreationException: org.fabric3.spi.component.InstanceInitException: Error initializing instance for: fabric3://runtime/JettyService
    at org.fabric3.implementation.pojo.injection.ComponentObjectFactory.getInstance(ComponentObjectFactory.java:68)
    at org.fabric3.implementation.pojo.reflection.ReflectiveObjectFactory.getInstance(ReflectiveObjectFactory.java:80)
    at org.fabric3.implementation.pojo.reflection.ReflectiveImplementationManager.newInstance(ReflectiveImplementationManager.java:105)
    at org.fabric3.implementation.pojo.component.PojoComponent.createInstance(PojoComponent.java:155)
    at org.fabric3.fabric.component.scope.SingletonScopeContainer.getInstance(SingletonScopeContainer.java:197)
    ... 16 common frames omitted
Caused by: org.fabric3.spi.component.InstanceInitException: Error initializing instance for: fabric3://runtime/JettyService
    at org.fabric3.implementation.pojo.reflection.ReflectiveImplementationManager.start(ReflectiveImplementationManager.java:128)
    at org.fabric3.implementation.pojo.component.PojoComponent.startInstance(PojoComponent.java:163)
    at org.fabric3.fabric.component.scope.SingletonScopeContainer.getInstance(SingletonScopeContainer.java:200)
    at org.fabric3.implementation.pojo.component.PojoComponent.getInstance(PojoComponent.java:144)
    at org.fabric3.implementation.pojo.injection.ComponentObjectFactory.getInstance(ComponentObjectFactory.java:66)
    ... 20 common frames omitted
Caused by: org.fabric3.implementation.pojo.reflection.ObjectCallbackException: Exception thrown when invoking method: org.fabric3.transport.jetty.impl.JettyServiceImpl.init()
    at org.fabric3.implementation.pojo.reflection.MethodEventInvoker.invokeEvent(MethodEventInvoker.java:79)
    at org.fabric3.implementation.pojo.reflection.ReflectiveImplementationManager.start(ReflectiveImplementationManager.java:126)
    ... 24 common frames omitted
Caused by: org.fabric3.transport.jetty.impl.JettyInitializationException: Error starting Jetty service
    at org.fabric3.transport.jetty.impl.JettyServiceImpl.init(JettyServiceImpl.java:355)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.fabric3.implementation.pojo.reflection.MethodEventInvoker.invokeEvent(MethodEventInvoker.java:70)
    ... 25 common frames omitted
Caused by: java.lang.UnsupportedOperationException: null
    at org.fabric3.timer.impl.ExecutorTimerService.execute(ExecutorTimerService.java:230)
    at org.fabric3.transport.jetty.impl.JettyServiceImpl$Fabric3ThreadPool.dispatch(JettyServiceImpl.java:708)
    at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:332)
    at org.eclipse.jetty.server.bio.SocketConnector.doStart(SocketConnector.java:156)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.Server.doStart(Server.java:288)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.fabric3.transport.jetty.impl.JettyServiceImpl.init(JettyServiceImpl.java:347)
    ... 30 common frames omitted


On Java 6 (Java(TM) SE Runtime Environment (build 1.6.0_45-b06) - Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)) it works. It works on Java 7 (Java(TM) SE Runtime Environment (build 1.7.0_79-b15) - Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)) as well. But not on Java 8.

The code mentioned in stack trace is like this (org.fabric3.timer.impl.ExecutorTimerService):
    public void execute(Runnable command) {
       
throw new UnsupportedOperationException();
   
}

And the caller of that (org.fabric3.transport.jetty.impl.JettyServiceImpl):
        public boolean dispatch(Runnable work) {
            executorService
.execute(new JettyRunnable(work));
           
return true;
       
}

So, for some reason in Java 8 the executorService of JettyServiceImpl is wrong?

    @Constructor
    public JettyServiceImpl(@Reference ExecutorService executorService,
                            @Reference ManagementService managementService,
                            @Reference PortAllocator portAllocator,
                            @Reference HostInfo hostInfo,
                            @Monitor TransportMonitor monitor) {
       
this.executorService = executorService;

How does it choose the ExecutorService instance to inject in the constructor - depending on which JDK version it is run on?


Anyhow, even if we could get the 1.9.x to work with Java 8 and satisfy our customer with just a small amount of work, it would still be an outdated application lacking all the changes done in 2.x and 3.x. Which is not so good thing. But I guess it is better than sticking to Java 6 (or 7 as it seems to work okay - even though 7 is also out-dated). I do not think it is necessary at the monent to rush with the WebSocker support in 3.x or try to make 2.x work with our Spring/EhCahce thingies either. If we can get 1.9.6 to work in Java 8 with little effort, it would be the best now. 3.x will come eventually and have caching support and other new cool features and if our customer wants to continue using SCA then I think we need to rebuild the system from ground up using F3 3.x features - and perhaps do some architectural changes as well to better support the SCA model (as this was our first (and only) SCA project).


--teemu
...

Teemu Hiltunen

unread,
Nov 4, 2015, 4:26:53 AM11/4/15
to fabric3
I did some more testing. I builded the modified F3 1.9.6 with Java 8 and then tried to add profiles one by one into it.

Profiles JPA, RS and Spring went fine and F3 started without errors. But when I added the Timer profile I got this:

[INFO main 15:11:308 11:19:40.194] Timer service extension installed
[INFO main 15:11:308 11:19:40.288] DataSource extension installed
[INFO main 15:11:308 11:19:40.311] Atomikos library extension installed
[INFO main 15:11:308 11:19:40.327] JTA extension installed
[INFO main 15:11:308 11:19:40.500] HTTP extension installed
[INFO main 15:11:308 11:19:40.570] Timer implementation extension installed
[INFO main 15:11:308 11:19:40.600] JPA API installed
[INFO main 15:11:308 11:19:40.706] Hibernate library extension installed
[INFO main 15:11:308 11:19:40.762] Hibernate JPA extension installed
[INFO main 15:11:308 11:19:40.920] Spring extension installed
[INFO main 15:11:308 11:19:40.933] JMX management extension installed
[INFO main 15:11:308 11:19:40.968] Spring Security extension installed
[INFO main 15:11:308 11:19:41.045] JAX-RS (REST) extension installed
[INFO main 15:11:308 11:19:41.079] JAX-RS Jersey extension installed
[INFO main 15:11:308 11:19:41.158] Security will be disabled as a provider is not configured
[INFO main 15:11:308 11:19:41.205] HTTP listener started on port 8181
[ERROR main 15:11:308 11:19:41.214] Jetty exception: FAILED SocketC...@0.0.0.0:8181: java.lang.UnsupportedOperationException

java.lang.UnsupportedOperationException: null
    at org.fabric3.timer.impl.ExecutorTimerService.execute(ExecutorTimerService.java:230)
    at org.fabric3.transport.jetty.impl.JettyServiceImpl$Fabric3ThreadPool.dispatch(JettyServiceImpl.java:707)

    at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:332)
    at org.eclipse.jetty.server.bio.SocketConnector.doStart(SocketConnector.java:156)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.Server.doStart(Server.java:288)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.fabric3.transport.jetty.impl.JettyServiceImpl.init(JettyServiceImpl.java:346)
[ERROR main 15:11:308 11:19:41.215] Jetty exception: FAILED org.eclipse.jetty.server.Server@5dd903be: java.lang.UnsupportedOperationException

java.lang.UnsupportedOperationException: null
    at org.fabric3.timer.impl.ExecutorTimerService.execute(ExecutorTimerService.java:230)
    at org.fabric3.transport.jetty.impl.JettyServiceImpl$Fabric3ThreadPool.dispatch(JettyServiceImpl.java:707)

    at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:332)
    at org.eclipse.jetty.server.bio.SocketConnector.doStart(SocketConnector.java:156)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.Server.doStart(Server.java:288)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.fabric3.transport.jetty.impl.JettyServiceImpl.init(JettyServiceImpl.java:346)
[ERROR main 15:11:308 11:19:41.216] Error initializing component fabric3://runtime/CachingAuthenticationService ({urn:fabric3.org}SecurityExtension)
    at org.fabric3.transport.jetty.impl.JettyServiceImpl.init(JettyServiceImpl.java:354)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.fabric3.implementation.pojo.reflection.MethodEventInvoker.invokeEvent(MethodEventInvoker.java:70)
    ... 25 common frames omitted
Caused by: java.lang.UnsupportedOperationException: null
    at org.fabric3.timer.impl.ExecutorTimerService.execute(ExecutorTimerService.java:230)
    at org.fabric3.transport.jetty.impl.JettyServiceImpl$Fabric3ThreadPool.dispatch(JettyServiceImpl.java:707)

    at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:332)
    at org.eclipse.jetty.server.bio.SocketConnector.doStart(SocketConnector.java:156)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.Server.doStart(Server.java:288)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.fabric3.transport.jetty.impl.JettyServiceImpl.init(JettyServiceImpl.java:346)

    ... 30 common frames omitted
org.fabric3.fabric.runtime.ExtensionInitializationException: Error deploying extensions
    at org.fabric3.fabric.runtime.DefaultCoordinator.loadExtensions(DefaultCoordinator.java:178)

    at org.fabric3.fabric.runtime.DefaultCoordinator.prepare(DefaultCoordinator.java:110)
    at org.fabric3.fabric.runtime.DefaultCoordinator.start(DefaultCoordinator.java:93)
    at org.fabric3.runtime.standalone.server.Fabric3Server.start(Fabric3Server.java:193)
    at org.fabric3.runtime.standalone.server.Fabric3Server.main(Fabric3Server.java:106)
Caused by: org.fabric3.host.domain.DeploymentException: org.fabric3.spi.executor.ExecutionException: Error initializing components
    at org.fabric3.fabric.domain.LocalDeployer.execute(LocalDeployer.java:117)

    at org.fabric3.fabric.domain.LocalDeployer.deploy(LocalDeployer.java:93)
    at org.fabric3.fabric.domain.AbstractDomain.allocateAndDeploy(AbstractDomain.java:650)
    at org.fabric3.fabric.domain.AbstractDomain.instantiateAndDeploy(AbstractDomain.java:536)
    at org.fabric3.fabric.domain.AbstractDomain.include(AbstractDomain.java:249)
    at org.fabric3.fabric.runtime.DefaultCoordinator.loadExtensions(DefaultCoordinator.java:162)
    ... 4 more
Caused by: org.fabric3.spi.executor.ExecutionException: Error initializing components
    at org.fabric3.fabric.executor.StartContextCommandExecutor.execute(StartContextCommandExecutor.java:109)

    at org.fabric3.fabric.executor.StartContextCommandExecutor.execute(StartContextCommandExecutor.java:70)
    at org.fabric3.fabric.executor.CommandExecutorRegistryImpl.execute(CommandExecutorRegistryImpl.java:76)
    at org.fabric3.fabric.domain.LocalDeployer.execute(LocalDeployer.java:113)
    ... 9 more
Caused by: Error initializing components
    at org.fabric3.fabric.component.scope.SingletonScopeContainer.initializeComponents(SingletonScopeContainer.java:295)

    at org.fabric3.fabric.component.scope.SingletonScopeContainer.eagerInitialize(SingletonScopeContainer.java:268)
    at org.fabric3.fabric.component.scope.SingletonScopeContainer.startContext(SingletonScopeContainer.java:136)
    at org.fabric3.fabric.executor.StartContextCommandExecutor.execute(StartContextCommandExecutor.java:100)
    ... 12 more


Which seems pretty much like the same errors as earlier with the full stack of our application.

I took Timer Profile out and tried two more profiles we use in our application: Web and WS. They both worked okay.

So, it seems that only Timer Profile does not work in Java 8.


--teemu



       
try<span style="color
Reply all
Reply to author
Forward
0 new messages