[Beginner's Corner] - JBoss5.1.0 + JPA = Object not persists
by Amit Ajmani
Amit Ajmani [http://community.jboss.org/people/amitajmani1] created the discussion
"JBoss5.1.0 + JPA = Object not persists"
To view the discussion, visit: http://community.jboss.org/message/629956#629956
--------------------------------------------------------------
here is my persistent.xml:
<persistence-unit name="jpa_ora" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:OraDS</jta-data-source>
<mapping-file>META-INF/orm.xml</mapping-file>
<class>ca.teranet.rts.model.User</class>
<class>ca.teranet.rts.dao.UserSession</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
</properties>
</persistence-unit>
and i am using TransactionManagement.Container in my Stateless EJB. I have put the hibernate-jpa-2.0-final.jar in server/default/lib folder.
The problem is :
Whenever i invoke a method to persist an object, sometimes it works well and save it into DB and sometimes it wont, just increases the hibernate_sequence value and and comes out silently without even throwing an exception but does not fire an insert query .
But when i run the same application over JBoss6.0 it works perfectly.
Any clue on this ........
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/629956#629956]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 7 months
[JBoss Web Services] - Jboss web service client runtime error
by gaumont wang
gaumont wang [http://community.jboss.org/people/gaumont] created the discussion
"Jboss web service client runtime error"
To view the discussion, visit: http://community.jboss.org/message/629952#629952
--------------------------------------------------------------
Hi,
I am working on a jax-ws client using jboss's ws client runtime to create web service proxy. Here is the pseudo code
//create service
HelloService service = new HelloService(wsdlurl, serviceQname);
// get web service proxy
Hello port = service.getHelloPort();
// call web service
port.sayHello(...)
but I got errors like this:
org.jboss.ws.WSException: Could not generate wrapper type: xxx(the name of a class defined as schema element in my wsdl)
at org.jboss.ws.core.jaxws.DynamicWrapperGenerator.generate(DynamicWrapperGenerator.java:124)
at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder.processWebMethod(JAXWSMetaDataBuilder.java:759)
at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder.processWebMethods(JAXWSMetaDataBuilder.java:874)
at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.rebuildEndpointMetaData(JAXWSClientMetaDataBuilder.java:294)
at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPortInternal(ServiceDelegateImpl.java:262)
at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPort(ServiceDelegateImpl.java:233)
at javax.xml.ws.Service.getPort(Service.java:185)
Weird thing is if I change it to use reference implementation runtime from JDK(by switching proivderImpl to com.sun.xml.internal.ws.spi.ProviderImpl in system property), it works fine without any error.
Does anyone know what's the cause of this problem.
Thanks a lot!
Gaumont
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/629952#629952]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 7 months
[Javassist] - Adding a Method Annotation not working as expected...
by Amit P
Amit P [http://community.jboss.org/people/apinke] created the discussion
"Adding a Method Annotation not working as expected..."
To view the discussion, visit: http://community.jboss.org/message/629947#629947
--------------------------------------------------------------
Hi All,
I have a few classes ( in a supplied jar) in which I am trying to mark certain specifc methods as "Deprecated" .
I am able to use javassist and add the annotation to the method (code attached to the end of this mail) but Eclipse refuses to identify that as a "Deprecated" method at compile time.
I decompiled and verified that there is a "@Deprecated" annotation on the method. I also used ASM compare between a class in which I added a @Deprecated and this class in which javassist added the annotation and notice one strange thing : the access flags are different
"normal" method :
// DEPRECATED
// access flags 0x20001
public getName()Ljava/lang/String;
@Ljava/lang/Deprecated;()
L0
LINENUMBER 7 L0
javassist annotated method :
// access flags 0x1
public getName()Ljava/lang/String;
@Ljava/lang/Deprecated;()
L0
LINENUMBER 7 L0
Questions :
1) is there a problem in the way the Annotation is being added ?
2) Cant I add a java.lang.Deprecated annotation to a method ? is there some special modifier or instruction to be used to add the inbuilt java Annotations ?
Any help or pointer is appreciated !!
I tried to make it a "invisibleTag" , specify it as "Deprecated" , "@Deprecated" but the IDE refuses to treat that as a Deprecated API.
thanks
Pat
----
code snippet :
CtMethod[] methods = cc.getMethods();
for (int k = 0; k < methods.length; k++) {
CtMethod met = methods[k];
System.out.println("Found Method --> " + met.getName());
try{
ClassFile ccFile = cc.getClassFile();
ConstPool constpool = ccFile.getConstPool();
AnnotationsAttribute attr = new AnnotationsAttribute(constpool, AnnotationsAttribute.visibleTag);
Annotation annot = new Annotation("java.lang.Deprecated", constpool);
attr.addAnnotation(annot);
met.getMethodInfo().addAttribute(attr);
}catch(Exception e){
System.out.println("Skipping method:-->" + met.getName() +"Reason:" + e.getMessage() );
}
}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/629947#629947]
Start a new discussion in Javassist at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 7 months
[Beginner's Corner] - EJB-JAR.XML AND JBOSS.XML SETUP
by Bruce Sanders
Bruce Sanders [http://community.jboss.org/people/brucesanders63] created the discussion
"EJB-JAR.XML AND JBOSS.XML SETUP"
To view the discussion, visit: http://community.jboss.org/message/629471#629471
--------------------------------------------------------------
Does someone one have a simple explaination w/example showing how to setup the jboss.xml from an ejb-jar.xml? I find nothing on JBOSS or Goggle? Specifically I'm looking for the enterprise beans and resource section. Below is the contents of my ejb-jar.xml.
<enterprise-beans>
<session>
<description>Calculation Appeals Manager EJB</description>
<display-name>CalculationAppealsPortalManagerBean</display-name>
<ejb-name>CalculationAppealsPortalManagerBean</ejb-name>
<home>com.spcs.intranet.calculationAppeals.business.ejb.CalculationAppealsManagerHome</home>
<remote>com.spcs.intranet.calculationAppeals.business.ejb.CalculationAppealsManager</remote>
<ejb-class>com.spcs.intranet.calculationAppeals.business.ejb.CalculationAppealsManagerBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<env-entry-name>ejb.sessionTimeout</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>600</env-entry-value>
</env-entry>
</session>
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/629471#629471]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 7 months
[JBoss Web Services] - JBoss AS 7 @WebContext EJB deployed in a WAR
by Joshua Davis
Joshua Davis [http://community.jboss.org/people/pgmjsd] created the discussion
"JBoss AS 7 @WebContext EJB deployed in a WAR"
To view the discussion, visit: http://community.jboss.org/message/629882#629882
--------------------------------------------------------------
I've tried deploying a SOAP endpoint EJB in a WAR, as EJB3.1 allows. When I added @WebContext (from the org.jboss.ws.api.annotation package), the rest of the web application stopped working. I got The White Page Of Death for every single URL in the rest of the web UI. I tried using WEB-INF/jboss-web.xml to specify the context as well, but that didn't work either.
The EJB is deployed in WEB-INF/classes, and it looks like this:
@Stateless(name = "ExampleBean")
@WebService(name = "ExampleWS", targetNamespace = "http://ws.fooco.com/2011/10")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@WebContext(contextRoot = "/api")
public class ExampleBean implements ExampleWS
{
...
}
WEB-INF/jboss-web.xml looks like this:
<?xml version="1.0"?>
<!DOCTYPE jboss-web PUBLIC
-//JBoss//DTD Web Application 5.0//EN
http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd>
<jboss-web>
<context-root>/</context-root>
</jboss-web>
Is this not supported? That would make sense to me, as it is possible to have conflicting web contexts in the same WAR. However, I think it would be reasonable to issue a warning or an error message. If the contexts are the same, then maybe this could be supported?
Not sure what I'm going to do to work around this issue. I suppose I could deploy the app as an EAR, and put the web service endpoint in an ejb-jar. That way the web UI would be in a separate web context. That's probably a better design anyway.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/629882#629882]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 7 months
[JBoss Microcontainer] - How to specify dependencies on @Singleton EJBs
by gunter zeilinger
gunter zeilinger [http://community.jboss.org/people/gunterze] created the discussion
"How to specify dependencies on @Singleton EJBs"
To view the discussion, visit: http://community.jboss.org/message/629868#629868
--------------------------------------------------------------
I need to access a Singleton EJB from a JBoss MC. In opposite to dependencies to Stateless EJBs, declaring
<demands>jndi:{Singleton-impl-class-name}</demands>
does not work. Declaring
<demands>Class:{Singleton-local-interface-name}</demands>
the injection of the @EJB reference of the seems to work. But I get
WARN [ConfigureAction] Error unconfiguring bean AbstractKernelControllerContext@3b5d6b{ metadata=AbstractBeanMetaData@12021b7{name=InitDeviceHolder bean=org.dcm4chee.proxy.beans.util.InitDeviceHolder properties=[deviceHolder] classLoader=BeanMetaDataDeployer$DeploymentClassLoaderMetaData@783e0d{classloader=null} constructor=null autowireCandidate=true installs=[setDevice]}name=InitDeviceHolder target=org.dcm4chee.proxy.beans.util.InitDeviceHolder@1a68938 state=Configured depends=AbstractDependencyInfo@7ae776{idependOn=[AbstractDependencyItem@32064b{name=InitDeviceHolder dependsOn=Device whenRequired=Installed dependentState=Installed resolved=UNRESOLVED}, AbstractDependencyItem@1f7911b{name=InitDeviceHolder dependsOn=jndi:DeviceHolderBean/local-org.dcm4chee.proxy.ejb.DeviceHolder whenRequired=Configured dependentState=Installed resolved=UNRESOLVED}] unresolved=[AbstractDependencyItem@32064b{name=InitDeviceHolder dependsOn=Device whenRequired=Installed dependentState=Installed resolved=UNRESOLVED}, AbstractDependencyItem@1f7911b{name=InitDeviceHolder dependsOn=jndi:DeviceHolderBean/local-org.dcm4chee.proxy.ejb.DeviceHolder whenRequired=Configured dependentState=Installed resolved=UNRESOLVED}]}}: org.jboss.ejb3.common.resolvers.spi.UnresolvableReferenceException: Could not resolve in current deployments reference: [EJB Reference: beanInterface 'org.dcm4chee.proxy.ejb.DeviceHolder', beanName '', mappedName '']
on undeployment.
I am using JBoss 6.1.0-final.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/629868#629868]
Start a new discussion in JBoss Microcontainer at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 7 months