[Persistence, JBoss/CMP, Hibernate, Database] - Jointable not used
by felle82
Hi all,
I am working with Jboss 5 beta 4, JPA und the HSQL Database.
This is my JoinTable definition in class Subscription:
@ManyToMany(targetEntity=com.sap.sii.pubsub.entity.Subscriber.class, fetch = FetchType.EAGER)
| @JoinTable(name = "SII_PUBSUB_SUBSCRIPTION_SUBSCRIBER",
| joinColumns = @JoinColumn(name = "SUBSCRIPTION_ID", referencedColumnName = "SUBSCRIPTION_ID"),
| inverseJoinColumns = @JoinColumn(name = "SUBSCRIBER_ID", referencedColumnName = "SUBSCRIBER_ID"))
| public ArrayList<Subscriber> getSubscribers() {
| return subscribers;
| }
The other side in class Subscriber:@ManyToMany(targetEntity=com.sap.sii.pubsub.entity.Subscription.class, fetch=FetchType.EAGER, mappedBy="subscribers")
| public ArrayList<Subscription> getSubscriptions() {
| return subscriptions;
| }
And there is the table SII_PUBSUB_SUBSCRIPTION_SUBSCRIBER with the columns SUBSCRIPTION_ID andSUBSCRIBER_ID. But when I persist the entity this table is empty but there is are the columnssubscriptions and subscribers with some data looking like object references:([B@7f8124) in the tables of subscription and subscriber.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147860#4147860
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147860
16 years, 7 months
[EJB 3.0] - Re: Why is Remote Interface not installed
by jaikiran
"baumar" wrote :
| In my - I confess not very clear understanding - the problem might be already in the packaging or deployment. I deployed a similar construction (the example 4.1 in Chapter 24 of Enterprise JavaBeans 3.0, 5th Edition By Richard Monson-Haefel). When I deploy the jar from the exercise, I can see the bean and the interface in the jmx console, whereas for the construction I made, the remote interface is just a java object, and my jar leads to a StatefulProxyFactory, which is not there in the TravelAgent.
|
|
Markus,
I think i know what's going on (the TravelAgentBean and the book you mentioned acted as a hint). I remember some months back there was a user who had reported the exact same problem. During that discussion, we had found out the issue to be the JDK (version) he was using. I guess you are using Java 6 (either on the client or on the JBoss server or maybe both). If yes, then stop using Java 6 and instead use Java 1.5 (and remember to remove all the references to Java 6 in Eclipse, JBoss and the client - i mean do a clean build after setting the JAVA_HOME to JDK 1.5). If this does not solve the issue and please post back with the details.
"baumar" wrote :
| Is this typical to face so many problems and difficulties with deploying the jar file with eclipse to JBoss? (Maybe there is a self-aid group?-)
|
Personally, with JBoss i do not use any IDEs for deploying (because deploying is just a matter of copying to the deploy folder) or building (i use Ant instead). Using an IDE for these activities adds an layer of unneccessary complications.
"baumar" wrote :
| I saw later version provide more support, like in 4.2.2, but on one side I was missing documentation and on the other hand, the 'comfort-function' even hided more, what happened.
|
I would definitely recommend that you move to the latest stable version (4.2.2 GA), if not immidiately then maybe some time later. The documentation is definitely available on the JBoss site. Let us know if you are not able to locate it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147846#4147846
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147846
16 years, 7 months
[JBoss Messaging] - Problem in creating Jboss Messaging .sar deploying
by ssjboss
Hi,
I am trying to implement jboss messaging listener service.
Content of my .sar file is
----------------------------------
jar -tf message_listener_service.sar
-------------------------------------------
META-INF/
| META-INF/MANIFEST.MF
| src/
| src/service/
| META-INF/jboss-service.xml
| commons-io-1.2.jar
| commons-logging-1.1.jar
| javassist.jar
| jboss-aop-jdk50.jar
| jboss-common.jar
| jboss-j2ee.jar
| jboss-jmx.jar
| jboss-messaging-client.jar
| jboss-messaging.jar
| jboss-remoting.jar
| jboss-system.jar
| jboss-xml-binding.jar
| jbossall-client.jar
| log4j.jar
| src/service/Listener.class
| trove.jar------------------------
Content of -> META-INF/jboss-service.xml is
------------------
<server>
| <mbean code="src.service.Listener"
| name="service.directory.monitor:src.service=Listener">
| </mbean>
| <server>
----------------
Listener code
---------------
package src.service;
|
| /*
| Use source code downloads, example commands,
| and any other techniques at your own risk.
| No warranty is provided.
| */
|
| import java.util.Properties;
|
| import javax.jms.JMSException;
| import javax.jms.Message;
| import javax.jms.MessageListener;
| import javax.jms.TextMessage;
| import javax.jms.Topic;
| import javax.jms.TopicConnection;
| import javax.jms.TopicConnectionFactory;
| import javax.jms.TopicSession;
| import javax.jms.TopicSubscriber;
| import javax.naming.Context;
| import javax.naming.InitialContext;
| import javax.naming.NamingException;
|
| public class Listener implements MessageListener {
|
| String url_;
| String name_;
| TopicConnection conn = null;
| TopicSession session = null;
| Topic topic = null;
|
| public Listener(String url, String name) {
| super();
|
| url_ = url;
| name_ = name;
|
| try {
| this.initializeListener();
| } catch (Exception e) {
| System.out.println("Error creating listener: " + e);
| e.printStackTrace();
| }
|
| }
|
| public void onMessage(Message msg) {
|
| TextMessage tm = (TextMessage) msg;
|
| try {
| System.out.println("Incoming message: " + tm.getText());
| } catch (Exception e) {
| e.printStackTrace();
| }
| }
|
| private void initializeListener() throws JMSException, NamingException {
|
| Properties props = new Properties();
| props.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
| props.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
| props.setProperty("java.naming.provider.url", url_);
|
| Context context = new InitialContext(props);
| System.out.println("performing lookup...");
|
| Object tmp = context.lookup("MyExampleConnectionFactory");
| System.out.println("lookup completed, making topic");
|
| TopicConnectionFactory tcf = (TopicConnectionFactory) tmp;
| conn = tcf.createTopicConnection();
| topic = (Topic) context.lookup(name_);
|
| session = conn.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE);
| conn.start();
|
| TopicSubscriber recv = session.createSubscriber(topic);
|
| recv.setMessageListener(this);
| }
|
|
| public void disconnect() throws JMSException {
| if(conn != null) {
| conn.stop();
| }
|
| if(session != null) {
| session.close();
| }
|
| if(conn != null) {
| conn.close();
| }
| }
|
| public static void main(String args[]) {
|
| System.out.println("Starting JMS Example Listener");
| System.out.println("Program will be active for 1 minute.");
|
| //change these values to your situtation:
| Listener listener = new Listener("localhost:1099", "topic/myTopic");
|
|
| //leave it open for 2 minutes:
| try {
| Thread.sleep(97000);
| } catch(Exception e) {
| System.out.println("Error sleeping: " + e);
| e.printStackTrace();
| }
|
| try {
| System.out.println("Listener before Diss");
| listener.disconnect();
| } catch(Exception e) {
| System.out.println("Error terminating listener JMS objects: " + e);
| e.printStackTrace();
| }
|
| System.out.println("Done listening");
| }
| }
-------------
I started server as: run -c <my_config_name>
I am getting fallowing error when i placed message_listener_service.sar in - C:\myjboss-4.2.2\jboss-4.2.2.GA\server\messaging\deploy
17:55:17,015 ERROR [MainDeployer] Could not create deployment: file:/C:/myjboss-
| 4.2.2/jboss-4.2.2.GA/server/messaging/deploy/message_listener_service.sar
| org.jboss.deployment.DeploymentException: src.service.Listener.<init>(); - neste
| d throwable: (java.lang.NoSuchMethodException: src.service.Listener.<init>())
| at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java
| :196)
| at org.jboss.system.ServiceController.install(ServiceController.java:226
| )
| at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
| sorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
| er.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| 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 $Proxy4.install(Unknown Source)
| at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
| sorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
| er.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
| or.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
| BeanOperationInterceptor.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 $Proxy9.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
| tScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
| canner.java:634)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
| doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
| loop(AbstractDeploymentScanner.java:274)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
| run(AbstractDeploymentScanner.java:225)
| Caused by: java.lang.NoSuchMethodException: src.service.Listener.<init>()
| at java.lang.Class.getConstructor0(Class.java:2678)
| at java.lang.Class.getConstructor(Class.java:1629)
| at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:
| 1232)
| at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:
| 286)
| at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:
| 344)
| at org.jboss.system.ServiceCreator.install(ServiceCreator.java:157)
| at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigura
| tor.java:451)
| at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java
| :171)
| ... 33 more
I tried in google also, it is urgent, please help me , I have to add any jar files, need to change any .xml files (or) I have to change my listener ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147835#4147835
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147835
16 years, 7 months
[JBoss Cache: Core Edition] - Re: Should be able to use ClusteredCacheLoader with CacheMod
by manik.surtani@jboss.com
"lovelyliatroim" wrote :
|
| Now take sequence of events as follows
| 1. Node A receives request for data item X
| 2. Data Item X, not there, retrieve from source and place in cache.
| 3. 14 mins later Node B is asked for data item X,it doesnt have it but node A does and is replicated on B via CCL.
| 4. Data Item X is removed from the cache on node A because its 15 minute lifetime expectancy is up.
| 5. Node A receives request for data item X,it doesnt have it but node B does. data Item is replicated on to A via CCL. So actually data item X is older than 15 minutes in reality.
|
| Can the above scenario happen? Will node A keep data Item X for another 15 mins and also have the possibility of the cycle continuing or does NODE B when it receives data Item X know that it must be evicted in 1 minutes time??
|
| So does jboss cache replicate the timestamp of a data item if it is replicated from one node to another via CCL??
|
| if not as a possible solution to achieve this could one write their own eviction policy and use an internal ID(member variable) that is transferred from node to node?
|
|
This depends on which eviction policy you use. If you use the expiration policy, the expiry time is encoded as data on a node which means it will replicate to B and get evicted at the appropriate time.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147834#4147834
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147834
16 years, 7 months