[JBoss Seam] - Second level cache (ehcache) working?
by shakenbrain
Has anyone been able to get ehcache working in a Seam application? I've enabled ehcache in my persistence unit:
<property name="hibernate.cache.use_second_level_cache" value="true"/>
| <property name="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider"/>
and enabled caching for one of my entities:
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
| public class Organization extends PersistentObject {
| ...
| }
I created a basic ehcache.xml file as follows:
<ehcache>
|
| <diskStore path="java.io.tmpdir"/>
|
| <defaultCache
| maxElementsInMemory="10000"
| eternal="false"
| timeToIdleSeconds="120"
| timeToLiveSeconds="120"
| overflowToDisk="true"
| diskPersistent="false"
| diskExpiryThreadIntervalSeconds="120"
| memoryStoreEvictionPolicy="LRU"
| />
|
| </ehcache>
I put ehcache.xml into a jar file called ehcache.jar in server/default/lib so ehcache is able to find it. Where is this file really supposed to go? Does it really have to live there because that's where ehcache-1.2.3.jar is?
After loading an entity in my Seam application I update it in underlying database using an external application. I would expect the entity to remain unchanged when viewing in it my Seam application because the object should be cached, but it's obviously being reloaded from the database.
Any ideas?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046235#4046235
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046235
19 years
[JBossWS] - Caused by: java.lang.ClassNotFoundException: org.jboss.ws.WS
by marco.ciatti
Hi All,
I'm currently making some tests with
-) jbossws.1.2.1.GA,
-) Java5, Jboss-4.0.5-GA (EJB3 cluster)
using a stateless ejb3 (deployed on Jboss-AS) as Webservice client towards a remote Webservice server based on a Sun SOA platform.
An external standalone-client call an EJB service, using the remote interface of the EJB, and:
-) If the remote webservice is up I have no problem
-) If the webservice is down than I have the exception below.
Of course an exception is expexted but here it seems that the AS is not able to recontruct the org.jboss.ws.WSException class.
Such a class is defined into the jbossws-client.jar and I did some tests putting such jar into the EJB jar or into the EAR, but nothing changed...
Does anybody have an explanation for this ?
Could be a class loader problem, I mean jbossws use a class loader that is different from the one used to load the EJB stuff and the serialized class could not be recontructed into the EJB scope since it has been serialized bu jbossws stuff ?
Thankx,
Marco
Buildfile: D:\develop\wfm\test\fwfaxprx\build.xml
prepare:
tstcompile:
[javac] Compiling 1 source file to D:\develop\wfm\test\fwfaxprx\build\classes
run.client:
[java] The connected device Kind is : FaxServer
[java] Getting a random fax status
[java] Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
[java] at $Proxy0.getItemSts(Unknown Source)
[java] at com.siemens.fw.test.FwFaxPrxTest.main(FwFaxPrxTest.java:30)
[java] Caused by: java.lang.ClassNotFoundException: org.jboss.ws.WSException
[java] at java.net.URLClassLoader$1.run(Unknown Source)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at java.net.URLClassLoader.findClass(Unknown Source)
[java] at java.lang.ClassLoader.loadClass(Unknown Source)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
[java] at java.lang.ClassLoader.loadClass(Unknown Source)
[java] at org.jboss.remoting.loading.RemotingClassLoader.loadClass(RemotingClassLoader.java:50)
[java] at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:139)
[java] at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
[java] at java.io.ObjectInputStream.readClassDesc(Unknown Source)
[java] at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
[java] at java.io.ObjectInputStream.readObject0(Unknown Source)
[java] at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
[java] at java.io.ObjectInputStream.readSerialData(Unknown Source)
[java] at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
[java] at java.io.ObjectInputStream.readObject0(Unknown Source)
[java] at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
[java] at java.io.ObjectInputStream.readSerialData(Unknown Source)
[java] at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
[java] at java.io.ObjectInputStream.readObject0(Unknown Source)
[java] at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
[java] at java.io.ObjectInputStream.readSerialData(Unknown Source)
[java] at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
[java] at java.io.ObjectInputStream.readObject0(Unknown Source)
[java] at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
[java] at java.io.ObjectInputStream.readSerialData(Unknown Source)
[java] at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
[java] at java.io.ObjectInputStream.readObject0(Unknown Source)
[java] at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
[java] at java.io.ObjectInputStream.readSerialData(Unknown Source)
[java] at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
[java] at java.io.ObjectInputStream.readObject0(Unknown Source)
[java] at java.io.ObjectInputStream.readObject(Unknown Source)
[java] at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128)
[java] at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66)
[java] at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:279)
[java] at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
[java] at org.jboss.remoting.Client.invoke(Client.java:525)
[java] at org.jboss.remoting.Client.invoke(Client.java:488)
[java] at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55)
[java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
[java] at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
[java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
[java] at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
[java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
[java] at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77)
[java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
[java] at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
[java] ... 2 more
[java] Java Result: 1
BUILD SUCCESSFUL
Total time: 3 seconds
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046234#4046234
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046234
19 years
[JBoss Seam] - Mail sending error
by demetrio812
Hi,
I have this mail template:
| <m:message xmlns="http://www.w3.org/1999/xhtml"
| xmlns:m="http://jboss.com/products/seam/mail"
| xmlns:h="http://java.sun.com/jsf/html">
|
| <m:from name="Upload4Freedom" address="info(a)upload4freedom.com" />
| <m:to name="info">filocamo(a)demetrio.it</m:to>
| <m:subject>Message from Contact Form</m:subject>
|
| <m:body>
| <p>
| <h:outputText value="Name: #{ContactForm.name}" />
| <h:outputText value="E-mail: #{ContactForm.email}" />
| <h:outputText value="Message: #{ContactForm.msg}" />
| </p>
| </m:body>
|
| </m:message>
|
and I'm trying to send it with this method:
| public void sendEmail()
| {
| try {
| renderer.render("/mailTemplate.xhtml");
| facesMessages.add("E-mail sent, thank you!");
| }
| catch (Exception e) {
| facesMessages.add("Email sending failed: " + e.getMessage());
| }
| }
|
I also tried various combination of configuration in components.xml, like this:
| <mail:mail-session host="smtp.tiscali.it" port="25" debug="true" ssl="false" />
|
or:
| <mail:mail-session host="smtp.tiscali.it" port="25" username="" password="" debug="true" ssl="false" />
|
but the error I got is:
| No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions! If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml. A typical config looks like this; <listener> <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class> </listener>
|
How can I solve this problem? I use the latest version of seam with JBoss AS.
Thanks a lot!
Demetrio Filocamo
(filocamo(a)demetrio.it)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046229#4046229
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046229
19 years