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.

Cannot Instantiate class: com.sybase.ejb.InitialContextFactory

2 posts in EJB Client Last posting was on 2005-01-25 23:43:52.0Z
Renato Gonzalez Posted on 2005-01-25 23:39:50.0Z
Sender: 6fe1.41f6d270.1804289383@sybase.com
From: Renato Gonzalez
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Cannot Instantiate class: com.sybase.ejb.InitialContextFactory
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41f6d8c6.7019.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 25 Jan 2005 15:39:50 -0800
X-Trace: forums-1-dub 1106696390 10.22.241.41 (25 Jan 2005 15:39:50 -0800)
X-Original-Trace: 25 Jan 2005 15:39:50 -0800, 10.22.241.41
Lines: 36
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:435
Article PK: 424611

this my powerscript:

io_jvm = create JavaVM
li_rtn = io_jvm.CreateJavaVM("C:\Program
Files\Sybase\Shared\Web Targets\easclient.jar;C:\Program
Files\Sybase\Shared\Web Targets\easj2ee.jar", true)


string properties[]

properties[1]="javax.naming.Context.INITIAL_CONTEXT_FACTORY=com.sybase.ejb.InitialContextFactory
"
properties[2]="javax.naming.Context.PROVIDER_URL=iiop://renato:9000"
properties[3]="javax.naming.Context.SECURITY_PRINCIPAL=jagadmin"
properties[4]="javax.naming.Context.SECURITY_CREDENTIALS="

io_ejbConn = CREATE EJBconnection
try
io_ejbConn.connectToServer(properties) // -----> THIS
METHOD THROWS AN EXCEPTION
catch (NamingException e)
messageBox("exception", e.getmessage())
return -1
end try

return 1

easclient.jar and easj2ee.jar are in the classpath

I cannot find the file vm.out
Tested a java client and it works fine, but I need a
PowerBuilder EJB Client.

Some ideas?


Renato Gonzalez Posted on 2005-01-25 23:43:52.0Z
Sender: 6fe1.41f6d270.1804289383@sybase.com
From: Renato Gonzalez
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: Cannot Instantiate class: com.sybase.ejb.InitialContextFactory
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41f6d9b8.701f.1681692777@sybase.com>
References: <41f6d8c6.7019.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 25 Jan 2005 15:43:52 -0800
X-Trace: forums-1-dub 1106696632 10.22.241.41 (25 Jan 2005 15:43:52 -0800)
X-Original-Trace: 25 Jan 2005 15:43:52 -0800, 10.22.241.41
Lines: 50
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:436
Article PK: 424610

Uuuuups! Uuuups! I am sorry!
I found the problem:

// Code
properties[1]= &
"javax.naming.Context.INITIAL_CONTEXT_FACTORY=com.sybase.ejb.InitialContextFactory
"
There was an extra space after
com.sybase.ejb.InitialContextFactory
and PowerBuilder does not found this class.

The

> this my powerscript:
>
> io_jvm = create JavaVM
> li_rtn = io_jvm.CreateJavaVM("C:\Program
> Files\Sybase\Shared\Web Targets\easclient.jar;C:\Program
> Files\Sybase\Shared\Web Targets\easj2ee.jar", true)
>
>
> string properties[]
>
> properties[1]="javax.naming.Context.INITIAL_CONTEXT_FACTOR
> Y=com.sybase.ejb.InitialContextFactory "
> properties[2]="javax.naming.Context.PROVIDER_URL=iiop://re
> nato:9000"
> properties[3]="javax.naming.Context.SECURITY_PRINCIPAL=jag
> admin"
> properties[4]="javax.naming.Context.SECURITY_CREDENTIALS="
>
> io_ejbConn = CREATE EJBconnection
> try
> io_ejbConn.connectToServer(properties) // -----> THIS
> METHOD THROWS AN EXCEPTION
> catch (NamingException e)
> messageBox("exception", e.getmessage())
> return -1
> end try
>
> return 1
>
> easclient.jar and easj2ee.jar are in the classpath
>
> I cannot find the file vm.out
> Tested a java client and it works fine, but I need a
> PowerBuilder EJB Client.
>
> Some ideas?