EJB Home Factory question

I have a doubt about implementing EJB Home Factory design pattern ( a form of Service Locator pattern)
in an application running on Weblogic clustered environment. A colleague of mine told me that because this pattern is singleton based( which is true - no doubt about that), it will not be supported by the container
beacause server instances are being run on different JVMs. I think what he says is wrong but want to be sure. Please tell me if it is OK to implement this pattern in this type of environment and if yes/no, why.
Thanks
Vlad

Yes, you can implement it, but your colleague is correct: it won't work quite the way you think it will.
A "Singleton" in the WLS server (we'll get to clusters in a minute) is only unique inside it's ClassLoader (not JVM). The way WLS works is that it allocates/creates ClassLoaders for each major type of deployment: EAR, EJB, and WAR. Fortunately, they are "nested" (in the order given), so if you have a SIngleton in the EAR ClassLoader, it will be the only instance of that class for the EJBs and WARs in that EAR. SImilarly, if you've deployed only a WAR, the Singleton will only be unique for that WAR, not the entire server.
With clusters, WLS is not "aware" of the Singleton as it is not a distributed object. So the instance(s) will not propagate between the nodes. So if you've deployed an EAR with a Singleton, the number of Singletons in the system will be n, where n is the number of nodes. If you have the same Singleton class in two different EARs, then it's obvious that there will be 2*n instances of the Singleton.
Now, given the pitfalls and caveats, yes, it is an effective pattern to reduce the number of JNDI lookups and caching of the HomeHandle implementations for EJBs.

Similar Messages

  • EJB Home Objects and Stubs

    Hi,
    Can anyone pls tell me,what are the objects are created in Server after the Deployment of EJB.
    Is the EJB Home Object,EJB Home Object Stub,EJB Home Object Skeleton, EJB Local Home Object, EJB LocalHome Object Stub,Ejb LocalHome Object Skeleton.And Finally both the Stub objects and Skeleton Objects will be stored in the Jndi Registry ?
    Thanks in Advance,
    Venkat

    Nic,
    Caching the home object is a comon practice.
    Take a look here:
    http://www.theserverside.com/resources/patterns_review.jsp
    Look at the EJB Home Factory Pattern.
    Regards,
    -Dat

  • Can l make an instance of EJB home handler / Datasource shared by EJB objs

    all ejb guru
    As far as l know, it is general rule of thumb to cache the EJB home handlers and datasource object at EJB bean instance. But can l go a step further, make the same instance of EJB home handlers and datasource object shared by more than 1 EJB bean instance ?
    ( l checked out the methods of javax.ejb.EJBhome and javax.sql.DataSource. They are not declared as synchronized. It seems to me that EJB home handlers and datasource object are not thread safe and not suitable for being shared. Even they are thread-safe, if they are shared by 1+ EJB bean instance. Sharing EJB home handlers and datasource object may interfere the thread management of EJB container. Am l correct ? )
    It is highly appreciated someone can share with me your insight in this issue.
    thanks & regards
    Danny

    Okay, you got me there. However, it's usually a better practice to start a new thread with your specific question instead of resurrecting old threads that (obviously) nobody cared enough to answer.
    DataSources are retrieved from the container via JNDI. You may (generally) cache them in order to alleviate the JNDI lookup without worrying about Threads, as there is only (usually) one DataSource object per server (or node in a cluster). Do not cache (in your code) the Connection objects obtained from the DataSource - always close them in order to return them to the pool maintained by the DataSource.
    Caching EJB HomeHandles is the accepted manner of avoiding repeated JNDI calls to locate EJBs. Typically, extracting the EJBHome from the HomeHandle re-initializes whatever network operations are embedded in the EJBHome object(s) by the vendor's implementation. Once again, you do not necessarily need to worry about Threads - the container and vendor implementation is already taking care of that for you, transparently.
    Think about it: if there were Threading issues, even retrieving the above objects via JNDI would ensure that J2EE application servers wouldn't be Thread safe and all operations would be, essentially, blocked each time. Obviously, this is not the case since both DataSources and EJBHome objects can have multiple clients using them simultaneously. Just because there's not explicit synchronized tag on any of the methods defined in these interfaces doesn't mean they're single-Thread objects.

  • EJB home stubs in a cluster

    The following URL describes how replica-aware EJB home stubs work. Basically,
    when you do a lookup for the EJB home in JNDI, you get a home stub on any of the
    nodes in the cluster.
    However, I want to invoke EJBs on a particular node in the cluster. Can I do
    this by simply disabling the replica-aware EJB home in the deployment descriptor
    and doing a remote JNDI lookup on the desired node in the cluster? And if so,
    would I have to bind each EJB's home to JNDI with a different name?
    -reza
    http://edocs.bea.com/wls/docs61/cluster/object.html#1006777
    All bean homes can be clustered. When a bean is deployed on a server, its home
    is bound into the cluster-wide naming service.
    Because homes can be clustered, each server can bind an instance of the home under
    the same name. When a client looks up this home, it gets a replica-aware stub
    that has a reference to the home on each server that deployed the bean. When create()
    or find() is called, the replica-aware stub routes the call to one of the replicas.
    The home replica receives the find() results or creates an instance of the bean
    on this server.

    However, I want to invoke EJBs on a particular node in the cluster. Can Ido
    this by simply disabling the replica-aware EJB home in the deploymentdescriptor
    and doing a remote JNDI lookup on the desired node in the cluster? Andif so,
    would I have to bind each EJB's home to JNDI with a different name?Yes. Something like that. We do that with JMS queues sometimes (to send a
    message to a particular machine in the cluster).
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Clustering Weblogic? You're either using Coherence, or you should be!
    Download a Tangosol Coherence eval today at http://www.tangosol.com/
    "Behforooz" <[email protected]> wrote in message
    news:3c8fc8bf$[email protected]..
    >

  • ClassNotFound while narrowing JNDI ref to ejb home interface

    Hello everybody
    I'm quite new to BEA WebLogic. I deployed Jasmine application on Bea WLS7 (example
    app from Mastering EJB 2). But when i tried to use login servlet, it threw an
    exception ClassNotFound when narrowing ejb home interface (obtained via JNDI).
    EJBs are in .jar file, and web files are in the .war file, maybe this is the problem.
    Should I copy ejb classes to .war file, or make some tricks with CLASSPATH, or
    maybe there is better way to make it work (maybe via J2EE references or something
    like this).
    Thanks in advance

    Strange. And you do not have any application classes in the system
    classpath?
    Konrad R. <[email protected]> wrote:
    "Dimitri I. Rakitine" <[email protected]> wrote:
    Did you deploy ejbs and war in the same ear?
    Yes, both were packed up into one .ear archive>>
    Konrad R. <[email protected]> wrote:
    Hello everybody
    I'm quite new to BEA WebLogic. I deployed Jasmine application on BeaWLS7 (example
    app from Mastering EJB 2). But when i tried to use login servlet, itthrew an
    exception ClassNotFound when narrowing ejb home interface (obtainedvia JNDI).
    EJBs are in .jar file, and web files are in the .war file, maybe thisis the problem.
    Should I copy ejb classes to .war file, or make some tricks with CLASSPATH,or
    maybe there is better way to make it work (maybe via J2EE referencesor something
    like this).
    Thanks in advance--
    Dimitri

  • Unable to bind EJB Home Interface to the JNDI name

    Why do I get this error?? What is the jndi-name in weblogic-ejb-jar.xml
    Unable to deploy EJB: OrganizationEJB from sempire_bc.jar:
    Unable to bind EJB Home Interface to the JNDI name:
    com.sempire.builder.business
    _component.Organization. The error was:
    javax.naming.NameAlreadyBoundException: Organization is already bound;
    remaining
    name 'com.sempire.builder.business_component'
    <<no stack trace available>>

    Slava,
    In case I change the name of the jndi name to a unique name. I still get the same
    problem. I checked for multiple occurences, but there aren't any.
    My web.xml file is:
    <ejb-local-ref>
    <description>
    Reference EJB resources in Weblogic Resources
    </description>
    <ejb-ref-name>GangsterEJB</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>com.sempire.builder.business_component.GangsterHome</local-home>
    <local>com.sempire.builder.business_component.Gangster</local>
    </ejb-local-ref>
    My weblogic-ejb-jar.xml file is:
    <weblogic-enterprise-bean>
    <ejb-name>GangsterEJB</ejb-name>
    <entity-descriptor>
    <persistence>
    <persistence-type>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-type>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    </persistence-use>
    </persistence>
    </entity-descriptor>
    <reference-descriptor>
    <resource-description>
    <res-ref-name>jdbc/GangsterDB</res-ref-name>
    <jndi-name>oraclePool</jndi-name>
    </resource-description>
    </reference-descriptor>
    <local-jndi-name>Gangster_test</local-jndi-name>
    </weblogic-enterprise-bean>
    I do not get the problem.
    Thank you
    Ronak Parekh
    "Slava Imeshev" <[email protected]> wrote:
    Hi Ronak,
    This exception means that you already have a bean
    with the same JNDI name. Search your weblogic-ejb-jar.xml files
    for multiple occurrences of the name and fix the problem.
    Regards,
    Slava Imeshev
    "Ronak Parekh" <[email protected]> wrote in message
    news:[email protected]...
    Why do I get this error?? What is the jndi-name in weblogic-ejb-jar.xml
    Unable to deploy EJB: OrganizationEJB from sempire_bc.jar:
    Unable to bind EJB Home Interface to the JNDI name:
    com.sempire.builder.business
    _component.Organization. The error was:
    javax.naming.NameAlreadyBoundException: Organization is already bound;
    remaining
    name 'com.sempire.builder.business_component'
    <<no stack trace available>>

  • Undable to bind EJB Home during deploy

    Hi
    I'm getting an exception when I redeploy to weblogic81. I have and ear with several ejb jars in it. The following is the message I get...
    Unable to bind EJB Home Interface to the JNDI name: EJBTestService. javax.naming.NameAlreadyBoundException: EJBTestService is already bound; remaining name :at weblogic.jndi.internal.BasicNamingNode.bindHere(BasicNamingNode.java:333) at weblogic.jndi.internal.ServerNamingNode.bindHere(ServerNamingNode.java:124) at weblogic.jndi.internal.BasicNamingNode.bind(BasicNamingNode.java:291) at weblogic.jndi.internal.WLEventContextImpl.bind(WLEventContextImpl.java:279) at weblogic.jndi.internal.WLContextImpl.bind(WLContextImpl.java:384) at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.activate(ClientDrivenBeanInfoImpl.java:1116) at weblogic.ejb20.deployer.EJBDeployer.activate(EJBDeployer.java:1362) at weblogic.ejb20.deployer.EJBModule.activate(EJBModule.java:631)
    This error doesn't always occur with the same jar in the ear. Sometimes the above jar prepares and activates fine and another one fails.
    If anyone has any idea I'd appreciate feedback.

    Hello,
    The error suggests that an object is already bound to the JNDI name.
    This can happen if you have 2 or more ejbs in your EAR file wit the same JNDI name or if your application has not fully/cleanly undeployed before you try to redeploy it.
    I suspect the latter is your problem. Once you have undeployed your application use the weblogic console to view your JNDI tree and make sure nothing is bound that should not be bound. Then redeploy your app. If you still have the problem check your ear does not have duplicate ejbs or ejbs using the same JNDI name.

  • My ipad2 is connected with wifi at my home my question is use internet through ipad2with my desktop  through iapd2usb

    Can i use my ipad2 as inertnet device for connect my desktopMy ipad2 is connected with wifi at my home my question is use internet through ipad2with my desktop  through iapd2usb

    No, the iPad cannot share it's connection with other devices. Have you read the replies in your duplicate thread : https://discussions.apple.com/thread/3483987?tstart=0 ?

  • Home Sharing Question # 1001

    I know there are a lot of Home Sharing questions but haven't found the answer to this.
    My wife and I have been able to share movies and music but not apps. She is on a PC and I am on a Mac.Not sure if that would make a difference.

    No answers to this?

  • EJB object factory

     

    Declare the factory class as a startup class. In the main() method, create a new initial context and bind a new instance of the factory class into the jndi tree under an agreed on name. Youi client code should look for the factory calss under the agreed on name.
    Hope that helps.
    Narendra Pasuparthy wrote:
    Hi Eduardo,
    Thanks for looking into my problem, I have been trying to do this thing for
    the last 2 weeks and you help comes as a new sign of life to me.
    Anyway i understand the problem better now, but i am still far away from
    having to solve it. you say something about adding the object factory to the
    JNDI tree
    What you can do is add your object factory to the jndi tree. Your >bean
    could look it up, etc.How can i do this, i presume that when you say jndi tree you ae referring to
    the JNDI tree provided by the weblogic server; right?
    If you can shed more light on how i can add my object factory to the JNDI
    tree and how i can look it up i would appreciate your help.
    Looking forward to hearing form you soon.
    Bye,
    Naren
    From: [email protected] (Eduardo Ceballos)
    To: narendra <[email protected]>
    Subject: Re: EJB object factory
    Date: Mon, 21 Aug 2000 08:42:34 -0700
    MIME-Version: 1.0
    Received: from [63.96.160.4] by hotmail.com (3.2) with ESMTP id
    MHotMailBB6A99B0002AD820F39D3F60A0049AF50; Mon Aug 21 08:45:56 2000
    Received: from san-francisco.beasys.com (san-francisco.beasys.com
    [192.168.9.10])by beamail.beasys.com (8.9.1b+Sun/8.9.1) with ESMTP id
    IAA08176for <[email protected]>; Mon, 21 Aug 2000 08:45:54 -0700 (PDT)
    Received: from ashbury.weblogic.com (ashbury.beasys.com [172.17.8.3])by
    san-francisco.beasys.com (8.9.1b+Sun/8.9.1) with ESMTP id IAA13707for
    <[email protected]>; Mon, 21 Aug 2000 08:46:05 -0700 (PDT)
    Received: from weblogic.com ([192.168.11.197]) by ashbury.weblogic.com
    (Post.Office MTA v3.5.3 release 223 ID# 0-53833U200L200S0V35)
    with ESMTP id com for <[email protected]>; Mon, 21 Aug 2000
    09:03:01 -0700
    From [email protected] Mon Aug 21 08:47:42 2000
    Message-ID: <[email protected]>
    X-Mailer: Mozilla 4.73 [en] (WinNT; I)
    X-Accept-Language: en
    Newsgroups: weblogic.developer.interest.rmi-iiop
    References: <[email protected]>
    There is no provision for a generic object factory in the public api, and
    none is supported.
    What you can do is add your object factory to the jndi tree. Your bean
    could look it up, etc. I would urge you to
    make sure that there are appropriate acls on the factory, for obvious
    security reasons.
    narendra wrote:
    My problem is that i want to invoke a service running on another APPserver form an EJB bean,
    the other app server provides some client APIwhich i can use and invokethe service. Due to the
    security restriction in EJB container i was not able to do this, theapproach i am thinking
    about is establishing an object factory to create an object of theother app server client
    class and use that from the bean.
    the weblogic server seems to handle,"javax.sql.DataSource,""javax.jms.QueueConnectionFactory,"
    "javax.jms.TopicConnectionFactory" or "java.net.URL" how can it supportgeneric object factories, since I
    have a obect factory that does not construct any of the objects usingthe weblogic supported object
    factory.
    Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

  • How to use JNDI to lookup remote EJB Home?

    Hello,
    I am writing a servlet to call a remote EJB on another machine.
    I use JNDI to lookup remote EJBHome (not) but fail.
    Any advice?
    Any trick to configure application-client.xml?
    Thanks!

    Use com.evermind.server.rmi.RMIInitialContextFactory instead
    Here an example
    // EmployeeClient.java
    package mypackage5;
    import javax.ejb.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    import java.io.*;
    import java.util.*;
    import java.rmi.RemoteException;
    import com.evermind.server.ApplicationClientInitialContextFactory;
    import com.evermind.server.rmi.RMIInitialContextFactory;
    * A simple client for accessing an EJB.
    public class EmployeeClient
    public static void main(String[] args)
    System.out.println("EmployeeClient.main(): client started...");
    try
    * initialize JNDI context by setting factory, url and credential
    * in a hashtable
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    //env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
    env.put(Context.PROVIDER_URL, "ormi://koushikm:23791/application4");
    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "admin");
    * or set these properties in jndi.properties
    * or use container defaults if that's where client got launched from
    Context context = new InitialContext(env);
    * Lookup the EmployeeHome object. The reference is retrieved from the
    * application-local context (java:comp/env). The variable is
    * specified in the assembly descriptor (META-INF/application-client.xml).
    Object homeObject =
    context.lookup("HelloEJB");
    System.out.println("EmployeeClient.main(): bean found...");
    // Narrow the reference to EmployeeHome.
    HelloEJBHome home =
         (HelloEJBHome) PortableRemoteObject.narrow(homeObject,
    HelloEJBHome.class);
    System.out.println("EmployeeClient.main(): home narrowed...");
    // Create remote object and narrow the reference to Employee.
    HelloEJB remote =
         (HelloEJB) PortableRemoteObject.narrow(home.create(), HelloEJB.class);
    System.out.println("EmployeeClient.main(): remote created...");
    String message=remote.helloWorld("SUCCESS");
    System.out.println(message);
    } catch(NumberFormatException e) {
    System.err.println("NumberFormatException: " + e.getMessage());
    } catch(RemoteException e) {
    System.err.println("RemoteException: " + e.getMessage());
    } catch(IOException e) {
    System.err.println("IOException: " + e.getMessage());
    } catch(NamingException e) {
    System.err.println("NamingException: " + e.getMessage());
    } catch(CreateException e) {
    System.err.println("CreateException: " + e.getMessage());
    Hello,
    I am writing a servlet to call a remote EJB on another machine.
    I use JNDI to lookup remote EJBHome (not) but fail.
    Any advice?
    Any trick to configure application-client.xml?
    Thanks!

  • Home Sharing Questions

    Hello,
    I have two questions regarding home sharing while I am on vacation. I understand that if I am not on the same network, I will not have access to my files on my iMac or my PC, however, I do have two questions:
    1. If my iMac and my iPad are signed into the same VPN, will home sharing work if I am on vacation? Both my iMac and my iPad will be signed on to the same server.
    2. I have Xfinity as my Internet provider, and they provide hotspots all over the country that are free for me to use. Since my iMac/PC are on thee Xfinity newtwork, if I sign into the Xfinity hotspot while, say in Maine and my equipment is in Florida, will home sharing work?
    My fear is that I must be logged into the same network ID, and they will not be available to me. However, I do have two Network ID's (one is a 2.4Ghz and the other is a 5GHz and they have different names, and Home Sharing does work if my AppleTV is on one and the iMac/PC/iPad is on the other.
    The same questions I guess will apply to my AppleTV device, however, if I can get access to my Home Sharing on my iPad, which along with my AppleTV device, I will be bringling with me, I can always change the airplay to play on the AppleTV from my iPad.
    Even though I have a WIFI Seagate drive that I use as both a backup and storage for my photos (I am a professional photojournalist) I have all my iTunes files backed up on that device (good thing because if an artist pulls their work from iTunes and you store it Apple's Cloud, it will be deleted) and had I not had a backup, all the Celtic Woman concert videos (close to $60 worth) would be gone
    Anyway. thanks for taking your time to read this and considered answering.
    George McGinn
    Venice, FL
    PS. These questions are important for me as I plan to spend 3 months every year traveling throughout the country doing street photography and travel photography as I also shoot stock for Getty Images, so if my movies and music are especially my Home Movies (I have instructional videos and PDF files in iBooks that I may need access to) are not going to be available, I would hate to drag my desktop with me. I will take my WIFI drive and use its player to play my music, as while I can change the directories on my iMac to point to the external drive, I do not know of a way to do this on my iPad.
    If I get a travel trailer to use instead of staying in hotels, I may just bring my iMac with me. But I really would like to leave it save in my house.

    The answer to both questions is no.
    It only automatically syncs new purchases from the iTunes Store between devices, and even then only tracks purchased after the option has been turned on. It won't do a catch up sync to start with.
    Non iTunes Store purchased tracks have to be imported manually.
    You can view all the tracks that are in the source library but not in the target library.
    Then select them all and hit the import button.
    All that will do though is transfer the music, it will not move playlists, etc.

  • Home plug question

    Hello Guys
    I'm not very experienced with home plugs and have a pair set up and running that came with my vision box.
    My question is if i want to connect my PS3 via home plug/s do i need another pair or just the 1 plug?
    Best BT india advice i have seen yet on these forums:
    Q: Someone has hacked my wireless network
    A: Try plugging router into your test socket.

    iPHAILZ wrote:
    Great stuff, thanks for that.
    Just one final question, will i need to match it to the exisiting model i have or will any one do?
    As stated you just need 1 more plug.
    For ease of use/setup you would be better off getting a homeplug to match the ones you have.
    toekneem
    http://www.no2nuisancecalls.net
    (EASBF)

  • Home Page Question

    Hi Guys,
    Appreciate your help on what I assume is an easy solution and probably is a stupid question. There are items on the home page that I would like to delete or move from the 2nd page to the 1st (or vice versa). Can't figure out how to do that. Any advice is appreciated.

    By holding any icon for a short while, all icons will appear to wobble, then they can be dragged about to be ordered in any way you wish. By dragging an icon to the edge of the screen the iPhone will allow the icon to be placed into the next home screen.

  • Simple Home Sharing Question

    I'm sure this is a basic question but I can't seem to find the answer.  Please any help us MUCH appreciated!  Here's the deal... I'm a long time iTunes and iPhone user and have a large music & apps library.  My wife has her own computer and recently got an iPhone... so I set her up using my Apple ID so we could home share.  This worked okay but with the release of iOS5 and iCloud... I'm confused.
    My question is... how does iCloud play into this now?  We now have multiple comptuers and iPhones using the same Apple ID... so how does Find My Friend & Find my iPhone work?  How does syncing with iCloud work?  Will it seperate our contacts?
    Last question... how would YOU set this up?  I don't want my wife have to repurchase the same music and apps... but she has her own laptop and iPhone.
    Thank you!

    I assume that if you are actually using the laptop to stream photos or music to the ATV, then it won't hibernate?
    The details of that issue depends on whether or not you've got "wake on network access" enabled. Here's a cut and paste of the info from the relevant troubleshooting document:
    8. Cannot access my library when my computer is asleep
    In order for Apple TV to access your library while the host computer is asleep, "Wake for network access" must be turned on.
    Open System Preferences > Energy Saver and check (enable) the "Wake for network access" option.
    In addition, the network that the host computer and the Apple TV (2nd or 3rd generation) is connected to must support Wake on Demand feature. This works by partnering with a service running on your AirPort Base Station or Time Capsule called Bonjour Sleep Proxy.

Maybe you are looking for

  • Download to Excel with Column Headings.

    Hi All, I have a very small issue.I want to download the Data from an internal table to an Excel Sheet Along with the Column heading of the corresponding Field... I tried with ws_excel and gui_download... not reached to any conclusion,,,I cant go for

  • Down Payment Request generation

    Hello Gurus How to configure Purchase Order to generate Down Payment Request if supplier requires Prepayment? Any help is greatly appreciated! Best regards, Oybek

  • HELP!!!  NumberFormatException!!!

    Can you find anything wrong this code that causes a NumberFormatException? I'm a beginner, so I haven't got to exception handling yet. I'm working from Deitel and Deitel's book "Java 2: How to Program". I don't care what number I put in (with or with

  • Address Book Won't Exit If...

    I opened up Address Book and found two cards for my account. In the process of consolidating them, I opened up one in a separate window to edit the picture. Then back in the main window, I deleted that card. The window for that card remained open. Th

  • Not enough free space?

    My iTunes library says I have 1.53GB of songs, but my iPod mini is showing the same number of songs (and the exact same titles) but is taking up 3.77GB of memory. How can that be? iTunes won't sync any more because it says there isn't enough free spa