Hi All,

Data was returned!  I rewrote my servlet, creating my COM server and 
associated COM objects all in the doGet method and data was returned.
I had attempted this before, but must have introduced an error at some
point as it now works.  Although I can get data the idea of 
creating a server object, establishing a server connection and then 
doing a read for every GET is not a workable solution.

This works:
 doGet{
   create new COM server object
   connect COM server
   data = COM server read
 }

This doesn't work but is what I would like to do:
 COMServer comServer //I have also tried: static ComServer comServer

 init(){
   create new COM server object
   connect COM server
 }
 doGet{
   data = COM server read
 }
Wrapping the ComServer creation and calls in a singleton class didn't 
work either.

Regards,
Peter

------------------------------------------------------------------------
Hi Bob,

I have tried running Apache from the console, as a service logging on 
as a System Account, as a service logging on a System Accout allowing 
service to interact with the desktop, as an admin account, as a user 
account all with the same results.  The fact that I am able to initially
start the COM server from the Servlet I think is an indication that 
this is likely not the issue I am dealing with.

Thanks,
Peter
-----------------------------------------------------------------------
Bob Love wrote:

This is a wild guess since I don't know COM.  But does COM depend on a
certain user being logged in?  If you are starting JServ automatically 
with Apache and if Apache is running as an NT service then it is starting 
under the system account which might not be a valid account for your COM 
service.
-----------------------------------------------------------------------

> Peter Dunn wrote:
> Hi,
>
> I made server static and got the same result.  I have also tried creating
> the server and server connection in the doGet method with the same result.
>
> regards,
> Peter

-----------------------------------------------------------------------
> >Peter Dunn wrote:
> >
> >Global,non-static. I will make it static and get back to you.
> >
> >public class PointOpcServlet extends HttpServlet
>

> >  IOPCAutoServer server = null;
> >  ...
> >
> >  public void init(ServletConfig config)throws servletException{  
> >    server = new OPCServer();    
> >    server.Connect("MyServer",new Variant(""));
> >  ...
------------------------------------------------------------------------

> >>Greg Barish wrote:
> >>Hi -
> >>
> >>Is the data structure used to store the connection ID locally 
> >>or globally scoped and is it static?
------------------------------------------------------------------------

> >>> Peter Dunn wrote:
> >>> 
> >>> NT SP4
> >>> Apache 1.1.6
> >>> JServ 1.0b5
> >>> MS vm 5.00.3181
> >>> 
> >>> Hi all,
> >>> 
> >>> The init method of my servlet requests a Connection to a COM server.
> >>> The COM server starts up as expected.  So far so good.  However when 
> >>> I attempt to read data from the server in the doGet method of my 
> >>> servlet, the read returns null.  If I run the same code as an 
> >>> application the read returns valid data.  It is critical that I get
> >>> this servlet working with this COM server.  Any guesses as to the 
> >>> cause of this behavior would be appreciated.
> >>> 
> >>> thanks,
> >>> Peter
> >>> 
> >>> PS:  I have included the my servlet in the wrapper.classpath to get
> >>> around a security issue.
> >>> PPS: I have tried sleeps and loops with the same result.


-- --------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
READ THE FAQ!!!!     <http://java.apache.org/faq/>
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]


-- --------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
READ THE FAQ!!!!     <http://java.apache.org/faq/>
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to