[JBoss Cache: Core Edition] - Re: Do you prefer a tree or a plain map API for your project
by genman
I contributed a class that creates a Map style view... not sure it's really that optimized or not. I wrote it since I thought it might integrate better with our own API but nobody here seems to care either way.
Here's the API:
anonymous wrote :
| <K, V> Map<K, V> org.jboss.cache.util.Caches.asMap(Node<K, V> node)
| Returns a Map, where map keys are named children of the given Node, and values are kept under a single key for this node. The map may be safely concurrently modified through this Map or externally, and its contents reflect the cache state and existing data of the Node. This means that ConcurrentModificationException is never thrown and all methods are thread safe.
|
| The map is not serializable.
|
| Usage note: As a single node is used for every key, it is most efficient to store data for a single entity (e.g. Person) in a single object.
|
| Also, when using a CacheLoader for storage, keys used must be valid as part of the Fqn used in calls. Generally speaking, simple string values are preferred.
|
| Parameters:
| node node in a cache to wrap
| Returns:
| a Map representation of the cache
|
The problem with the JBoss Cache API (IMHO) is having a Map per node. Having a single Object per node would have worked out almost as well to most end users and would have simplified internal development for the product.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4187589#4187589
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4187589
17 years, 5 months
[EJB 3.0] - Class cast exception running rmi over http
by eartromick
When running rmi over http we et the following exception:
We are running jboss 4.3.0.GA
22:58:37,553 -[::http-10.21.1.20-8080-6]- DEBUG [InvokerServlet] Invoke threw exception
java.lang.ClassCastException: org.jboss.remoting.InvocationRequest cannot be cast to org.jboss.invocation.MarshalledInvocation
at org.jboss.invocation.http.servlet.InvokerServlet.processRequest(InvokerServlet.java:137)
at org.jboss.invocation.http.servlet.InvokerServlet.doPost(InvokerServlet.java:224)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:619)
22:58:42,379 -[::http-10.21.1.20-8080-2]- DEBUG [InvokerServlet] Invoke threw exception
java.lang.ClassCastException: org.jboss.remoting.InvocationRequest cannot be cast to org.jboss.invocation.MarshalledInvocation
at org.jboss.invocation.http.servlet.InvokerServlet.processRequest(InvokerServlet.java:137)
at org.jboss.invocation.http.servlet.InvokerServlet.doPost(InvokerServlet.java:224)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4187585#4187585
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4187585
17 years, 5 months
[Persistence, JBoss/CMP, Hibernate, Database] - Java Persistence CLOB exception
by sbattarusetty
Hi,
I am getting the exception (java.sql.SQLException: operation not allowed: streams type cannot be used in batching) while persistent Clob column under JBoss 4.2.3 and Java 6 environment. Does anyone know how fix this exception?
@Lob
@Basic(fetch=FetchType.LAZY)
@Column(name="source_xml")
public String getSourceXml() {
return sourceXml;
}
public void setSourceXml(String sourceXml) {
this.sourceXml = sourceXml;
}
2008-11-06 18:53:35,741 (WorkManager(2)-21:) DEBUG JDBCExceptionReporter.logExceptions - could not insert: [com.ghx.ci.purchaseorder.ejb.entity.CIPurchaseOrderEntityBean] [insert into ci_purchase_order (releasenumber, buyer_id, supplier_id, source_xml, id) values (?, ?, ?, ?, ?)]
java.sql.SQLException: operation not allowed: streams type cannot be used in batching
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.driver.OraclePreparedStatement.addBatch(OraclePreparedStatement.java:4073)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.addBatch(WrappedPreparedStatement.java:386)
at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:31)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2247)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:515)
at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:114)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:247)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86)
at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1389)
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
at org.jboss.resource.adapter.jms.inflow.JmsServerSession$XATransactionDemarcationStrategy.end(JmsServerSession.java:494)
at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:248)
at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:756)
at java.lang.Thread.run(Unknown Source)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4187574#4187574
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4187574
17 years, 5 months
[EJB 3.0] - PostContruct not being called
by mohitanchlia
Using jboss 4.2. I have a simple Bean
but when I deploy it in jboss PostConstruct doesn't get called. Is that a bug? I can see that Bean in started state in JMX console though
---
| @Stateless
| @Local
| @LocalBinding (jndiBinding="queue/monitor")
| public class QueueMonitorTimerServiceBean implements QueueMonitorTimerService{
|
| @Resource
| javax.ejb.TimerService timerService;
| List<BlockingRule> blockingRules = null;
| private static final int REFERSH_TIMEOUT = 30 * 1000;
| private static final Log logger = LogFactory.getLog(QueueMonitorTimerServiceBean.class);
|
| @PostConstruct
| public void postConstruct(){
| logger.info(" Initializing Queue Monitor Timer Service ");
| System.out.println("INIT QUEUE ");
| Timer timer = timerService.createTimer(REFERSH_TIMEOUT , "Blocking Rule Timer");
| }
|
| public List<BlockingRule> getActiveBlockingRules() {
| // TODO Auto-generated method stub
| return blockingRules;
| }
|
| @Timeout
| public void timeout(Timer time){
| logger.info(" Timeout of Queue Monitor Timer Service ");
| }
|
| public List<BlockingRule> getBlockingRules() {
| // TODO Auto-generated method stub
| return null;
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4187571#4187571
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4187571
17 years, 5 months