[EJB 3.0] - deploy jdeveloper (ejb-jsf) app to jboss
by avonm
I have developed a very simple web application with Oracle JDeveloper 10.1.3.1 j2ee edition (no adf). The application uses ejb 3.0 and jsf technology.
The application has two projects: Model and ViewController. To deploy the application I created an ejb jar deployment profile for the model project and a war deployment profile for the ViewController. Then I created a new ?Deployment? project with an ear deployment profile to assemble the ejb jar and war deployment profiles. In this way I was able to deploy to standalone oc4j.
Now I want to deploy to jboss 4.0.5 GA, I mapped the jboss connection within jdev and selected ?deploy to jboss?. The ear file is transferred to the correct folder, but the application folder is not generated and the jboss log shows at least one error. It seems it expects a local-home tag in the web.xml (related to a session bean).
Below I enclose the jboss log and my web.xml file. As you can see in the web.xml the <local-home> tag is really missing. But home interfaces should not be used in ejb 3.0.
I really need help on this topic, thank you.
Mauro
2006-12-01 16:20:51,250 WARN [org.jboss.util.NestedThrowable] Duplicate throwable nesting of same base type: class org.jboss.deployment.DeploymentException is assignable from: class org.jboss.deployment.DeploymentException
2006-12-01 16:20:51,250 DEBUG [org.jboss.web.tomcat.tc5.Tomcat5] Problem in init
org.jboss.deployment.DeploymentException: Failed to parse WEB-INF/web.xml; - nested throwable: (org.jboss.deployment.DeploymentException: expected one local-home tag)
at org.jboss.web.AbstractWebContainer.parseMetaData(AbstractWebContainer.java:749)
at org.jboss.web.AbstractWebContainer.init(AbstractWebContainer.java:356)
<?xml version = '1.0' encoding = 'windows-1252'?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
Empty web.xml file for Web Application
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>35</session-timeout>
</session-config>
<mime-mapping>
html
<mime-type>text/html</mime-type>
</mime-mapping>
<mime-mapping>
txt
<mime-type>text/plain</mime-type>
</mime-mapping>
<jsp-config/>
<ejb-local-ref>
<ejb-ref-name>ejb/ProvaScrFacade</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
provascr.business.ProvaScrFacadeLocal
<ejb-link>ProvaScrFacade</ejb-link>
</ejb-local-ref>
</web-app>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991346#3991346
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991346
19 years, 7 months
[JBoss jBPM] - Extension point for Transactions
by pirx
jBpm provides fine extensions points for Nodes, Actions and the like
when defining the workflow with JDPL. Unfortunately, Transitions can't
be extended in a similar fashion and are always connected to the
default implementation provided by jBpm when using JDPL.
I now have a use case, where I want to add a type attribute to a
Transition needed by some node for a decision which leaving transition to take. Actually, I do this by keeping the transition-type
association in the surrounding node, but this is obviously redundant.
Example:
| <x-state>
| <transition name='to-s' to='s'/>
| <transition-types>
| <transition name='to-s' type="manual"/>
| </transition-types>
| </x-state>
|
With the possibility of an extension of this transition this could be
reduced to:
| <x-state>
| <x-transition type='manual' to='s'/>
| </x-state>
|
Introducing this into JpdlXmlReader.resolveTransitionDestination()
shouldn't be difficult and is perfectly backwards compatible. If you
like, I could do it and provide a patch.
Is there any chance to get an extension mechanism for transistions
into jBpm ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991344#3991344
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991344
19 years, 7 months
[JBoss Seam] - problem passivation thread: ConcurrentModificationException
by lowecg2004
Every now and then I get the following message in my logs:
2006-12-05 12:27:09,109 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying event context
| 2006-12-05 12:27:09,109 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroyContext.EVENT
| 2006-12-05 12:27:09,109 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.manager
| 2006-12-05 12:27:09,109 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroy.org.jboss.seam.core.manager
| 2006-12-05 12:27:09,109 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postDestroyContext.EVENT
| 2006-12-05 12:27:09,109 DEBUG [org.jboss.seam.contexts.Lifecycle] <<< End call
| 2006-12-05 12:27:09,109 DEBUG [org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager] Saving session state to: C:\bin\seam\jboss-4.0.5.GA\server\default\tmp\sessions\SessionTimeoutHandlerHome-evc97who-j\5c4o1d3r-qbr45g-evc97n34-1-evc9ht00-13.ser
| 2006-12-05 12:27:09,249 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@15d925b, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@524a69{ url=null ,addedOrder=0}
| 2006-12-05 12:27:09,249 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@15d925b, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@9336bd{ url=null ,addedOrder=0}
| 2006-12-05 12:27:09,265 DEBUG [org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager] Passivation complete; id=5c4o1d3r-qbr45g-evc97n34-1-evc9ht00-13
| 2006-12-05 12:27:09,265 ERROR [org.jboss.ejb3.cache.simple.SimpleStatefulCache] problem passivation thread
| java.util.ConcurrentModificationException
| at java.util.LinkedHashMap$LinkedHashIterator.remove(LinkedHashMap.java:356)
| at org.jboss.ejb3.cache.simple.SimpleStatefulCache$SessionTimeoutTask.run(SimpleStatefulCache.java:132)
| 2006-12-05 12:31:17,104 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000
| 2006-12-05 12:38:47,100 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000
| 2006-12-05 12:41:50,052 DEBUG [org.jboss.seam.contexts.Lifecycle] End of session, destroying contexts
| 2006-12-05 12:41:50,052 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying conversation contexts: []
| 2006-12-05 12:41:50,052 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying session context
I'm using Seam 1.1 CR2, CVS 04-12-2006.
I haven't noticed any erratic behaviour in my application and as far as I can tell, this has just started to happen recently.
Cheers,
C.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991320#3991320
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991320
19 years, 7 months
[Installation, Configuration & Deployment] - Re: Shared classpath within an EAR?
by lightbulb432
Norman, thanks for the response. A couple follow-up questions for you.
I've been reading up on classpaths in Java EE and it seems you can configure classpaths by putting information into the MANIFEST.MF file. However, it seems like in JBoss you don't really "need" to do it, because classpaths are always magically found regardless.
Should I put classpath information into the MANIFEST.MF? Or is it not necessary and just redundant?
Secondly, I tried putting all the libraries for my EAR into my EJB JAR's lib folder...however, my WAR started complaining that it couldn't find one of the .tld files, even though it was there within the JAR...is there an exception to what you said with tag libraries?
What are all the options JBoss has for configuring classpaths? Where are all the places I have the option of putting it within the EAR? Some work better than others in JBoss...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991314#3991314
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991314
19 years, 7 months
[JBossWS] - Re: java.lang.NoSuchMethodError: javax.jws.WebService.portNa
by hroriz
I am having the same problem as Marco. I did what was suggested but unfortunately did not succeed. I updated the directories, it's ok. The file ejb3-persistence.jar can be found in different directories:
jboss-4.0.4.GA\server\default\deploy\ejb3.deployer\
jboss-4.0.4.GA\client\
jboss-4.0.4.GA\server\default\lib\
Should I update on all 3 dirs?
I updated in all dirs and I get the following error:
ERROR [MainDeployer] Could not create deployment: HYPERLINK file:/C:/jboss-4.0.4.GA/server/default/deploy/ejb3.deployer/ file:/C:/jboss-4.0.4.GA/server/default/deploy/ejb3.deployer/
| org.jboss.deployment.DeploymentException: Trying to install an already registered mbean: jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3
| at org.jboss.system.ServiceCreator.install(ServiceCreator.java:103)
| at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:449)
| at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
| at org.jboss.system.ServiceController.install(ServiceController.java:226)
| (...)
|
| ERROR [MainDeployer] Could not create deployment: HYPERLINK file:/C:/jboss-4.0.4.GA/server/default/deploy/jboss-aop-jdk50.deployer/ file:/C:/jboss-4.0.4.GA/server/default/deploy/jboss-aop-jdk50.deployer/
| org.jboss.deployment.DeploymentException: Trying to install an already registered mbean: jboss.aop:service=AspectManager
| at org.jboss.system.ServiceCreator.install(ServiceCreator.java:103)
| at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:449)
| at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
|
| (...)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy5.deploy(Unknown Source)
| at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
| at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
| at org.jboss.Main.boot(Main.java:200)
| at org.jboss.Main$1.run(Main.java:464)
| at java.lang.Thread.run(Thread.java:595)
| INFO [ServiceEndpointManager] jbossws-1.0.4.GA (date=200611151648)
|
Any hints?
Heitor
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991311#3991311
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991311
19 years, 7 months
[JBoss Seam] - Embedded EJB / DS EM Configuration
by eiswind70
I try to set up an embedded EJB/Seam Configuration. But Seam doesnt inject an Entity Manager when I try:
| @In
| private EntityManager em;
|
I get a NPE. I treid to use the EntityManagerFactory then to obtain an EM, but then I get
| javax.persistence.PersistenceException: org.hibernate.HibernateException: Could not find datasource
| at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:217)
| at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114)
| at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
| at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
| at com.hp.test.domain.TestBenutzer.testBenutzer(TestBenutzer.java:31)
| 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:585)
| at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
| at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
| at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
| at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
| at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
| at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
| at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
| at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
| at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
| at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
| at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
| at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
| Caused by: org.hibernate.HibernateException: Could not find datasource
| at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:56)
| at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
| at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29)
| at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:61)
| at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1928)
| at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211)
| at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:631)
| at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:760)
| at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:151)
| at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:205)
| ... 24 more
| Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
| at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
| at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
| at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
| ... 33 more
|
|
altough I have a DataSource declared in embedded-jboss-beans.xml
| <bean name="DefaultDSBootstrap"
| class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
| <property name="driverClass">
| <value>com.edb.Driver</value>
| </property>
| <property name="connectionURL">
| <value>jdbc:edb://127.0.0.1:5444/asd</value>
| </property>
| <property name="userName">
| <value>sa</value>
| </property>
| <property name="jndiName">
| <value>java:/AsdDS</value>
| </property>
| <property name="minSize">
| <value>0</value>
| </property>
| <property name="maxSize">
| <value>10</value>
| </property>
| <property name="blockingTimeout">
| <value>1000</value>
| </property>
| <property name="idleTimeout">
| <value>50000</value>
| </property>
| <property name="transactionManager">
| <inject bean="TransactionManager" />
| </property>
| <property name="cachedConnectionManager">
| <inject bean="CachedConnectionManager" />
| </property>
| <property name="initialContextProperties">
| <inject bean="InitialContextProperties" />
| </property>
| </bean>
|
| <bean name="DefaultDS" class="java.lang.Object">
| <constructor factoryMethod="getDatasource">
| <factory bean="DefaultDSBootstrap" />
| </constructor>
| </bean>
|
can anyone help me with this ? Thx in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991309#3991309
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991309
19 years, 7 months
[JBoss AOP] - Re: Bug in SuperClassesFirstWeavingStrategy?
by chasta
Here are the stack traces of the locked threads (copied from Eclipse's debugger, after suspending them):
------------------------ Thread 1 ----------------
Thread [TotalRecordings Thread] (Suspended)
ClassLoader.findBootstrapClass(String) line: not available [native method]
Launcher$ExtClassLoader(ClassLoader).findBootstrapClass0(String) line: 891
Launcher$ExtClassLoader(ClassLoader).loadClass(String, boolean) line: 301
Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: 299
Launcher$AppClassLoader.loadClass(String, boolean) line: 268
Launcher$AppClassLoader(ClassLoader).loadClass(String) line: 251
Launcher$AppClassLoader(ClassLoader).loadClassInternal(String) line: 319
ClassLoader.defineClass1(String, byte[], int, int, ProtectionDomain, String) line: not available [native method]
Launcher$AppClassLoader(ClassLoader).defineClass(String, byte[], int, int, ProtectionDomain) line: 620
Launcher$AppClassLoader(SecureClassLoader).defineClass(String, byte[], int, int, CodeSource) line: 124
Launcher$AppClassLoader(URLClassLoader).defineClass(String, Resource) line: 260
URLClassLoader.access$100(URLClassLoader, String, Resource) line: 56
URLClassLoader$1.run() line: 195
AccessController.doPrivileged(PrivilegedExceptionAction, AccessControlContext) line: not available [native method]
Launcher$AppClassLoader(URLClassLoader).findClass(String) line: 188
Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: 306
Launcher$AppClassLoader.loadClass(String, boolean) line: 268
Launcher$AppClassLoader(ClassLoader).loadClass(String) line: 251
Launcher$AppClassLoader(ClassLoader).loadClassInternal(String) line: 319
CommonObjectUtil.(boolean) line: 34
CommonObjectUtil.() line: 41
JsonSerializer(AbstractSerializer).() line: 20
JsonSerializer.() line: 27
ObjectToJsonSerializer.() line: 10
TotalRecordingsMessageHandler.onMessage(Object) line: 42
TotalRecordings.run() line: 86
Thread.run() line: 595
------------------- Thread 2 -----------------------------
Thread [ShopModule Thread] (Suspended)
ClassicWeavingStrategy.translate(AspectManager, String, ClassLoader, byte[]) line: 69
AspectManager.translate(String, ClassLoader, byte[]) line: 887
AspectManager.transform(ClassLoader, String, Class, ProtectionDomain, byte[]) line: 830
AOPTransformer.aspectTransform(String, ClassLoader, Class<?>, ProtectionDomain, byte[]) line: 88
AOPTransformer.transform(ClassLoader, String, Class<?>, ProtectionDomain, byte[]) line: 75
TransformerManager.transform(ClassLoader, String, Class, ProtectionDomain, byte[]) line: 122
InstrumentationImpl.transform(ClassLoader, String, Class, ProtectionDomain, byte[]) line: 155
Proxy.defineClass0(ClassLoader, String, byte[], int, int) line: not available [native method]
Proxy.getProxyClass(ClassLoader, Class<?>...) line: 487
Proxy.newProxyInstance(ClassLoader, Class<?>[], InvocationHandler) line: 564
AnnotationParser.annotationForMap(Class, Map<String,Object>) line: 223
AnnotationParser.parseAnnotation(ByteBuffer, ConstantPool, Class) line: 213
AnnotationParser.parseAnnotations2(byte[], ConstantPool, Class) line: 69
AnnotationParser.parseAnnotations(byte[], ConstantPool, Class) line: 52
Class.initAnnotationsIfNecessary() line: 2998
Class.getAnnotation(Class) line: 2958
AnnotationType.(Class<?>) line: 104
AnnotationType.getInstance(Class) line: 64
AnnotationParser.parseAnnotation(ByteBuffer, ConstantPool, Class) line: 186
AnnotationParser.parseAnnotations2(byte[], ConstantPool, Class) line: 69
AnnotationParser.parseAnnotations(byte[], ConstantPool, Class) line: 52
Class.initAnnotationsIfNecessary() line: 2998
Class.getAnnotation(Class) line: 2958
AnnotationElement.getVisibleAnnotation(Class, Class) line: 88
PortableAnnotationElement.getAnyAnnotation(Class, Class) line: 402
AdvisorMatcherStrategy(MatcherStrategy).subtypeOf(Class, ClassExpression, Advisor) line: 63
Util.subtypeOf(Class, ClassExpression, Advisor) line: 413
Util.matchesClassExpr(ClassExpression, Class, Advisor) line: 124
InterfaceIntroduction.matches(Advisor, Class) line: 234
AspectManager.applyInterfaceIntroductions(Advisor, Class) line: 1580
ClassAdvisor$1.run() line: 289
AccessController.doPrivileged(PrivilegedExceptionAction) line: not available [native method]
ClassAdvisor.attachClass(Class) line: 272
AspectManager.initialiseClassAdvisor(Class, ClassAdvisor) line: 600
AspectManager.getAdvisor(Class) line: 587
Product.() line: 20
ShopModule.run() line: 34
Thread.run() line: 595
--------------------------------------------------
I'm not sure how feasible it'd be for me to deploy the application on a JBoss application server. It's not a J2EE (or even a web) application, and I have a feeling that trying to deploy it can potentially make me bounce into some tricky problems because of the use of native libraries and some components which may behave differently under an application server (e.g. a JMS broker). Perhaps there is a way to use JBoss's ClassLoader without deploying on the server?
Other than that, if the ClassLoader is related, it worth mentioning that we're using Sun's j2sdk-1.5.0_05.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991299#3991299
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991299
19 years, 7 months
[EJB 3.0] - Re: mappedBy reference an unknown target entity property
by smix007
Hello,
you use @idClass. Whereas in my code I use @Embeddable and @EmbeddedId I thus seek a solution with my problem of joint for the following code:
@Embeddable
| public class TermProjPK implements Serializable {
| private String auiw;
| @Column(name = "AUIS", nullable = false)
| private String auis;
public class TermProj implements Serializable {
| @EmbeddedId
| private TermProjPK termProjPK;
| //jointure avec la table TermSource
| @ManyToOne
| @JoinColumn (name = "AUIW")
| private TermSource auiw;
| public TermSource getAuiw() {
| return auiw;
| }
|
| public void setAuiw(TermSource auiw) {
| this.auiw = auiw;
| }
|
|
| //jointure avec la table SnomedInter
| @ManyToOne
| @JoinColumn (name = "AUIS")
| private SnomedInter auis;
| public SnomedInter getAuis() {
| return auis;
| }
|
| public void setAuis(SnomedInter auis) {
| this.auis = auis;
| }
| @Column(name = "MODIF")
| private String modif;
|
| @Column(name = "SRC", nullable = false)
| private String src;
public class TermSource implements Serializable {
| @Id
| @Column(name = "AUIW", nullable = false)
| private String auiw;
| @OneToMany(mappedBy="AUIW")
| private Collection<TermProj> termProjs;
|
| public Collection<TermProj> getTermProjs() {
| return termProjs;
| }
|
| public void setTermProjs(Collection<TermProj> termProjs) {
| this.termProjs = termProjs;
| }
public class SnomedInter implements Serializable {
| @Id
| @Column(name = "AUIS", nullable = false)
| private String auis;
| @OneToMany(mappedBy="AUIS")
| private Collection<TermProj> termProjs;
|
| public Collection<TermProj> getTermProjs() {
| return termProjs;
| }
|
| public void setTermProjs(Collection<TermProj> termProjs) {
| this.termProjs = termProjs;
| }
I have the error message according to
org.hibernate.AnnotationException: mappedBy reference an unknown property: ejb.entity.TermProj.AUIS in ejb.entity.SnomedInter.AUIS
| ,
thank you in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991294#3991294
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991294
19 years, 7 months
[JBoss Seam] - EJB3StandaloneBootstrap - java.lang.IllegalArgumentExceptio
by eiswind70
I try to set up some Junit tests for our SEAM Project. I struggle now even with the CVS relase from 20061204 with the following exception :
java.lang.RuntimeException: java.lang.RuntimeException: Unable to create a KernelInitializer based on the specified KernelConfig
at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(EJB3StandaloneBootstrap.java:391)
at org.jboss.seam.core.Ejb.startup(Ejb.java:41)
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:585)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
at org.jboss.seam.Component.callComponentMethod(Component.java:1759)
at org.jboss.seam.Component.callCreateMethod(Component.java:1707)
at org.jboss.seam.Component.newInstance(Component.java:1696)
at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:153)
at org.jboss.seam.contexts.Lifecycle.endInitialization(Lifecycle.java:127)
at org.jboss.seam.init.Initialization.init(Initialization.java:408)
at com.hp.junit.SeamTestCase.setUpSeam(SeamTestCase.java:42)
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:585)
at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.RuntimeException: Unable to create a KernelInitializer based on the specified KernelConfig
at org.jboss.kernel.KernelFactory.createKernelInitializer(KernelFactory.java:139)
at org.jboss.kernel.KernelFactory.assembleNewKernel(KernelFactory.java:81)
at org.jboss.kernel.KernelFactory.newInstance(KernelFactory.java:48)
at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.bootstrap(AbstractBootstrap.java:122)
at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:87)
at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.createKernel(EJB3StandaloneBootstrap.java:422)
at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(EJB3StandaloneBootstrap.java:375)
... 34 more
Caused by: java.lang.NullPointerException
at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.getTypeInfo(IntrospectionTypeInfoFactoryImpl.java:221)
at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactory.getTypeInfo(IntrospectionTypeInfoFactory.java:44)
at org.jboss.classadapter.plugins.reflect.ReflectClassAdapterFactory.getClassAdapter(ReflectClassAdapterFactory.java:46)
at org.jboss.kernel.plugins.config.AbstractKernelConfig.getBeanInfo(AbstractKernelConfig.java:57)
at org.jboss.kernel.plugins.config.property.PropertyKernelConfig.getImplementation(PropertyKernelConfig.java:140)
at org.jboss.kernel.plugins.config.property.PropertyKernelConfig.createKernelInitializer(PropertyKernelConfig.java:108)
at org.jboss.kernel.KernelFactory.createKernelInitializer(KernelFactory.java:133)
... 40 more
this is my code for the unit test environment (stolen from the TestNG SeamTest)
| @Before public void setUpSeam(){
| application = new MockApplication();
| application.setStateManager( new SeamStateManager( application.getStateManager() ) );
| application.setNavigationHandler( new SeamNavigationHandler( application.getNavigationHandler() ) );
| //don't need a SeamVariableResolver, because we don't test the view
| phases = createPhaseListener();
|
| servletContext = new MockServletContext();
| initServletContext( servletContext.getInitParameters() );
| new Initialization(servletContext).init();
| Lifecycle.setServletContext(servletContext);
|
| //conversationStates = new HashMap<String, ConversationState>();
|
| }
|
can anyone point me a direction ? I have completely no idea !
Thx
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991290#3991290
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991290
19 years, 7 months
[Messaging, JMS & JBossMQ] - Singleton MDB being run in two threads
by antont
using: jboss 4.0.3SP1 (on linux) and 4.0.4 and 4.0.5 GAs (on winxp)
I have configured a MDB to be a singleton as instructed in the FAQ, with the <configuration-name>Singleton Message Driven Bean</configuration-name> directive in jboss.xml .
When configured so, that MDB is being run in max. two threads in parallel, instead of one. If I remove the singleton configuration, it starts to use up to X threads.
As a test case I have a MDB that receives messages from a queue, and waits 10 seconds as to simulate long-running processing, and prints Thread.currentThread.getId() before and after that loop. The messages are sent by a Quartz job, but I think that is irrelevant because only thing that matters for MDB execution is that messages are put to the queue. Debug output from a test case shows that even tho configured as a singleton it runs in two parallel threads. In this example I use a test servlet to quickly schedule 3 message sendings to occur after 1 second, and then we see that two threads are used to execute those commands:
15:31:11,734 INFO [STDOUT] Scheduling Job ..
| 15:31:12,218 INFO [STDOUT] Job scheduled now, to be run in 1 seconds ..
| 15:31:12,234 INFO [STDOUT] Scheduling Job ..
| 15:31:12,234 INFO [STDOUT] Job scheduled now, to be run in 1 seconds ..
| 15:31:12,328 INFO [STDOUT] Scheduling Job ..
| 15:31:12,328 INFO [STDOUT] Job scheduled now, to be run in 1 seconds ..
| 15:31:12,906 INFO [TaskexecCommandRunnerBean] Starting dummy task exec (waits for 10 secs) in thread 70
| 15:31:13,593 INFO [TaskexecCommandRunnerBean] Starting dummy task exec (waits for 10 secs) in thread 37
| 15:31:22,906 INFO [TaskexecCommandRunnerBean] .. done in thread 70
| 15:31:22,921 INFO [TaskexecCommandRunnerBean] Starting dummy task exec (waits for 10 secs) in thread 70
| 15:31:23,593 INFO [TaskexecCommandRunnerBean] .. done in thread 37
| 15:31:32,921 INFO [TaskexecCommandRunnerBean] .. done in thread 70
|
When I change nothing else, but comment out the singleton config (<!-- configuration-name>Singleton Message Driven Bean</configuration-name-->), redeploy and execute the same thing, the behaviour changes correctly. In this example I schedule 5 executions, and they are all executed in parallel in their own threads:
| 15:41:32,609 INFO [STDOUT] Scheduling Job ..
| 15:41:32,625 INFO [STDOUT] Job scheduled now, to be run in 1 seconds ..
| 15:41:32,906 INFO [STDOUT] Scheduling Job ..
| 15:41:32,906 INFO [STDOUT] Job scheduled now, to be run in 1 seconds ..
| 15:41:33,296 INFO [STDOUT] Scheduling Job ..
| 15:41:33,296 INFO [STDOUT] Job scheduled now, to be run in 1 seconds ..
| 15:41:33,609 INFO [STDOUT] Scheduling Job ..
| 15:41:33,625 INFO [STDOUT] Job scheduled now, to be run in 1 seconds ..
| 15:41:33,750 INFO [TaskexecCommandRunnerBean] Starting dummy task exec (waits for 10 secs) in thread 109
| 15:41:33,984 INFO [STDOUT] Scheduling Job ..
| 15:41:33,984 INFO [STDOUT] Job scheduled now, to be run in 1 seconds ..
| 15:41:34,015 INFO [TaskexecCommandRunnerBean] Starting dummy task exec (waits for 10 secs) in thread 118
| 15:41:34,359 INFO [TaskexecCommandRunnerBean] Starting dummy task exec (waits for 10 secs) in thread 127
| 15:41:34,875 INFO [TaskexecCommandRunnerBean] Starting dummy task exec (waits for 10 secs) in thread 136
| 15:41:35,046 INFO [TaskexecCommandRunnerBean] Starting dummy task exec (waits for 10 secs) in thread 145
| 15:41:43,750 INFO [TaskexecCommandRunnerBean] .. done in thread 109
| 15:41:44,015 INFO [TaskexecCommandRunnerBean] .. done in thread 118
| 15:41:44,359 INFO [TaskexecCommandRunnerBean] .. done in thread 127
| 15:41:44,875 INFO [TaskexecCommandRunnerBean] .. done in thread 136
| 15:41:45,046 INFO [TaskexecCommandRunnerBean] .. done in thread 145
|
Am I overlooking / misunderstanding something, or is this a bug?
One reason why I did not post this as a bug report (yet) is that there seems to be a known issue with EJB3 and JMS producing similar behaviour, http://jira.jboss.org/jira/browse/JBAS-3327 "maxSessions=1 in JMS activation spec creates multiple MDBs" and that bug report is closed as 'wont fix' because of some on-going work with ejb3s or something (i did not read the discussion too closely).
Can it be that this is resulting from that known jboss issue, even though I am not using EJB3? The linux server here with 4.0.3 SP1 produces the same behaviour even though it does not have ejb3 things installed. On a development winxp laptop I have reproduced this with both 4.0.4 and 4.0.5 GAs, without ejb3.
When using EJB3 and the @ActivationConfigProperty(propertyName = "MaxSession", propertyValue = "1") I get what JBAS-3327 describes, i.e. 2 threads (and n+1 with other values). And yes I tried putting a 0 there too which resulted in no MDBs being invoked :) (after reading the discussion regarding the bug i know why)
Is this a known issue? I could not find any solution on this forum or elsewhere. Is there anything I can do to make it working, is it working correctly for others?
hoping that the question / report is clear,
~Toni
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991289#3991289
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991289
19 years, 7 months
[JBoss Seam] - <si:selectItems ...>
by toni
Hi,
I read the wiki on how to use the <si:selectItems> several times, looked at the examples, but I still run into the following excepiton:
javax.faces.FacesException: value must be iteratable
But I'm returning a List, which is iteratable. I'm using JBoss 4.04GA, with Seam 1.0.1 GA and 1.1.1beta2 of selectItems.
Does somebody see anything wrong with code here:
The function to build the List:
----------------------------------------
@SuppressWarnings("unchecked")
@Factory("clients")
public List buildClients()
{
List client = entityManager.createQuery("from Client").getResultList();
return client;
}
The JSP snippet, which causes the exception
---------------------------------------------------
<h:selectOneMenu value="#{clientsActionBean.client}" required="false">
<si:selectItems value="#{clients}" var="c" label="#{c.name}" noSelectionLabel="Please Select..."/>
</h:selectOneMenu>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991287#3991287
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991287
19 years, 7 months
[EJB 3.0] - Re: EntityManager is loosing updates
by konstantin.ermakov
Hello!
It seems that some internal error leads to incorrect data in my entity bean POJO:
| 2006-12-05 14:13:14,496 INFO [myapp] Invoking: mypackage..session.MyObjectSession.getObject()
| 2006-12-05 14:13:14,496 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 4773168719855617
| 2006-12-05 14:13:14,496 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
| 2006-12-05 14:13:14,496 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
| 2006-12-05 14:13:14,496 DEBUG [org.hibernate.jdbc.JDBCContext] successfully registered Synchronization
| 2006-12-05 14:13:14,496 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
| 2006-12-05 14:13:14,496 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Transaction already joined
| 2006-12-05 14:13:14,496 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 1)
| 2006-12-05 14:13:14,496 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
| 2006-12-05 14:13:14,496 DEBUG [org.jboss.mq.il.uil2.SocketManager] End ReadTask.run
| 2006-12-05 14:13:14,512 DEBUG [org.hibernate.SQL]
| /* select
| x
| from
| MyObject x
| where
| x.id = 1 */ select
| MyObject0_.ID as
| .......
| from
| MyObject_DATA MyObject0_
| where
| MyObject0_.ID=1
| 2006-12-05 14:13:14,512 DEBUG [org.jboss.mq.il.uil2.SocketManager] End WriteTask.run
| 2006-12-05 14:13:14,512 DEBUG [org.jboss.mq.il.uil2.ServerSocketManagerHandler] Exiting on IOE
| java.net.SocketException: socket closed
| at java.net.SocketInputStream.socketRead0(Native Method)
| at java.net.SocketInputStream.read(SocketInputStream.java:129)
| at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
| at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
| at org.jboss.util.stream.NotifyingBufferedInputStream.read(NotifyingBufferedInputStream.java:79)
| at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2205)
| at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2385)
| at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2452)
| at java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream.java:2524)
| at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2673)
| at java.io.ObjectInputStream.readByte(ObjectInputStream.java:874)
| at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:317)
| at java.lang.Thread.run(Thread.java:595)
| 2006-12-05 14:13:14,512 INFO [STDOUT] Hibernate:
| /* select
| x
| from
| MyObject x
| where
| x.id = 1 */ select
| MyObject0_.ID
| .....
| from
| MyObject_DATA MyObject0_
| where
| MyObject0_.ID=1
| 2006-12-05 14:13:14,512 DEBUG [org.jboss.mq.il.uil2.SocketManager] End ReadTask.run
| 2006-12-05 14:13:14,512 DEBUG [org.jboss.mq.il.uil2.SocketManager] Failed to handle: org.jboss.mq.il.uil2.msgs.CloseMsg18880098[msgType: m_connectionClosing, msgID: -2147480999, error: null]
| java.io.IOException: Client is not connected
| at org.jboss.mq.il.uil2.SocketManager.internalSendMessage(SocketManager.java:265)
| at org.jboss.mq.il.uil2.SocketManager.sendReply(SocketManager.java:239)
| at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocketManagerHandler.java:128)
| at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:396)
| at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:392)
| at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
| at java.lang.Thread.run(Thread.java:595)
| 2006-12-05 14:13:14,512 DEBUG [org.hibernate.SQL]
| /* select
| x
| from
| MyObject x
| where
| x.id = 1 */ select
| MyObject0_.ID as
| .....
| from
| MyObject_DATA MyObject0_
| where
| MyObject0_.ID=1
| 2006-12-05 14:13:14,512 DEBUG [org.jboss.mq.il.uil2.UILClientILService] Stopping
| 2006-12-05 14:13:14,512 DEBUG [org.jboss.mq.il.uil2.SocketManager] End WriteTask.run
| 2006-12-05 14:13:14,512 DEBUG [org.jboss.mq.il.uil2.SocketManager] Failed to send error reply
| java.io.IOException: Client is not connected
| at org.jboss.mq.il.uil2.SocketManager.internalSendMessage(SocketManager.java:265)
| at org.jboss.mq.il.uil2.SocketManager.access$800(SocketManager.java:52)
| at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:409)
| at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:392)
| at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
| at java.lang.Thread.run(Thread.java:595)
| 2006-12-05 14:13:14,512 INFO [STDOUT] Hibernate:
| /* select
| x
| from
| MyObject x
| where
| x.id = 1 */ select
| MyObject0_.ID
| ....
| from
| MyObject_DATA MyObject0_
| where
| MyObject0_.ID=1
| 2006-12-05 14:13:14,512 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open ResultSet (open ResultSets: 0, globally: 0)
| 2006-12-05 14:13:14,512 DEBUG [org.hibernate.loader.Loader] result row: EntityKey[mypackage..entity.MyObject#1]
| 2006-12-05 14:13:14,512 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close ResultSet (open ResultSets: 1, globally: 1)
| 2006-12-05 14:13:14,512 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 2)
| 2006-12-05 14:13:14,512 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
| 2006-12-05 14:13:14,512 DEBUG [org.hibernate.jdbc.ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 1) (open ResultSets: 0, globally: 0)]
| 2006-12-05 14:13:14,512 DEBUG [org.hibernate.engine.TwoPhaseLoad] resolving associations for [mypackage..entity.MyObject#1]
| 2006-12-05 14:13:14,512 DEBUG [org.hibernate.engine.TwoPhaseLoad] done materializing entity [mypackage..entity.MyObject#1]
| 2006-12-05 14:13:14,512 DEBUG [org.hibernate.engine.StatefulPersistenceContext] initializing non-lazy collections
| 2006-12-05 14:13:14,512 INFO [myapp] MyObject name 3
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991283#3991283
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991283
19 years, 7 months
[EJB 3.0] - Problem with storing SYBASE
by ponds81
Problem with storing SYBASE "IMAGE" DATA TYPE in jboss using entity bean
We are using JBoss-4.0.4.GA, Entity Bean 2.x (CMP), Sybase 12.5
File Name :- jconn2.jar
File Version :- 1.4.2_04
File Size :- 876 kb
When we try to insert an object in to column of data type "IMAGE" in Sybase by using EJB 2.x we get the fallowing exception
2006-11-24 13:31:58,328 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
2006-11-24 13:31:58,359 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
2006-11-24 13:31:58,359 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
2006-11-24 13:31:58,218 WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Exception destroying ManagedConnection org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@a97cec[state=DESTROYED mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@1f71b53 handles=0 lastUse=1164355312640 permit=false trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@22f376 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@9ddfa3]
org.jboss.resource.JBossResourceException: SQLException; - nested throwable: (java.sql.SQLException: JZ0C0: Connection is already closed.)
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.checkException(BaseWrapperManagedConnection.java:541)
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.destroy(BaseWrapperManagedConnection.java:255)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.doDestroy(InternalManagedConnectionPool.java:539)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.returnConnection(InternalManagedConnectionPool.java:329)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.returnConnection(JBossManagedConnectionPool.java:552)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.returnManagedConnection(BaseConnectionManager2.java:407)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$BaseConnectionEventListener.connectionErrorOccurred(BaseConnectionManager2.java:768)
at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.connectionErrorOccurred(TxConnectionManager.java:550)
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.broadcastConnectionError(BaseWrapperManagedConnection.java:327)
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.connectionError(BaseWrapperManagedConnection.java:313)
at org.jboss.resource.adapter.jdbc.WrappedConnection.checkException(WrappedConnection.java:757)
at org.jboss.resource.adapter.jdbc.WrappedStatement.checkException(WrappedStatement.java:768)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:320)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCIdentityColumnCreateCommand.executeInsert(JDBCIdentityColumnCreateCommand.java:51)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.performInsert(JDBCAbstractCreateCommand.java:286)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.execute(JDBCAbstractCreateCommand.java:137)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:572)
at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:222)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:266)
at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:612)
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:324)
at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1113)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:192)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:212)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:117)
at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:313)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:126)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:99)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:508)
at org.jboss.ejb.Container.invoke(Container.java:891)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:342)
at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:118)
at $Proxy94.create(Unknown Source)
_____________________________________________________________________________________________________
Here is the code for the bean
/**
* RecoverLogBean is an EntityBean. This EJBean illustrates:
*
* Container-managed JDBC persistence and transactions;
* the code in this file never directly accesses the data storage.
* Application-defined exceptions.
* Use of EJB 2.0 relationships.
* Use of EJB-QL in query methods.
*
* The javadoc comments in this document are critical and should be changed with consideration.
* The EJBGen tool reads these comments and creates corresponding
* EJB2.0 XML files as well as Home and Remote interfaces
*
* This bean uses EJBGen tags.
*
* @ejb.bean description="RecoverLog"
* name="RecoverLog"
* local-jndi-name="abs.RecoverLog"
* type="CMP"
* primkey-field = "id"
* view-type="local"
* cmp-version = "2.x"
*
* @jboss.persistence
* table-name = "recoverLog"
*
* @ejb.pk class = "java.lang.Integer"
*
* @jboss.unknown-pk
* column-name = "id"
* jdbc-type = "INTEGER"
* sql-type = "INTEGER"
* class = "java.lang.Integer"
*
*
* @jboss.entity-command name = "sybase-fetch-key"
* class = "org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCSybaseCreateCommand"
* @jboss.entity-command-attribute name = "pk-sql"
* value = "SELECT @@IDENTITY"
*
* @ejb.finder
* signature = "Collection findAll()"
* query = "SELECT OBJECT(o) FROM RecoverLog o WHERE o.id IS NOT NULL"
*
* @ejb.finder
* signature = "Collection findByStatus(java.lang.String status)"
* query = "SELECT OBJECT(o) FROM RecoverLog o WHERE o.status = ?1"
*
* @ejb.finder
* signature = "Collection findByStatusUnique(java.lang.String status)"
* query = "SELECT OBJECT(o) FROM RecoverLog o WHERE o.status = ?1 AND o.id = (SELECT MIN(o1.id) FROM RecoverLog o1 WHERE o1.status = ?1 AND o1.attemptCount = (SELECT MIN(o2.attemptCount) FROM RecoverLog o2 WHERE o2.status = ?1))"
*
* @jboss.declared-sql alias = "o"
* signature = "Collection findByStatusUnique(java.lang.String status)"
* where = "o.status = {0} AND o.id = (SELECT MIN(o1.id) FROM RecoverLog o1 WHERE o1.status = {0} AND o1.attemptCount = (SELECT MIN(o2.attemptCount) FROM RecoverLog o2 WHERE o2.status = {0}))"
*
*/
abstract public class RecoverLogBean implements EntityBean
{
// ----------------------------------------------------------- Constants
// JNDI name of the EJB home object
// NOTE: Any changes here should also be reflected in the deployment descriptor.
public final static String JNDI_NAME = "abs.RecoverLog";
public final static String TYPE_CANCEL_BET = "Bet Cancel";
public final static String TYPE_PERSIST_BET = "Bet Persist";
public final static String TYPE_ACCOUNT_BALANCE = "Account Balance";
public final static String STATUS_PENDING = "Pending";
public final static String STATUS_RESOLVED = "Resolved";
public final static String STATUS_INPROGRESS = "InProgress";
// Added for CR 4311 - status for reaching the max attempt with failures
public static final String STATUS_DISCARDED = "Discarded";
// ----------------------------------------------------------- Member Variables
/**
* The container assigned reference to the entity
*/
private EntityContext context;
// ----------------------------------------------------------- Constructors
public RecoverLogBean() { /* do nothing */ }
// ----------------------------------------------------------- Public EJB Methods
/**
* Sets the context of the bean
* @param ec EntityContext
*/
public void setEntityContext(EntityContext ec) { context = ec; }
/**
* Clears the context of the bean
*/
public void unsetEntityContext() { this.context = null; }
/**
* This method is called when the container picks this entity object
* and assigns it to a specific entity object. Insert code here to
* acquire any additional resources that it needs when it is in the
* ready state.
*/
public void ejbActivate() { /* do nothing */ }
/**
* This method is called when the container diassociates the bean
* from the entity object identity and puts the instance back into
* the pool of available instances. Insert code to release any
* resources that should not be held while the instance is in the
* pool.
*/
public void ejbPassivate() { /* do nothing */ }
/**
* The container invokes this method on the bean whenever it
* becomes necessary to synchronize the bean's state with the
* state in the database. This method is called after the container
* has loaded the bean's state from the database.
*/
public void ejbLoad() { /* do nothing */ }
/**
* The container invokes this method on the bean whenever it
* becomes necessary to synchronize the state in the database
* with the state of the bean. This method is called before the
* container extracts the fields and writes them into the database.
*/
public void ejbStore() { /* do nothing */ }
/**
* The container invokes this method in response to a client-invoked
* remove request. Insert code to implement any actions before the
* bean is removed from the database.
*/
public void ejbRemove() throws javax.ejb.RemoveException { /* do nothing */ }
/**
* This method is invoked when a client invokes the matching create()
* on the home interface. Initialize the fields that will be used
* used by the container to create a record in the database
*
* @ejb.create-method view-type = "local"
*
* @param info RecoverLogInfo
* @return Integer pk
* @throws CreateException
*/
public Integer ejbCreate(RecoverLogInfo info) throws CreateException
{
//this.setId(new Long(new Date().getTime()));
setAttemptCount(info.getAttemptCount());
if(info.getStatus()==null)
setStatus(STATUS_PENDING);
else
setStatus(info.getStatus());
Object o = info.getObject();
if(o instanceof BetPersistLogObject)
this.setType(TYPE_PERSIST_BET);
else if(o instanceof BetCancelLogObject)
this.setType(TYPE_CANCEL_BET);
else if(o instanceof BalanceLogObject) // Added for CR#3274 dt:5aug04
this.setType(TYPE_ACCOUNT_BALANCE);
this.setReferenceName(info.getReferenceName());
setObject(o);
setTimeEntered(info.getTimeEntered());
setTimeUpdated(info.getTimeUpdated());
return null;
}
/**
* The container invokes this method after invoking the ejbCreate
* method with the same arguments.
* @param info RecoverLogInfo
* @throws CreateException
*/
public void ejbPostCreate(RecoverLogInfo info) throws CreateException
{
// do nothing
}
// ----------------------------------------------------------- Public Business Methods
_____________________________________________________________________________________________________
Here is the data sourse file for sybase ie. sybaseDataSource-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- New ConnectionManager setup for Sybase ASE/ASA jConnect driver -->
<!-- Thanks to Marc Zampetti <zampetti(a)aol.net> -->
<!-- This is a minimal example. See the generic example for other stuff -->
<!-- ===================================================================== -->
<!-- $Id: sybase-ds.xml,v 1.4 2004/09/15 14:37:40 loubyansky Exp $ -->
<local-tx-datasource>
<jndi-name>sybaseDataSource</jndi-name>
<!-- Sybase jConnect URL for the database.
NOTE: The hostname and port are made up values. The optional
database name is provided, as well as some additinal Driver
parameters.
-->
<connection-url>jdbc:sybase:Tds:system-name:5000/abs_dev?JCONNECT_VERSION=6</connection-url>
<driver-class>com.sybase.jdbc2.jdbc.SybDriver</driver-class>
<user-name>abs_dev</user-name>
abs_dev
<min-pool-size>5</min-pool-size>
<!-- The maximum connections in a pool/sub-pool -->
<max-pool-size>5</max-pool-size>
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-->
<!-- example of how to specify a class that determines a connection is valid before it is handed out from the pool
<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyValidConnectionChecker</valid-connection-checker-class-name>
-->
<!-- Whether to check all statements are closed when the connection is returned to the pool,
this is a debugging feature that should be turned off in production -->
<track-statements/>true<track-statements/>
<new-connection-sql><![CDATA[SELECT COUNT(*) FROM SYSTEMPROPERTY]]></new-connection-sql>
<check-valid-connection-sql><![CDATA[SELECT COUNT(*) FROM SYSTEMPROPERTY]]></check-valid-connection-sql>
<no-tx-separate-pools/>
<track-connection-by-tx/>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<type-mapping>Sybase</type-mapping>
</local-tx-datasource>
______________________________________________________________________________
The Script which create the table is as fallows
create table recoverLog1 (
id numeric(8,0) identity ,
status varchar(30) not null ,
type varchar(30) not null ,
referenceName varchar(60) not null ,
object varchar(260) not null ,
attemptCount numeric(2,0) not null ,
timeEntered datetime not null ,
timeUpdated datetime null ,
constraint PK_recoverlog1 PRIMARY KEY CLUSTERED ( id )
) with identity_gap = 50 on 'default'
go
create unique index type_referenceName_ux on RecoverLog1 (type, referenceName)
go
create index recoverLogIdx on recoverLog1 (id)
go
grant select on recoverLog1 to public
go
grant update on recoverLog1 to public
go
grant insert on recoverLog1 to public
go
_________________________________________________________________________________________
The fallowing things were observed
1) No call to callback method ie. ejbPostCreate, ejbStore
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991282#3991282
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991282
19 years, 7 months