[EJB 3.0] - Getting Syntax error with EJB 3.0.
by dvuday
Hi every body I'm Uday...
I am new to EJB 3.0 and I am getting the following Error in the Satateless Session Bean program given below..This is the example given in the JBoss trialblazer. I have put the necessary jar files in the classpath of the project.
Eclipse is showing Syntax error at "@Stateless"..saying @Stateless cannot be resolved...
Can any body please help me
package trail.slsb;
import org.jboss.annotation.ejb.LocalBinding;
import javax.ejb.*;
@Stateless
// @LocalBinding (jndiBinding="EJB3Trail/slsb/Calculator")
public class StatelessCalculator implements Calculator {
public double calculate (int start, int end, double growthrate, double saving) {
double tmp = Math.pow(1. + growthrate / 12., 12. * (end - start) + 1);
return saving * 12. * (tmp - 1) / growthrate;
}
}
Thanks in advance
Uday
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993527#3993527
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993527
19 years, 4 months
[JBoss Seam] - Re: Can Seam work with no ejb3 but with Hibernate ORM?
by pgrillo
Sorry, i "thought" i was monitoring this thread, so missed the info.
Since then we have decided that Seam is an excellent way to go with our thin client implementation of our system. I'm trying to get my hands around whether and how we can integrate our current hibernate 3.2 based component into Seam, without having a dependency on Seam, since our component will also be used in other applications that are not thin client.
What we have:
|
| Set of Pojo Business Objects, quite robust.
| Set of DAOs pretty much consistent with Christian's approach in Java Peristence with Hibernate
| DAOs use getCurrenSession
| Currently use "hibernate.current_session_context_class=managed"
| Currently using our own filterservlet, would move to Seam handling it.
| HibernateFactory is built dynamically by our own Factory component, where the DAO can reference it
| Use Java 5 and Tomcat 5.5.9, as well as weblogic.
| We do not currently use JTA or EJB3, or even JNDI
|
|
|
| So we now wish to use Seam. Our above DAOs would be readily available to any seam component that needs it, simply by accessing our Factory. Generally speaking, the session is not as interesting or important to our components as the DAOs. That is injecting the session might be nice, but injecting the session into a DAO makes DAO dependent on seam injection.
|
| What i need is simply (or not so simply) to
|
| | have Seam manage the hibernate session in a way that it continues to be available to our DAOs, and also, if possible, to allow transaction demarcation when needed at least where Seam intercepts and manages the session
| |
|
| The excerpt below seems to show how to do this. However, it says "if we want a Seam managed Hibernate Session to be available" which is okay, but does this imply that doing the following also acheives my above goal? Hibernate manages the lifecycle of the session, and also provides access to the hibernate session to our DAOS (getCurrentSession?) "without" injection, since i do not want injection inside the DAOs?
|
|
| anonymous wrote :
| | 9.5.2. Using a Seam-managed Hibernate Session
| |
| | We will also need to configure a managed session if we want a Seam managed Hibernate Session to be available via injection.
| |
| | To configure our Seam component, as usual, we use components.xml:
| | <component class="org.jboss.seam.core.Hibernate"/>
| | | <component name="bookingDatabase"
| | | class="org.jboss.seam.core.ManagedHibernateSession">
| | | <property name="sessionFactoryJndiName">java:/bookingSessionFactory</property>
| | | </component>
| | |
|
|
|
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993526#3993526
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993526
19 years, 4 months
[Messaging, JMS & JBossMQ] - Can connect as Client but not as MDB
by akhammon
I can send a message to the queue authenticated by ldap but I cannot get the mbd to connect to consume the message.
please advise.
Below is my stack trace.
2006-12-13 13:06:35,680 INFO [org.jboss.resource.adapter.jms.inflow.JmsActivation] Attempting to reconnect org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@4fbad6(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter(a)1b1c978 destination=queue/tutorial/example isTopic=false tx=true durable=false clientID=akhammon reconnect=10 provider=java:/DefaultJMSProvider user=akhammon pass=<not shown> maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=0)
2006-12-13 13:06:35,680 DEBUG [org.jboss.resource.adapter.jms.inflow.JmsActivation] Setting up org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@4fbad6(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter(a)1b1c978 destination=queue/tutorial/example isTopic=false tx=true durable=false clientID=akhammon reconnect=10 provider=java:/DefaultJMSProvider user=akhammon pass=<not shown> maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=0)
2006-12-13 13:06:35,680 DEBUG [org.jboss.resource.adapter.jms.inflow.JmsActivation] Retrieving the jms provider adapter java:/DefaultJMSProvider for org.jboss.resource.adapter.jms.inflow.JmsActivation@11a2c8f(spec=org.jboss.resource.adapter.jms.inflow.JmsActivationSpec(a)4fbad6 mepf=org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory@1639a4b active=true transacted=true)
2006-12-13 13:06:35,680 DEBUG [org.jboss.resource.adapter.jms.inflow.JmsActivation] Using jms provider adapter org.jboss.jms.jndi.JNDIProviderAdapter@46d485 for org.jboss.resource.adapter.jms.inflow.JmsActivation@11a2c8f(spec=org.jboss.resource.adapter.jms.inflow.JmsActivationSpec(a)4fbad6 mepf=org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory@1639a4b active=true transacted=true)
2006-12-13 13:06:35,680 DEBUG [org.jboss.resource.adapter.jms.inflow.JmsActivation] Using context {java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, jnp.partitionName=ADVENG, jnp.discoveryTimeout=5000, jnp.discoveryGroup=230.0.0.4, jnp.disableDiscovery=false, java.naming.provider.url=10.2.177.28:1100, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces, jnp.maxRetries=1, jnp.discoveryPort=1102, jnp.discoveryTTL=16} for org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@4fbad6(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter(a)1b1c978 destination=queue/tutorial/example isTopic=false tx=true durable=false clientID=akhammon reconnect=10 provider=java:/DefaultJMSProvider user=akhammon pass=<not shown> maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=0)
2006-12-13 13:06:35,680 DEBUG [org.jboss.mq.referenceable.SpyDestinationObjectFactory] SpyDestinationObjectFactory->getObjectInstance()
2006-12-13 13:06:35,680 DEBUG [org.jboss.resource.adapter.jms.inflow.dlq.AbstractDLQHandler] Attempting to lookup dlq connection factory XAConnectionFactory
2006-12-13 13:06:35,680 DEBUG [org.jboss.mq.referenceable.SpyConnectionFactoryObjectFactory] Extracting SpyConnectionFactory from reference
2006-12-13 13:06:35,681 DEBUG [org.jboss.mq.referenceable.SpyConnectionFactoryObjectFactory] The GenericConnectionFactory is: GenericConnectionFactory[server=org.jboss.mq.il.uil2.UILServerIL@1dcc1e2 connectionProperties={ClientILService=org.jboss.mq.il.uil2.UILClientILService, UIL_TCPNODELAY_KEY=yes, UIL_CHUNKSIZE_KEY=1000000, UIL_CONNECTADDRESS_KEY=null, UIL_CONNECTPORT_KEY=0, UIL_SOTIMEOUT_KEY=120000, UIL_RECEIVE_REPLIES_KEY=No, UIL_ADDRESS_KEY=10.2.177.28, UIL_PORT_KEY=8093, PingPeriod=60000, UIL_BUFFERSIZE_KEY=2048}]
2006-12-13 13:06:35,681 DEBUG [org.jboss.resource.adapter.jms.inflow.dlq.AbstractDLQHandler] Got dlq connection factory org.jboss.mq.SpyXAConnectionFactory@3d0564 from XAConnectionFactory
2006-12-13 13:06:35,681 DEBUG [org.jboss.resource.adapter.jms.inflow.dlq.AbstractDLQHandler] Attempting to create queue connection with user null
2006-12-13 13:06:35,682 DEBUG [org.jboss.mq.il.uil2.SocketManager] Begin ReadTask.run
2006-12-13 13:06:35,682 DEBUG [org.jboss.mq.il.uil2.SocketManager] Begin WriteTask.run
2006-12-13 13:06:35,682 DEBUG [org.jboss.mq.il.uil2.SocketManager] Created ObjectOutputStream
2006-12-13 13:06:35,682 DEBUG [org.jboss.mq.il.uil2.SocketManager] Begin ReadTask.run
2006-12-13 13:06:35,682 DEBUG [org.jboss.mq.il.uil2.SocketManager] Begin WriteTask.run
2006-12-13 13:06:35,682 DEBUG [org.jboss.mq.il.uil2.SocketManager] Created ObjectOutputStream
2006-12-13 13:06:35,683 DEBUG [org.jboss.mq.il.uil2.SocketManager] Created ObjectInputStream
2006-12-13 13:06:35,683 ERROR [org.jboss.mq.sm.file.DynamicLoginModule] Failed to load DynamicSecurityManager
java.lang.ClassCastException: org.jboss.mq.sm.jdbc.JDBCStateManager cannot be cast to org.jboss.mq.sm.file.DynamicStateManager
at org.jboss.mq.sm.file.DynamicLoginModule.initialize(DynamicLoginModule.java:68)
at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:756)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
at org.jboss.security.plugins.JaasSecurityManager.defaultLogin(JaasSecurityManager.java:601)
at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecurityManager.java:535)
at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:344)
at org.jboss.mq.security.SecurityManager.authenticate(SecurityManager.java:215)
at org.jboss.mq.security.ServerSecurityInterceptor.authenticate(ServerSecurityInterceptor.java:66)
at org.jboss.mq.server.TracingInterceptor.authenticate(TracingInterceptor.java:613)
at org.jboss.mq.server.JMSServerInvoker.authenticate(JMSServerInvoker.java:172)
at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocketManagerHandler.java:235)
at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:395)
at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:398)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
at java.lang.Thread.run(Thread.java:619)
2006-12-13 13:06:35,684 DEBUG [org.jboss.mq.il.uil2.SocketManager] Created ObjectInputStream
2006-12-13 13:06:35,685 DEBUG [org.jboss.mq.il.uil2.ServerSocketManagerHandler] Exiting on IOE
java.io.InterruptedIOException: Operation interrupted
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:237)
at org.jboss.util.stream.NotifyingBufferedInputStream.read(NotifyingBufferedInputStream.java:79)
at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2247)
at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2427)
at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2497)
at java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream.java:2569)
at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2718)
at java.io.ObjectInputStream.readByte(ObjectInputStream.java:895)
at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:316)
at java.lang.Thread.run(Thread.java:619)
2006-12-13 13:06:35,686 DEBUG [org.jboss.mq.il.uil2.SocketManager] End WriteTask.run
2006-12-13 13:06:35,686 DEBUG [org.jboss.mq.il.uil2.SocketManager] End ReadTask.run
2006-12-13 13:06:35,686 ERROR [org.jboss.resource.adapter.jms.inflow.JmsActivation] Unable to reconnect org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@4fbad6(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter(a)1b1c978 destination=queue/tutorial/example isTopic=false tx=true durable=false clientID=akhammon reconnect=10 provider=java:/DefaultJMSProvider user=akhammon pass=<not shown> maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=0)
javax.jms.JMSSecurityException: User: null is NOT authenticated
at org.jboss.mq.security.SecurityManager.authenticate(SecurityManager.java:230)
at org.jboss.mq.security.ServerSecurityInterceptor.authenticate(ServerSecurityInterceptor.java:66)
at org.jboss.mq.server.TracingInterceptor.authenticate(TracingInterceptor.java:613)
at org.jboss.mq.server.JMSServerInvoker.authenticate(JMSServerInvoker.java:172)
at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocketManagerHandler.java:235)
at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:395)
at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:398)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
at java.lang.Thread.run(Thread.java:619)
2006-12-13 13:06:35,687 DEBUG [org.jboss.resource.adapter.jms.inflow.JmsActivation] Tearing down org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@4fbad6(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter(a)1b1c978 destination=queue/tutorial/example isTopic=false tx=true durable=false clientID=akhammon reconnect=10 provider=java:/DefaultJMSProvider user=akhammon pass=<not shown> maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=0)
2006-12-13 13:06:35,687 DEBUG [org.jboss.resource.adapter.jms.inflow.JmsActivation] Removing DLQ org.jboss.resource.adapter.jms.inflow.JmsActivation@11a2c8f(spec=org.jboss.resource.adapter.jms.inflow.JmsActivationSpec(a)4fbad6 mepf=org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory@1639a4b active=true dlq=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler@119587d transacted=true)
2006-12-13 13:06:35,687 DEBUG [org.jboss.resource.adapter.jms.inflow.JmsActivation] Tearing down complete org.jboss.resource.adapter.jms.inflow.JmsActivation@11a2c8f(spec=org.jboss.resource.adapter.jms.inflow.JmsActivationSpec(a)4fbad6 mepf=org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory@1639a4b active=true transacted=true)
2006-12-13 13:06:35,687 DEBUG [org.jboss.mq.il.uil2.SocketManager] End ReadTask.run
2006-12-13 13:06:35,687 DEBUG [org.jboss.mq.il.uil2.SocketManager] End WriteTask.run
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993521#3993521
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993521
19 years, 4 months