[EJB3] - @SequenceGenerator initial value
by Noa Drach
Noa Drach [http://community.jboss.org/people/newway] created the discussion
"@SequenceGenerator initial value"
To view the discussion, visit: http://community.jboss.org/message/574564#574564
--------------------------------------------------------------
@Id
@GeneratedValue(strategy = SEQUENCE, generator = "SEQ_ACE_ACTIVE_CI")
@SequenceGenerator(name = "SEQ_ACE_ACTIVE_CI", sequenceName = "SEQ_ACE_ACTIVE_CI", allocationSize = 500)
I'm running on JBOSS 4.2.3.GA for java 6
in my entities I connect between a real DB sequence and the Id field in the following way
@Id
@GeneratedValue(strategy = SEQUENCE, generator = "SEQ_NAME")
@SequenceGenerator(name = "SEQ_NAME", sequenceName = "SEQ_NAME", allocationSize = 500)
I put the allocation size as 500 since after some performance tests i run i saw that prevents it from going to the DB for each insert and doing
select seq.nextval from dual
- I'm using Oracle , and the above is probably not the exact syntax, just the general idea.
the thing is that although my sequence is defined with an initial value of 1000 in the DB is see that all my generated entities start with id 500000 and each time I restart my server it jumps in 500 and in the meanwhile if I look at my sequences I see that the don't progress above the initial value of 1000.
I feel stupid just asking this question, but if you can just explain to me what's missing in my understanding or point me to where this was already discussed I'll be grateful, since I couldn't find the explanation on my own. :-/
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/574564#574564]
Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 9 months
[JBoss Cache] - PojoCache
by Sagar N
Sagar N [http://community.jboss.org/people/vsnallu] created the discussion
"PojoCache"
To view the discussion, visit: http://community.jboss.org/message/589637#589637
--------------------------------------------------------------
Hi,
I am using PojoCache in my project. I used @org.jboss.cache.pojo.annotation.Replicable annotation for the data class and the classes it is referring. Used the ant task "aopc" to precompile the classes for instrumentation. I am using CacheManager to get my pojoCache. I am attaching a data class to pojoCache in contextInitialized of a class that extends ServletContextListener. This data class get's its data from database. First node in the cluster is starting without any issues. When I start the second node in the cluster, in the contextInitialized method the find method of pojoCache is throwing the ClassNotFound Exception. The class it could not found is one of the class my data class is referring. I am annotating all the classes the data class is referring with @replicable.
Please help me in resolving the issue.
Thanks & Regards,
Sagar
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/589637#589637]
Start a new discussion in JBoss Cache at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 9 months
[jBPM] - no transaction started on this thread
by Odelya Holiday
Odelya Holiday [http://community.jboss.org/people/odelyaholiday] created the discussion
"no transaction started on this thread"
To view the discussion, visit: http://community.jboss.org/message/589918#589918
--------------------------------------------------------------
When I run:
ProcessInstance pi = ksession.startProcess("MyBookAcquiring",parameters);
I get:
2011-02-27 19:12:58,643 ERROR (SingleSessionCommandService.java:319) - Could not rollback
java.lang.RuntimeException: Unable to rollback transaction
at org.drools.persistence.jta.JtaTransactionManager.rollback(JtaTransactionManager.java:184)
at org.drools.persistence.SingleSessionCommandService.rollbackTransaction(SingleSessionCommandService.java:317)
at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:302)
at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:219)
at ws.process.BindBookProcessBindingImpl.startProcess(BindOnMediaProcessBindingImpl.java:27)
at ws.process.BindBookProcessBindingSkeleton.startProcess(BindOnMediaProcessBindingSkeleton.java:68)
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.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
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:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.IllegalStateException: no transaction started on this thread
at bitronix.tm.BitronixTransactionManager.rollback(BitronixTransactionManager.java:103)
at org.drools.persistence.jta.JtaTransactionManager.rollback(JtaTransactionManager.java:181)
Why would I get it?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/589918#589918]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 9 months
[JBoss Portal] - Need help running Jboss portal 2.7.2 with oracle XE
by anand9722
anand9722 [http://community.jboss.org/people/anand9722] created the discussion
"Need help running Jboss portal 2.7.2 with oracle XE"
To view the discussion, visit: http://community.jboss.org/message/589901#589901
--------------------------------------------------------------
Hi,
I downloaded and installed Jboss portal 2.7.2, created a database user with appropriate permission.
Changed the hibernate dialect to oracle 10g and database driver to oracle.jdbc.OracleDriver.
However I am getting the below exception when starting jboss:
13:11:42,171 ERROR [MainDeployer] Could not initialise deployment: file:/D:/jboss-portal-2.7.2/server/default/deploy/jboss-portal.sar/portal-wsrp.sar/default-wsrp.xml
org.jboss.deployment.DeploymentException: Failed to parse source: Couldn't create Consumer 'self'; - nested throwable: (org.jboss.xb.binding.JBossXBException: Failed to parse source: Couldn't create C
onsumer 'self')
at org.jboss.portal.wsrp.deployment.WSRPDeployer.init(WSRPDeployer.java:111)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:872)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:809)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
..............
Caused by: org.hibernate.exception.SQLGrammarException: could not get next sequence value
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:96)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:99)
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:618)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:592)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:596)
at org.jboss.portal.wsrp.consumer.ConsumerRegistryService.org$jboss$portal$wsrp$consumer$ConsumerRegistryService$createConsumer$aop(ConsumerRegistryService.java:95)
... 168 more
Caused by: java.sql.SQLSyntaxErrorException: ORA-02289: sequence does not exist
I tried to create the sequences manuall using the below command but it was no good:
create sequence hibernate_sequence;
create sequence portal_seq;
create sequence sec_seq;
create sequence instance_seq;
create sequence portlet_seq;
create sequence user_seq;
Below is the portal-oracle-ds.xml entries
<datasources>
<local-tx-datasource>
<jndi-name>PortalDS</jndi-name>
<connection-url>jdbc:oracle:thin:jbossportal/jbossportal@localhost:1521/XE</connection-url>
<driver-class>oracle.jdbc.OracleDriver</driver-class>
<user-name>jbossportal</user-name>
<password>jbossportal</password>
</local-tx-datasource>
</datasources>
and these are the SQL statements I used to create the user for Jboss portal:
create user jbossportal identified by jbossportal;
create temporary tablespace jboss_portal_temp tempfile 'C:\oraclexe\oradata\XE\jboss_portal_temp.dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED;
create tablespace jboss_portal_sys datafile 'C:\oraclexe\oradata\XE\jboss_portal_sys.dbf' size 200M reuse autoextend on next 5120k maxsize unlimited;
ALTER USER jbossportal temporary tablespace jboss_portal_temp default tablespace jboss_portal_sys quota unlimited on jboss_portal_sys;
GRANT CREATE SESSION TO jbossportal;
GRANT ALTER ANY TABLE to jbossportal;
GRANT SELECT ANY TABLE to jbossportal;
GRANT UPDATE ANY TABLE to jbossportal;
GRANT DROP ANY TABLE to jbossportal;
GRANT CREATE ANY SEQUENCE to jbossportal;
GRANT ALTER ANY SEQUENCE to jbossportal;
GRANT DROP ANY SEQUENCE to jbossportal;
GRANT SELECT ANY SEQUENCE to jbossportal;
and I have placed ojdbc6.jar in JBOSS_HOME\server\default\lib folder....
Any idea where I am going wrong ? Any help would greatly be appreciated,
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/589901#589901]
Start a new discussion in JBoss Portal at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 9 months
[JBoss Web Services] - SoapAction not required?
by Worrow W
Worrow W [http://community.jboss.org/people/worrow] created the discussion
"SoapAction not required?"
To view the discussion, visit: http://community.jboss.org/message/589821#589821
--------------------------------------------------------------
Hi,
I got some Web Service running in Jboss 4.2.3GA. Tried to build a console client that use the Service with SoapMessage.
Here is the code below:
// --------------------------------------------------------------------------------------------------------------------------------------------------------------
SOAPMessage requestMsg = SoapUtils.emptyMessage();
SOAPPart soapPart = requestMsg.getSOAPPart();
SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
SOAPBody soapBody = soapEnvelope.getBody();
SOAPHeader soapHeader = soapEnvelope.getHeader();
soapEnvelope.setEncodingStyle(" http://schemas.xmlsoap.org/soap/encoding/ http://schemas.xmlsoap.org/soap/encoding/");
requestMsg.getMimeHeaders().addHeader("SOAPAction", "urn:enquireDataset");
Name bodyName = soapEnvelope.createName("enquireDataset", "fd",
" http://impl.ws.eadi.com http://impl.ws.eadi.com");
SOAPBodyElement bodyElement = soapBody.addBodyElement(bodyName);
// userID
Name userID_soap = soapEnvelope.createName("userID", "fd",
" http://impl.ws.eadi.com http://impl.ws.eadi.com");
SOAPElement soapElement = bodyElement.addChildElement(userID_soap);
soapElement.addTextNode(userID);
// password
Name password_soap = soapEnvelope.createName("password", "fd",
" http://impl.ws.eadi.com http://impl.ws.eadi.com");
soapElement = bodyElement.addChildElement(password_soap);
soapElement.addTextNode(password);
// logicalDatasetName
Name logicalDatasetName_soap = soapEnvelope.createName(
"logicalDatasetName", "fd", " http://impl.ws.eadi.com http://impl.ws.eadi.com");
soapElement = bodyElement.addChildElement(logicalDatasetName_soap);
soapElement.addTextNode(logicalDatasetname);
// --------------------------------------------------------------------------------------------------------------------------------------------------------------
When I called the service, Jboss server threw:
10:27:56,125 ERROR [[AxisServlet]] Servlet.service() for servlet AxisServlet thr
ew exception
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1938)
But after I replaced the SoapAction line with 'requestMsg.getMimeHeaders().addHeader("Content-Type", "text/xml");', it works fine. What is the reason behind this? Is the value of "SOAPAction" caused the problem[I copied it from wsdl, action tag]? Or in some case, SoapAction is not required at all?
Any help will be really appreciated! Thanks in advance.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/589821#589821]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 9 months
[JBoss Tools] - Re: JBoss tools 3.2B1 sometimes doesn't deploy classes in web module
by arjan tijms
arjan tijms [http://community.jboss.org/people/atijms] created the discussion
"Re: JBoss tools 3.2B1 sometimes doesn't deploy classes in web module"
To view the discussion, visit: http://community.jboss.org/message/587735#587735
--------------------------------------------------------------
> Jan Beernink wrote:
>
> I've also noticed the issue of seemingly random libraries being listed as deployable modules in the servers view. After I did some investigating, I noticed that all of the libraries listed as deployable module contained a Main-Class entry in their manifest file.
>
>
Great find! This seems indeed to be the case. Almost all of the libraries I mentioned earlier indeed have this main class listed!
More precisely, the ones I mentioned that have "J2EE Application Client Module" when I hover with the mouse over them are the ones who have this Main-Class entry.
The one that said "J2EE EJB Module" doesn't have this Main-Class, but it does have classes with EJB annotations. However, since this particular jar is in the EAR/lib directory, it doesn't seem JBoss tools has to do anything special with it regarding deployment.
After I upgraded to JBoss tools 3.2 CR1 I now get the following in my log after I do a clean/full deploy:
!ENTRY org.jboss.ide.eclipse.as.core 0 33685505 2011-02-16 13:15:39.610
!MESSAGE Module my_main published without error.
!ENTRY org.jboss.ide.eclipse.as.core 0 33685505 2011-02-16 13:15:39.614
!MESSAGE Module jbosscache-core.jar published without error.
!ENTRY org.jboss.ide.eclipse.as.core 0 33685505 2011-02-16 13:15:39.618
!MESSAGE Module jgroups.jar published without error.
!ENTRY org.jboss.ide.eclipse.as.core 0 33685505 2011-02-16 13:15:39.627
!MESSAGE Module my_ejb_client.jar published without error.
!ENTRY org.jboss.ide.eclipse.as.core 0 33685505 2011-02-16 13:15:39.670
!MESSAGE Module some_main_ejb published without error.
!ENTRY org.jboss.ide.eclipse.as.core 0 33685505 2011-02-16 13:15:40.238
!MESSAGE Module my_main_web published without error.
!ENTRY org.jboss.ide.eclipse.as.core 0 33685505 2011-02-16 13:15:40.249
!MESSAGE Module jxl.jar published without error.
!ENTRY org.jboss.ide.eclipse.as.core 0 33685505 2011-02-16 13:15:40.265
!MESSAGE Module saxon9.jar published without error.
In this case, the actual deployment that is copied to JBoss AS is simply:
my_main
my_main_ejb
my_main_web
lib
jbosscache-core.jar
jgroups.jar
some_ejb_client.jar
commons-codec.jar
... [bunch of other jars]
joda-time.jar
As can be seen, the jars that are somehow treated "differently' by the deployer all simply end up in my_main/lib. It's highly confusing that the deployer as well as the GUI treats them differently.
Since CR1 is does say "published without error" now. Unfortunately, it still hapens that when I save a single file, the deployer suddenly pulishes 1000+ other files, and eventually this gives me a deployment with lots of deleted (missing) files as I have been seeing since the first beta versions of JBoss tools 3.2.
I've also now confirmed seeing the problem on a completely different machine, but same project (different OS too: Unbuntu vs OS X), so this would rule out a local installation problem.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/587735#587735]
Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 9 months