Few Java EE questions
Hey guys
I am writing my first EE application and running into a few problems and would appreciate any help i can get
overview
At the moment the application consists of an enterprise module and a windows client application.
Web module will be done later
SQL server 2005 is the database being used
using netbeans IDE using the bundled application server 9 at the moment
so far i just have a entity class for one of the tables in my database with a stateless session bean to act as a communication bridge from the windows client to the entity.
The entity module is built and deployed on the server
The goal is to run the application client from a remote computer and not from deployin it to the application server as the Netbeans IDE does if u click run project, so for my testing i go to the jar file on the computer directly and run it from there
my client application has a main class and a JFrame class for the gui part for initial testing. Here are the problems
First scenario
if i inject a enterprise resource in the main file (right clicking ..popup menu way) it injects the annotation @EJB and the bean instance variable as expected, however it does not seem to modify the application-client.xml file. This all seems good but when i try to use that reference and call any of my bean functions, the run fails both directly and through the application server, but seems to run in debug mode for some reason. ?
second scenario
instead of injecting the resource in the main file, i inject it in my frame class and instead of the @ejb annotation i get a private function which gets teh initial context for the session bean and looks it up explictly. It also modifies the application-client.xml file and adds the following
<ejb-ref>
<ejb-ref-name>ejb/CustomerBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<remote>mypackage.stateless.session.CustomerRemote</remote>
</ejb-ref>
ok, so i use this remote object and call my function, it seems to run from the application server now, but now when i run it directly from my computer my GUI never materializes, i mean i see teh exe running in the task manager but nothing shows up., but the gui works fine when i run it from the application server. doenst make sense to me? what am i missing here?
Why do the two scenarios occur, i.e why annotation for one and not for the other and why does the first one not even run in application server unless in debug mode. In the first scenario, do i need to add the stuff in the xml file manually? why cant i run the second scenario directly from the PC
If i cant run this application client remotely then there is no use, I created teh client with the check option to create it when i created the enterprise application, Do i need to create a normal client application that is not bundled with the enterprise app for it to work, my understanding is that bundling it makes it easier as it lets u inject resourses and still lets u run remotely. Any help will be greatly appreciated
On a side note, has anyone had any problems using sql schema with their applications, When i create an entity using databases , i only see my dbo schema, even though i have four schemas in my database. Even in runtime if i make a connection if only shows dbo unless i go to the property editor and manually change it, in which case it seems to take it but that way i am restricted to one schema. Any one has any link or code for a step by step of using MS Sql 2005 with EE? I basically am goin on trial an error on that one as i couldnt find any solid examples of this, Most examples of setting up databases using the application server 9 and using EE application use the bundled db, but i figured it would be similar. maybe i am missing some important step.

