Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Where did I go wrong? ( Java Service Component )

6 posts in General Discussion (old) Last posting was on 2000-04-03 21:30:00.0Z
Andrew Hart Posted on 2000-03-31 00:18:52.0Z
Newsgroups: sybase.public.easerver
Date: Thu, 30 Mar 2000 18:18:52 -0600
From: Andrew Hart <Andrew_Hart@harcourt.com>
Organization: The Psychological Corporation
X-Mailer: Mozilla 4.7 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Where did I go wrong? ( Java Service Component )
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 48
NNTP-Posting-Host: 167.208.175.68
Message-ID: <347_38E3EEEC.90FEE4C4@harcourt.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:25163
Article PK: 154262

OK, back in the alien shrouded mists of Java land...

I created a simple test service component in Java using the example
previously posted by, uh, Dave Wolf, I think.
My problem is that I don't understand why my implementation failed to
get deployed by PowerJ, even a CTL-ALT/B showed that the build completed
successfully.

I used the EJB Server component wizard to generate a project, then
pasted the sample code into the implementation.
I added the Run, Start, and Stop methods to the interface. I deployed
it to the Jaguar server. I edited the component's
properties and set the interface to: CtsServices::GenericService,
Scheduler::jagScheduler
(the package and name of my component). I generated the skeleton files,
went to the java/classes directory and compiled them with javac. I
added the package and component to the server properties to add it as a
service.

I restarted the server. I kept seeing a CORBA exception NO_IMPLEMENT.
Upon inspection, I discovered that that
was because the implementation file in
java/classes/com/harcourt/scheduler was doing just that. It looked like
the "dummy" files generated by JagManager. In other words, not my
actual implementation file.

I then went through many iterations of re-deploying and compiling the
things, but no matter what I tried, I couldn't get my actual
jagSchedulerImpl.java file to appear in that directory by deploying from
PowerJ. Finally, I just copied it manually to that directory, compiled
it and it worked the first time. (Also, I added the other Enterprise
Javabean methods to the interface file on PowerJ (activate, etc...)
Those still don't show up in JagManager.

So what was I missing?

It looked like the classes in the jar file in %JAGUAR%/java were there
alright, but not in the com/harcourt/scheduler directory (which was the
class).

Thanks.


Dave Wolf [Sybase] Posted on 2000-03-31 12:00:39.0Z
Newsgroups: sybase.public.easerver
From: "Dave Wolf [Sybase]" <dwolf@sybase.com>
Subject: Re: Where did I go wrong? ( Java Service Component )
Date: Fri, 31 Mar 2000 07:00:39 -0500
Lines: 54
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
NNTP-Posting-Host: nomad6-3.sybase.com 157.133.176.3
Message-ID: <347_DsIKklwm$GA.290@forums.sybase.com>
References: <347_38E3EEEC.90FEE4C4@harcourt.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:25131
Article PK: 154230

When you added the methods to your EJB 1.0 did you add them only to the bean
implementation or did you add them to your remote interface as well?

Dave Wolf
Internet Applications Division

"Andrew Hart" <Andrew_Hart@harcourt.com> wrote in message
news:38E3EEEC.90FEE4C4@harcourt.com...
>
> OK, back in the alien shrouded mists of Java land...
>
> I created a simple test service component in Java using the example
> previously posted by, uh, Dave Wolf, I think.
> My problem is that I don't understand why my implementation failed to
> get deployed by PowerJ, even a CTL-ALT/B showed that the build completed
> successfully.
>
> I used the EJB Server component wizard to generate a project, then
> pasted the sample code into the implementation.
> I added the Run, Start, and Stop methods to the interface. I deployed
> it to the Jaguar server. I edited the component's
> properties and set the interface to: CtsServices::GenericService,
> Scheduler::jagScheduler
> (the package and name of my component). I generated the skeleton files,
> went to the java/classes directory and compiled them with javac. I
> added the package and component to the server properties to add it as a
> service.
>
> I restarted the server. I kept seeing a CORBA exception NO_IMPLEMENT.
> Upon inspection, I discovered that that
> was because the implementation file in
> java/classes/com/harcourt/scheduler was doing just that. It looked like
> the "dummy" files generated by JagManager. In other words, not my
> actual implementation file.
>
> I then went through many iterations of re-deploying and compiling the
> things, but no matter what I tried, I couldn't get my actual
> jagSchedulerImpl.java file to appear in that directory by deploying from
> PowerJ. Finally, I just copied it manually to that directory, compiled
> it and it worked the first time. (Also, I added the other Enterprise
> Javabean methods to the interface file on PowerJ (activate, etc...)
> Those still don't show up in JagManager.
>
> So what was I missing?
>
> It looked like the classes in the jar file in %JAGUAR%/java were there
> alright, but not in the com/harcourt/scheduler directory (which was the
> class).
>
> Thanks.
>
>


Andrew Hart Posted on 2000-03-31 17:47:47.0Z
Newsgroups: sybase.public.easerver
Date: Fri, 31 Mar 2000 11:47:47 -0600
From: Andrew Hart <Andrew_Hart@harcourt.com>
Organization: The Psychological Corporation
X-Mailer: Mozilla 4.7 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Where did I go wrong? ( Java Service Component )
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 56
NNTP-Posting-Host: 167.208.175.68
Message-ID: <347_38E4E4C3.6A6BC1F7@harcourt.com>
References: <347_38E3EEEC.90FEE4C4@harcourt.com> <347_DsIKklwm$GA.290@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:25071
Article PK: 154185

I added them only on the client side, in PowerJ, to the EJB interface file.
Well, and of course I added them to the bean implementation as well. When you
say "remote interface" are you talking about editing an IDL file on the jaguar
server? This is only my second or third Java outing, but I thought I recalled
only having to define them in the "interface" file in PowerJ. I thought upon
deployment that the remote interface was created corresponding to that interface
file.

Hmm, now I'm even more puzzled. I just created another Jaguar server EJB from
scratch. Perhaps I misstated my problem earlier. When I make changes to my
implementation and interface in PowerJ and then deploy, the methods show up in
JagMan. When, I generate skeletons under java/classes, the
componentImpl.java.new file that gets created always just contains empty methods
that throw a CORBA:NO_IMPLEMENT exception.

So, I guess my questions are:

When you create and deploy components from PowerJ are you always required to
copy the actual java implementation files over to your directories under the
codebase and then compile them? I thought it was supposed to be automatic in
PowerJ.

If you are creating a service component, is there no need to specify them in
your PowerJ java interface file? ... that is to say, since you're specifying the
interface CtsServices::GenericServices that takes care of defining the interface
for start, run, and stop? So, you'd only want to include other methods that you
want in the interface, for example, methods that you might use in a client
service control program to set properties of the service?

When I created my EJB from scratch as a test, I noticed that under the classes
view I had a red bullet that said "Remote Interface Methods". I notice that the
EJB that's giving me problems doesn't have this, so I must have mashed it
somehow. Is this only a bookmark? Or does it have some other significance?

Thanks.

"Dave Wolf [Sybase]" wrote:

> When you added the methods to your EJB 1.0 did you add them only to the bean
> implementation or did you add them to your remote interface as well?
>
> Dave Wolf
> Internet Applications Division
>


Dave Wolf [Sybase] Posted on 2000-03-31 17:47:49.0Z
Newsgroups: sybase.public.easerver
From: "Dave Wolf [Sybase]" <dwolf@sybase.com>
Subject: Re: Where did I go wrong? ( Java Service Component )
Date: Fri, 31 Mar 2000 12:47:49 -0500
Lines: 89
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
NNTP-Posting-Host: nomad6-28.sybase.com 157.133.176.28
Message-ID: <347_j3mTqnzm$GA.290@forums.sybase.com>
References: <347_38E3EEEC.90FEE4C4@harcourt.com> <347_DsIKklwm$GA.290@forums.sybase.com> <347_38E4E4C3.6A6BC1F7@harcourt.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:25068
Article PK: 154182

Ok a few things.

1) When you deploy everything is done for you. You dont have to copy
anything over at all, or touch IDL.

2) In EJB there are 3 classes deployed to the server.

a) The Bean itself is the actual implementation
b) The Home interface creates the implementation. Unless you want your
create() to take parameters, dont worry about it.
c) The Remote interface defines the clients view of the object. If you
do not add the method signatures to the remote interface they are not
publically callable. In other words not even Jag can call them. In PowerJ
when creating an EJB you add all methods to the RemoteInterface. We then
also add the method to the implementation for you automatically.

Dave Wolf
Internet Applications Division

"Andrew Hart" <Andrew_Hart@harcourt.com> wrote in message
news:38E4E4C3.6A6BC1F7@harcourt.com...
> I added them only on the client side, in PowerJ, to the EJB interface
file.
> Well, and of course I added them to the bean implementation as well. When
you
> say "remote interface" are you talking about editing an IDL file on the
jaguar
> server? This is only my second or third Java outing, but I thought I
recalled
> only having to define them in the "interface" file in PowerJ. I thought
upon
> deployment that the remote interface was created corresponding to that
interface
> file.
>
> Hmm, now I'm even more puzzled. I just created another Jaguar server EJB
from
> scratch. Perhaps I misstated my problem earlier. When I make changes to
my
> implementation and interface in PowerJ and then deploy, the methods show
up in
> JagMan. When, I generate skeletons under java/classes, the
> componentImpl.java.new file that gets created always just contains empty
methods
> that throw a CORBA:NO_IMPLEMENT exception.
>
> So, I guess my questions are:
>
> When you create and deploy components from PowerJ are you always required
to
> copy the actual java implementation files over to your directories under
the
> codebase and then compile them? I thought it was supposed to be automatic
in
> PowerJ.
>
> If you are creating a service component, is there no need to specify them
in
> your PowerJ java interface file? ... that is to say, since you're
specifying the
> interface CtsServices::GenericServices that takes care of defining the
interface
> for start, run, and stop? So, you'd only want to include other methods
that you
> want in the interface, for example, methods that you might use in a client
> service control program to set properties of the service?
>
> When I created my EJB from scratch as a test, I noticed that under the
classes
> view I had a red bullet that said "Remote Interface Methods". I notice
that the
> EJB that's giving me problems doesn't have this, so I must have mashed it
> somehow. Is this only a bookmark? Or does it have some other
significance?
>
> Thanks.
>
> "Dave Wolf [Sybase]" wrote:
>
> > When you added the methods to your EJB 1.0 did you add them only to the
bean
> > implementation or did you add them to your remote interface as well?
> >
> > Dave Wolf
> > Internet Applications Division
> >
>


Andrew Hart Posted on 2000-04-03 21:24:00.0Z
Newsgroups: sybase.public.easerver
Date: Mon, 03 Apr 2000 16:24:00 -0500
From: Andrew Hart <Andrew_Hart@harcourt.com>
Organization: The Psychological Corporation
X-Mailer: Mozilla 4.7 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Where did I go wrong? ( Java Service Component )
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 65
NNTP-Posting-Host: 167.208.175.68
Message-ID: <347_38E90BF0.8B2B95C5@harcourt.com>
References: <347_38E3EEEC.90FEE4C4@harcourt.com> <347_DsIKklwm$GA.290@forums.sybase.com> <347_38E4E4C3.6A6BC1F7@harcourt.com> <347_j3mTqnzm$GA.290@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:24877
Article PK: 155291

Well, I was all set to document every stop and go "Aha!'... but I've disproven
my own theory. I thought that upon deploying a component to Jaguar via PowerJ,
I would find that it would deploy the component and interface to jaguar, but
when I called it from a client I would get the dreaded "Did you Remember to
Generate a Skeleton?" message... but I found that wasn't true. My confusion
must derive from the fact that my previous attempts involved importing existing
java files into jaguar. Instead, I found that deploying a java component from
PowerJ puts the Jar file in %JAGUAR%/classes, the skeleton files are generated
in the tmpgen directory. There is no directory structure deployed below
%JAGUAR%/classes (eg., java/classes/com/harcourt/packagename )

So, my first question:
Is it true that you should only need to generate skeletons (which creates the
directory structure under java/classes), copy the implementation, and compile it
on the server when you are NOT deploying from PowerJ?

Second Question(s) (and this is the big one right now):
I created a java service component, deployed it via PowerJ, edited the component
properties and added CtsServices::GenericServices to the interface. Upon
creating the Powerbuilder proxies, I find that there are two proxies generated:
one for GenericService and one for the component interface. If I add start,
stop, and run to the component interface in powerJ, I get messages about the
duplication in Jaguar's server log and it causes all sorts of really weird
behaviour in PB. If I leave those out of the component interface (so they're
only specified via CtsServices::GenericService), I can't reference those methods
(start,stop, run) upon instantiating an instance of the component in PB.

Thanks.

"Dave Wolf [Sybase]" wrote:

> Ok a few things.
>
> 1) When you deploy everything is done for you. You dont have to copy
> anything over at all, or touch IDL.
>
> 2) In EJB there are 3 classes deployed to the server.
>
> a) The Bean itself is the actual implementation
> b) The Home interface creates the implementation. Unless you want your
> create() to take parameters, dont worry about it.
> c) The Remote interface defines the clients view of the object. If you
> do not add the method signatures to the remote interface they are not
> publically callable. In other words not even Jag can call them. In PowerJ
> when creating an EJB you add all methods to the RemoteInterface. We then
> also add the method to the implementation for you automatically.


Andrew Hart Posted on 2000-04-03 21:30:00.0Z
Newsgroups: sybase.public.easerver
Date: Mon, 03 Apr 2000 16:30:00 -0500
From: Andrew Hart <Andrew_Hart@harcourt.com>
Organization: The Psychological Corporation
X-Mailer: Mozilla 4.7 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Where did I go wrong? ( Java Service Component )
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 12
NNTP-Posting-Host: 167.208.175.68
Message-ID: <347_38E90D58.CEBF9E8E@harcourt.com>
References: <347_38E3EEEC.90FEE4C4@harcourt.com> <347_DsIKklwm$GA.290@forums.sybase.com> <347_38E4E4C3.6A6BC1F7@harcourt.com> <347_j3mTqnzm$GA.290@forums.sybase.com> <347_38E90BF0.8B2B95C5@harcourt.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:24875
Article PK: 155292

I should also add that, as of right now, I haven't enabled the component to run as a
service yet. Ie., I have not added it to the server properties yet... I wanted to
test first that I was able to call the methods from a PB client.

So, the question is: when you specify multiple interfaces for a component and
generate PB proxies, how should the proxies be generated: as separate proxies, or
not? If not, then how does it work in PB?