[JBoss Seam] - Re: GWT and SeamResourceServlet
by dbgroups
I have not solved this problem either and has not time to closely look at how SeamResourceServlet is integrated with GWT. Following are what i have tried and still Not able to solve a simple RPC call yet.
1) Starting from Seam-2.0.1CR1, i rearrange jpa booking example to make sure that it works from the source. Similarly, i re-custom GWT Kitchen sink to make it work for my purpose.
2) To hook GWT and Seam together, i follow the Seam-GWT chapter in the ref doc. The ant task does not wotk, so i write my simple ant task to transfer GWT generated client system to seam webapp that the index page is pointed to. The task also transfers required client objects such as the service, ValidationUtility and serializable transfer object to the client module under Seam to be recompiled under jdk6 (instead of jdk4 for the client system) with gwt-servlet-1.4 taken from GWT package.
3) The SeamResourceServlet is mapped in web.xml to /hub/resource/* and the endpoint URL in GWT widget to invoke the async service is mapped to /hub/resource/gwt. Different mappings are tried with no better result.
4) Putting the compiled seam application to tomcat 6, GWT client-side system is up appropriately. Using the suggested ValidationUtility in both client and server side, i see the ValidationUtility work on the client side. But once it passes the validation to be send to the server, the seam server implementation does not response and the communication between client-server always fail. The problem may come from the connection point between GWT generated implementation of XxxServiceAsync and seam component implementation of XxxServiceImpl.
I do like to have this simple integration ironed out before we can do any things more interesting. Hope someone can help.
BaTien, dbgroups
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4116192#4116192
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4116192
16 years, 11 months
[JBoss Getting Started Documentation] - JBoss installing with test and production database connectio
by bbleafs
I have a JBoss application that I build into a Jar file and place in the server/default/deploy directory of my JBoss installation. The applications deploys perfectly. What I want to do is have two versions of my application deployed on the same JBoss server. The code will be intentical except that one will connect to a test database and the other will connect to a production/live database.
How can I achieve this? (I.E. how do a deploy a second instance of the same application and how can I get my client to call objects from a specific instance )?
Current my client just creates the context to the server and calls the EJBs by name: PortableRemoteObject.narrow( homeRef, homeClass ); But I'd like some sort of way of telling it to get the test version or the production version.
Is there a relatively easy way to do this ( short of passing in a parameter to each EJB call telling it which database to connect to ).
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4116191#4116191
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4116191
16 years, 11 months
[JBoss Seam] - Re: One Seam component calling another
by breako
"sdegardin" wrote :
| 1: use @In annotation. (recommended)
|
Thanks for your suggestion. I used the @In annotation but the problem is that the second Seam component does not get it's Seam managed EntityManager set up correctly.
Basically, I have two Seam components both involved in the same transacation. Both Seam Components have Seam managed EntityManagers and because there are involved in the same transaction, the persistence context should be propagated and shared.
First Seam Component:
| @Name("manager")
| @Scope(CONVERSATION)
| public class ManagerPojo {
|
| @In
| private EntityManager em;
|
| @In (required=false, value="instancegenerator", create=true)
| private InstanceGeneratorPOJO instanceGeneratorPOJO;
|
| @Begin(join=true, flushMode=FlushModeType.MANUAL)
| public void persist() {
| //...
| instanceGeneratorPOJO.getNextInstance("Person");
| //...
| }
|
| //...
| }
|
Second Seam Component:
| @Name("instancegenerator")
| @Scope(CONVERSATION)
| public class InstanceGeneratorPOJO {
| @In
| private EntityManager entityManager;
|
| public Long getNextInstance(String type) {
| //...
| }
|
| }
|
When persist() is invoked I get:
| 15:50:41,937 FATAL [application] org.jboss.seam.RequiredException: @In attribute requires non-null value: instancegenerator.entityManager
| javax.faces.el.EvaluationException: org.jboss.seam.RequiredException: @In attribute requires non-null value: instancegenerator.entityManager
|
Note: If I remove the create=true in the first Seam component, i.e.
| @In (required=false, value="instancegenerator")
| private InstanceGeneratorPOJO instanceGeneratorPOJO;
|
the instanceGenerator reference is null and I get a Null pointer exception in the persist() method
anybody got any ideas?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4116185#4116185
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4116185
16 years, 11 months
[EJB 3.0] - Re: Ejb 3 in Jboss 5 Beta 3
by sampatn
sorry However, no null pointer exception was NOT thrown ......and deployed later on i.e. after server was started.
"sampatn" wrote : However, no null pointer exception was thrown if jar did not exist in deploy directory and copied later on after server was started.
|
| Is this a problem with the deploy/initialise order?
|
| Nilesh
|
| ###### successful start only if jar did not exist in deploy directory but later on deployed after started successfully.
|
|
| 15:28:51,557 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
| 15:28:51,823 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
| 15:28:51,823 INFO [ServerImpl] JBoss (Microcontainer) [5.0.0.Beta3 (build: SVNTag=JBoss_5_0_0_Beta3 date=200712210026)] Started in 3m:48s:288ms
| 15:28:59,463 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:jar=helloworld.jar,name=HelloUserBean,service=EJB3 with dependencies:
| 15:28:59,463 INFO [MCKernelAbstraction] and supplies:
| 15:28:59,479 INFO [MCKernelAbstraction] Class:com.ns.learn.ejb3.beans.helloworld.HelloUser
| 15:29:03,370 INFO [EJBContainer] STARTED EJB: com.ns.learn.ejb3.beans.helloworld.HelloUserBean ejbName: HelloUserBean
| 15:29:04,667 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:jar=helloworld.jar,name=SearchFacade,service=EJB3 with dependencies:
| 15:29:04,667 INFO [MCKernelAbstraction] and supplies:
| 15:29:04,667 INFO [MCKernelAbstraction] Class:com.ns.learn.ejb3.beans.searchfacade.SearchFacadeLocal
| 15:29:04,667 INFO [MCKernelAbstraction] Class:com.ns.learn.ejb3.beans.searchfacade.SearchFacade
| 15:29:06,823 INFO [EJBContainer] STARTED EJB: com.ns.learn.ejb3.beans.searchfacade.SearchFacadeBean ejbName: SearchFacade
|
| "ALRubinger" wrote : Great; when back from holiday travels I'll take a look for you.
| |
| | S,
| | ALR
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4116184#4116184
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4116184
16 years, 11 months
[EJB 3.0] - Re: Ejb 3 in Jboss 5 Beta 3
by sampatn
However, no null pointer exception was thrown if jar did not exist in deploy directory and copied later on after server was started.
Is this a problem with the deploy/initialise order?
Nilesh
###### successful start only if jar did not exist in deploy directory but later on deployed after started successfully.
15:28:51,557 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
15:28:51,823 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
15:28:51,823 INFO [ServerImpl] JBoss (Microcontainer) [5.0.0.Beta3 (build: SVNTag=JBoss_5_0_0_Beta3 date=200712210026)] Started in 3m:48s:288ms
15:28:59,463 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:jar=helloworld.jar,name=HelloUserBean,service=EJB3 with dependencies:
15:28:59,463 INFO [MCKernelAbstraction] and supplies:
15:28:59,479 INFO [MCKernelAbstraction] Class:com.ns.learn.ejb3.beans.helloworld.HelloUser
15:29:03,370 INFO [EJBContainer] STARTED EJB: com.ns.learn.ejb3.beans.helloworld.HelloUserBean ejbName: HelloUserBean
15:29:04,667 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:jar=helloworld.jar,name=SearchFacade,service=EJB3 with dependencies:
15:29:04,667 INFO [MCKernelAbstraction] and supplies:
15:29:04,667 INFO [MCKernelAbstraction] Class:com.ns.learn.ejb3.beans.searchfacade.SearchFacadeLocal
15:29:04,667 INFO [MCKernelAbstraction] Class:com.ns.learn.ejb3.beans.searchfacade.SearchFacade
15:29:06,823 INFO [EJBContainer] STARTED EJB: com.ns.learn.ejb3.beans.searchfacade.SearchFacadeBean ejbName: SearchFacade
"ALRubinger" wrote : Great; when back from holiday travels I'll take a look for you.
|
| S,
| ALR
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4116183#4116183
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4116183
16 years, 11 months
[JBoss Seam] - Re: injection in tests ?
by berkay
Hi Pete,
It must be unit testing. Here is what I have tried with best of my knowledge. Here is my @BeforeClass method :
@BeforeClass
| public void init(){
| try {
| HibernateSessionFactory hsf=new HibernateSessionFactory();
| hibernateSession=hsf.getSessionFactory().openSession();
| } catch (HibernateException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| } catch (Exception e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
|
| }
|
I get
FAILED CONFIGURATION: @BeforeMethod begin
| java.lang.IllegalStateException: Attempted to invoke a Seam component outside the an initialized application
| at org.jboss.seam.contexts.Lifecycle.getApplication(Lifecycle.java:36)
| at org.jboss.seam.contexts.Lifecycle.beginSession(Lifecycle.java:173)
| at org.jboss.seam.contexts.ServletLifecycle.beginSession(ServletLifecycle.java:124)
| at org.jboss.seam.mock.BaseSeamTest.begin(BaseSeamTest.java:918)
| at org.jboss.seam.mock.SeamTest.begin(SeamTest.java:28)
|
Happy new year
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4116179#4116179
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4116179
16 years, 11 months