• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Fetch Specifications defined in the .eomodel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fetch Specifications defined in the .eomodel


  • Subject: Re: Fetch Specifications defined in the .eomodel
  • From: David Avendasora <email@hidden>
  • Date: Fri, 15 Feb 2008 12:02:26 -0500

Nuts, that's what I had figured out, but I'm still having problems. But I'm not sure what's causing it. I'd hoped that I missed something on the clientSideRequest portion of the process.

The call to the server is failing

Exception in thread "AWT-EventQueue-0" com.webobjects.foundation.NSForwardException for java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at java.io.ByteArrayOutputStream.writeTo(ByteArrayOutputStream.java:112)
at com.webobjects.eodistribution.client.EOHTTPChannel._responseToMessage(EOHTTPChannel.java:519)
at com.webobjects.eodistribution.client.EOHTTPChannel.responseToMessage(EOHTTPChannel.java:603)
at com.webobjects.eodistribution.client.EODistributedObjectStore.invokeStatelessRemoteMethodWithKeyPath(EODistributedObjectStore.java:1099)
at com.bestmaid.bakeryManagement.client.utility.RemoteMethodInvoker.invokeStatelessRemoteMethodWithKeyPath(RemoteMethodInvoker.java:83)
at com.bestmaid.bakeryManagement.client.utility.RemoteMethodInvoker.invokeStatelessOnSession(RemoteMethodInvoker.java:99)
at com.bestmaid.bakeryManagement.client.utility.BMRMI.getFetchSpecification(BMRMI.java:49)
at com.bestmaid.bakeryManagement.client.nutrition._NutritionElementType.fetchUSDACalories(_NutritionElementType.java:68)

_NutritionElementType.java

67 public static NSArray fetchUSDACalories( EOEditingContext ec ) {
68 EOFetchSpecification fs = BMRMI.getFetchSpecification("USDACalories","NutritionElementType");
69 return ec.objectsWithFetchSpecification(fs);
70 }

71


BMRMI.java

public static EOFetchSpecification getFetchSpecification(
String spec, 
String entity) {

// invoke!
return (EOFetchSpecification) invokeStatelessOnSession(
"clientSideRequestGetFetchSpecification", 
new Class[] { String.class, String.class }, 
new String[] { spec, entity });
}

RemoteMethodInvoker.java

public static Object invokeStatelessRemoteMethodWithKeyPath(
String keyPath,
String methodName,
Class[] argumentTypes,
Object[] arguments)
{
if(dos == null){
throw new IllegalStateException("Distributed object store is null, can not perform RMI");
}


return dos.invokeStatelessRemoteMethodWithKeyPath(
keyPath,
methodName,
argumentTypes,
arguments);
}


/**
* Invokes {@link #invokeStatelessRemoteMethodWithKeyPath(String, String, Class[], Object[])}
* with "session" as the key path argument.
*/
public static Object invokeStatelessOnSession(
String methodName,
Class[] argumentTypes,
Object[] arguments){


return invokeStatelessRemoteMethodWithKeyPath(
"session",
methodName,
argumentTypes,
arguments);
}

Session.java

public EOFetchSpecification clientSideRequestGetFetchSpecification(String spec, String entity) {
return getFetchSpecification(spec, entity);
}


/**
* Loads and returns an <tt>EOFetchSpecification</tt> objects for the given
* specification and entity name.
*
@param spec Name of the specification
@param entity Name of the entity
@return A fetch specification, or <tt>null</tt> if it is not found, or an
error occurs
*/
public EOFetchSpecification getFetchSpecification(String spec, String entity){
try{
return EOFetchSpecification.fetchSpecificationNamed(spec, entity);
}catch(Exception ex){
NSLog.out.appendln(ex);
return null;
}
}




I put the BMRMI.setDistributedObjectStore((EODistributedObjectStore)EOEditingContext.defaultParentObjectStore()); call in my BMGenericRecord that all my client-side classes extend.

It seems like it's making the trip to the server, and making it as far as executing getFetchSpecification, but then fails and prints the exception above.

Any ideas?

Dave

On Feb 15, 2008, at 10:18 AM, Florijan Stamenkovic wrote:

Ah, sorry Dave, just saw that I copied the same method twice... :)

Here's the server side:

public EOFetchSpecification clientSideRequestGetFetchSpecification(String spec, String entity){
try{
return EOFetchSpecification.fetchSpecificationNamed(spec, entity);
}catch(Exception ex){
return null;
}
}


On Feb 15, 2008, at 07:44, David Avendasora wrote:

Hi Flor,

What does the clientSideRequestGetFetchSpecification method that goes along with this in the Session class look like?

Thanks,

Dave


On Jan 14, 2008, at 3:04 PM, Florijan Stamenkovic wrote:

Server code, in the Session class:

/**
* Loads and returns an <tt>EOFetchSpecification</tt> objects for the given
* specification and entity name.
*
@param spec Name of the specification
@param entity Name of the entitiy
@return A fetch specification, or <tt>null</tt> if it is not found, or an
error occurs
*/
public EOFetchSpecification getFetchSpecification(String spec, String entity){
try{
return EOFetchSpecification.fetchSpecificationNamed(spec, entity);
}catch(Exception ex){
return null;
}
}





 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Fetch Specifications defined in the .eomodel
      • From: Florijan Stamenkovic <email@hidden>
References: 
 >Re: Fetch Specifications defined in the .eomodel (From: David Avendasora <email@hidden>)
 >Re: Fetch Specifications defined in the .eomodel (From: Florijan Stamenkovic <email@hidden>)

  • Prev by Date: Re: WOImage inline binding: src-attribute not recognized
  • Next by Date: Re: Fetch Specifications defined in the .eomodel
  • Previous by thread: Re: Fetch Specifications defined in the .eomodel
  • Next by thread: Re: Fetch Specifications defined in the .eomodel
  • Index(es):
    • Date
    • Thread