Can't update pacman.

I have a strange problem. I haven't updated Arch since sometimes in January, and today when I tried to it asked me to update pacman first. I said yes, and got this:
sudo pacman -Syu
Password:
:: Synchronizing package databases...
core is up to date
extra is up to date
community is up to date
multilib is up to date
repo-ck is up to date
:: The following packages should be upgraded first :
pacman
:: Do you want to cancel the current operation
:: and upgrade these packages now? [Y/n] y
resolving dependencies...
looking for inter-conflicts...
error: failed to prepare transaction (could not satisfy dependencies)
:: pyalpm: requires pacman<3.6
What do I do now?
EDIT:
pacman -Qi pacman
Name : pacman
Version : 3.5.4-4
URL : http://www.archlinux.org/pacman/
Licenses : GPL
Groups : base
Provides : None
Depends On : bash glibc>=2.14 libarchive>=2.8.4 libfetch>=2.28
pacman-mirrorlist
Optional Deps : fakeroot: for makepkg usage as normal user
curl: for rankmirrors usage
Required By : cower-git pyalpm
Conflicts With : None
Replaces : None
Installed Size : 2956.00 K
Packager : Allan McRae <[email protected]>
Architecture : x86_64
Build Date : Sun 14 Aug 2011 01:37:32 SAST
Install Date : Mon 05 Sep 2011 23:08:03 SAST
Install Reason : Explicitly installed
Install Script : Yes
Description : A library-based package manager with dependency support
Last edited by biltong (2012-02-09 15:06:03)

jgreen1tc wrote:
meph wrote:
pacman -S pacman pyalpm
should work
Shouldn't he remove pyalpm, update pacman, then reinstall pyalpm?
It's a known bug, manually and explicitly updating pyalpm solves the problem. Doesn't mean your solution wouldn't work

Similar Messages

  • I can't update packages after upgrading pacman to 4.0.3

    I know this was already treated broadly about two months ago, but I can't update after upgrading pacman because of continuous problems with certain signatures (at least one).
    I have already tried this:
    rm -rf /etc/pacman.d/gnupg
    pacman -Scc
    pacman-key --init
    pacman-key --populate archlinux
    But I still get this error when trying to upgrade the system:
    error: virtuoso: signature from "Andrea Scarpino (Arch Linux) <[email protected]>" is invalid
    error: failed to commit transaction (invalid or corrupted package)
    Errors occurred, no packages were upgraded.
    Could anybody help me? I'm pretty devastated with this.
    Thanks!
    My /etc/pacman.conf
    # /etc/pacman.conf
    # See the pacman.conf(5) manpage for option and repository directives
    # GENERAL OPTIONS
    [options]
    # The following paths are commented out with their default values listed.
    # If you wish to use different paths, uncomment and update the paths.
    #RootDir = /
    #DBPath = /var/lib/pacman/
    #CacheDir = /var/cache/pacman/pkg/
    #LogFile = /var/log/pacman.log
    #GPGDir = /etc/pacman.d/gnupg/
    HoldPkg = pacman glibc
    # If upgrades are available for these packages they will be asked for first
    SyncFirst = pacman
    #XferCommand = /usr/bin/curl -C - -f %u > %o
    #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
    #CleanMethod = KeepInstalled
    Architecture = auto
    # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
    #IgnorePkg =
    #IgnoreGroup =
    #NoUpgrade =
    #NoExtract =
    # Misc options
    #UseSyslog
    #UseDelta
    #TotalDownload
    CheckSpace
    #VerbosePkgLists
    # By default, pacman accepts packages signed by keys that its local keyring
    # trusts (see pacman-key and its man page), as well as unsigned packages.
    #SigLevel = Optional TrustedOnly
    # NOTE: You must run `pacman-key --init` before first using pacman; the local
    # keyring can then be populated with the keys of all official Arch Linux
    # packagers with `pacman-key --populate archlinux`.
    # REPOSITORIES
    # - can be defined here or included from another file
    # - pacman will search repositories in the order defined here
    # - local/custom mirrors can be added here or in separate files
    # - repositories listed first will take precedence when packages
    # have identical names, regardless of version number
    # - URLs will have $repo replaced by the name of the current repo
    # - URLs will have $arch replaced by the name of the architecture
    # Repository entries are of the format:
    # [repo-name]
    # Server = ServerName
    # Include = IncludePath
    # The header [repo-name] is crucial - it must be present and
    # uncommented to enable the repo.
    # The testing repositories are disabled by default. To enable, uncomment the
    # repo name header and Include lines. You can add preferred servers immediately
    # after the header, and they will be used before the default mirrors.
    #[testing]
    #SigLevel = PackageRequired
    #Include = /etc/pacman.d/mirrorlist
    [core]
    SigLevel = PackageRequired
    Include = /etc/pacman.d/mirrorlist
    [extra]
    SigLevel = PackageRequired
    Include = /etc/pacman.d/mirrorlist
    #[community-testing]
    #SigLevel = PackageRequired
    #Include = /etc/pacman.d/mirrorlist
    [community]
    SigLevel = PackageRequired
    Include = /etc/pacman.d/mirrorlist
    # An example of a custom package repository. See the pacman manpage for
    # tips on creating your own repositories.
    #[custom]
    #SigLevel = Optional TrustAll
    #Server = file:///home/custompkgs
    Last edited by [DoodoM] (2012-08-03 23:39:56)

    Thanks everyone! I guess it was a faulty mirror.
    I also had problems upgrading glibc because /lib had to be linked to /usr/lib, but I fixed it seeking for helpful tips on the forum. What I did was move everything from /lib to /usr/lib, shutdown, start adding break=postmount to kernel line, mount the filesystem, remove /lib folder, link /usr/lib to /lib and reboot. Then I reinstalled glibc and everything went well.
    Now some fonts look half-cutted in Gnome Shell when the window or panel which contains them is in background and I don't know why. But it is not the first time I have "graphical artifacts" with Arch Linux on this laptop. I think has something to do with the compositing.

  • Pacman can't update anything

    Hello everyone, I installed Archlinux like one year ago but I didn't used it much.
    Today I decided to switch from Windows to Archlinux. So I  did a pacman -Syu to update everythings. Pacman ask me whether I want to replace a lots of packages :
    :: Replace kernel-headers with core/linux-api-headers? [Y/n]
    :: Replace man with core/man-db? [Y/n]
    :: Replace klibc with core/mkinitcpio? [Y/n]
    :: Replace klibc-extras with core/mkinitcpio? [Y/n]
    :: Replace klibc-kbd with core/mkinitcpio? [Y/n]
    :: Replace klibc-module-init-tools with core/mkinitcpio? [Y/n]
    :: Replace klibc-udev with core/mkinitcpio? [Y/n]
    :: Replace pkgconfig with core/pkg-config? [Y/n]
    :: Replace procinfo with core/procinfo-ng? [Y/n]
    :: Replace portmap with core/rpcbind? [Y/n]
    :: Replace bluez-libs with extra/bluez? [Y/n]
    :: Replace nautilus-cd-burner with extra/brasero? [Y/n]
    :: Replace esd with extra/esound? [Y/n]
    :: Replace libungif with extra/giflib? [Y/n]
    :: Replace gnome-mount with extra/gnome-disk-utility? [Y/n]
    :: Replace gail with extra/gtk2? [Y/n]
    :: Replace jack-audio-connection-kit with extra/jack? [Y/n]
    :: Replace kdeaccessibility with extra/kde-meta-kdeaccessibility? [Y/n]
    :: Replace kdeadmin with extra/kde-meta-kdeadmin? [Y/n]
    :: Replace kdeartwork with extra/kde-meta-kdeartwork? [Y/n]
    :: Replace kdebase with extra/kde-meta-kdebase? [Y/n]
    :: Replace kdeedu with extra/kde-meta-kdeedu? [Y/n]
    :: Replace kdegames with extra/kde-meta-kdegames? [Y/n]
    :: Replace kdegraphics with extra/kde-meta-kdegraphics? [Y/n]
    :: Replace kdemultimedia with extra/kde-meta-kdemultimedia? [Y/n]
    :: Replace kdenetwork with extra/kde-meta-kdenetwork? [Y/n]
    :: Replace kdepim with extra/kde-meta-kdepim? [Y/n]
    :: Replace kdesdk with extra/kde-meta-kdesdk? [Y/n]
    :: Replace kdetoys with extra/kde-meta-kdetoys? [Y/n]
    :: Replace kdeutils with extra/kde-meta-kdeutils? [Y/n]
    :: Replace kdmtheme with extra/kdebase-workspace? [Y/n]
    :: Replace kde-common with extra/kdebase-workspace? [Y/n]
    :: Replace gwenview with extra/kdegraphics-gwenview? [Y/n]
    :: Replace arts with extra/kdelibs? [Y/n]
    :: Replace libdvbpsi4 with extra/libdvbpsi? [Y/n]
    :: Replace libsigc++2.0 with extra/libsigc++? [Y/n]
    :: Replace gnome-volume-manager with extra/nautilus? [Y/n]
    :: Replace perlxml with extra/perl-xml-parser? [Y/n]
    :: Replace python-elementtree with extra/python? [Y/n]
    :: Replace notification-daemon-xfce with extra/xfce4-notifyd? [Y/n]
    :: Replace xfce4-xmms-plugin with extra/xfce4-playercontrol-plugin? [Y/n]
    :: Replace xfce4-screenshooter-plugin with extra/xfce4-screenshooter? [Y/n]
    :: Replace xfce-mcs-manager with extra/xfce4-settings? [Y/n]
    :: Replace verve-plugin with extra/xfce4-verve-plugin? [Y/n]
    :: Replace libxfce4mcs with extra/xfconf? [Y/n]
    :: Replace xfce-mcs-manager with extra/xfconf? [Y/n]
    :: Replace xfce-mcs-plugins with extra/xfconf? [Y/n]
    It also asks if I want to update pacman and whatever my answers I get an error :
    resolving dependencies...
    error: cannot resolve "openssl>=1.0.0", a dependency of "libarchive"
    error: failed to prepare transaction (could not satisfy dependencies)
    So I did pacman -S openssl (it ran fine) but I still get the same error.
    I tried several mirrors, I tried to do pacman -r / -S pacman but I still had the openssl error. I tried to download the latest version of pacman but I need libterm to compile it and when I do pacman -S libterm I also get the same error.
    I don't know what to do. Should I reinstall Archlinux ?
    Last edited by Derechef (2010-07-02 19:42:30)

    Ah well, you should have installed libarchive and libfetch with pacman -S before, and make sure the only unmet dependency was openssl, and only then run -Sd when all other dependencies were installed...
    Thats how I meant it but didn't write it, sorry, bit of bad advise from my side.
    Edit: Really bad considering it left you with a broken pacman... I know you have decided to reinstall already; anyway you should be able to get pacman back by installing the old package from your cache with -U, or if that doesn't work either, untar it to /.
    Edit two: How to reinstall pacman when pacman is broken
    Last edited by hokasch (2010-07-02 20:47:26)

  • Can't update community repo [solved]

    Hello,
    I'm trying to update my system but any time I try to do it I can't update community repo (I can update the others). This is the output for a simple "pacman -Syu":
    :: Synchronizing package databases...
    core is up to date
    extra is up to date
    community 170.0K 190.1K/s 00:00:01 [#####################] 100%
    error: could not extract 6 ((Empty error message))
    error: failed to update community (unexpected system error)
    archlinuxfr is up to date
    :: Starting full system upgrade...
    local database is up to date
    The problem started after my system freezed.
    Any idea? Thank you
    Last edited by serjor (2009-07-05 17:56:43)

    serjor wrote:
    Hello,
    I'm trying to update my system but any time I try to do it I can't update community repo (I can update the others). This is the output for a simple "pacman -Syu":
    :: Synchronizing package databases...
    core is up to date
    extra is up to date
    community 170.0K 190.1K/s 00:00:01 [#####################] 100%
    error: could not extract 6 ((Empty error message))
    error: failed to update community (unexpected system error)
    archlinuxfr is up to date
    :: Starting full system upgrade...
    local database is up to date
    The problem started after my system freezed.
    Any idea? Thank you
    I tried to extract the community db (located at /var/lib/pacman/community.db.tar.gz) and it throws an EOF error, so may be the problem isn't at my computer.

  • [solved] when to update pacman.conf

    I apologise in advance. I'm worried that I've either read the answer to this or asked the question before but, if so, I cannot for the life of me find it.
    What is the best way to check the progress on package signing? and, even, database signing? (I assume the latter is not yet implemented.)
    Currently, I'm using PackageRequired for multilib and core but not community or extra (and not for AUR).
    Is there a sticky, blog or wiki page I can monitor so that I know when to require signing for the remaining packages? And when signatures for the databases themselves are implemented?
    Or will this be announced via a pacman -Syu announcement?
    Last edited by cfr (2012-03-18 03:17:22)

    Thanks. I didn't know about expac... expac + grep "(null)" also works nicely though I admit awk is neater. (I just always find awk kind of alien and have never really got to grips with it.)
    I've updated pacman.conf to "PackageRequired" for extra. Just a few things in Community to go, I guess. I didn't realise the signing was this far along!

  • (SOLVED) can not update ArchLinux for about three weeks

    Hello, I can not update my system for at least 3 weeks, someone could point me to the right direction?    thank you in advance !
    [bier@laptop-arch ~]$ sudo pacman -Syu
    Password:
    :: Synchronizing package databases...
    core 103.8 KiB 58.7K/s 00:02 [######################] 100%
    extra 1383.7 KiB 58.3K/s 00:24 [######################] 100%
    community 1650.0 KiB 58.1K/s 00:28 [######################] 100%
    archlinuxfr 32.9 KiB 27.5K/s 00:01 [######################] 100%
    :: Starting full system upgrade...
    :: Replace gnupg2 with core/gnupg? [Y/n] y
    resolving dependencies...
    warning: dependency cycle detected:
    warning: util-linux will be installed before its udev dependency
    warning: dependency cycle detected:
    warning: rhino will be installed before its jre7-openjdk-headless dependency
    looking for inter-conflicts...
    error: failed to prepare transaction (could not satisfy dependencies)
    :: jogl: requires java-runtime
    Last edited by mabier (2012-03-30 08:15:42)

    jasonwryan wrote:There is a heap of threads about this java thing already - please search the boards before posting...
    yes, I find the solution here :https://bbs.archlinux.org/viewtopic.php?id=137836, thanks.

  • [SLOVED] I can't update my system (conflicting files)..

    I can't update my system, so what i can to do?
    That's error by 'pacman -Syu' command.
    (198/198) checking for file conflicts [######################] 100%
    error: failed to commit transaction (conflicting files)
    /usr/lib/libglapi.so exists in both 'mesa-full' and 'libglapi'
    /usr/lib/libglapi.so.0 exists in both 'mesa-full' and 'libglapi'
    /usr/lib/libglapi.so.0.0.0 exists in both 'mesa-full' and 'libglapi'
    Errors occurred, no packages were upgraded.
    Thanks for you support.
    BTW, I'm using with this release for mesa and ATI drivers: https://bbs.archlinux.org/viewtopic.php?id=79509
    Last edited by KingYes (2011-08-07 07:46:17)

    Then I misread the problem: Pacman apparently wanted to update your packages so that one of the updated packages would have had libglapi as a dependency while you also had mesa-full updated.
    I always thought pacman could be a bit more helpful in these cases with showing why it wants to install the respective package i.e. what depends on them so you can resolve the conflict more easily.
    In case somebody else is reading this: It would have probably worked this way:
    pacman -Rdd mesa-full
    pacman -Su
    pacman -S mesa-full # resolve conflict manually

  • Can't update ndiswrapper

    From a couple of days my system can't update because of ndiswrapper:
    [root@archtoshiba ~]# pacman -Syu
    :: Sincronizzazione dei database in corso...
    core è aggiornato
    extra è aggiornato
    community è aggiornato
    :: Aggiornamento del sistema in corso...
    :: Vuoi sostituire ndiswrapper-utils con community/ndiswrapper? [S/n] s
    risoluzione delle dipendenze in corso...
    ricerca dei conflitti in corso...
    errore: impossibile eseguire l'operazione richiesta (impossibile soddisfare le dipendenze)
    :: ndiswrapper-lts: richiede ndiswrapper-utils=1.56
    ndiswrapper-utils goes in conflict with ndiswrapper and pacman asks me to substitute it. When I answer yes, it shows me an error: ndiswrapper requires ndiswrapper-lts, so I can't go forward...
    Yesterday I removed ndiswrapper-utils and ndiswrapper-lts, then installed the new ndiswrapper, but after reboot the system couldn't load.
    So, I booted with kernel26-lts-fallback and rollback to ndiswrapper-utils and ndiswrapper-lts. The system now works, but I can't update it.
    What should I do?
    Thanks...

    karol wrote:
    "ndiswrapper requires ndiswrapper-lts" - are you sure? http://www.archlinux.org/packages/commu … iswrapper/
    Run
    LC_ALL=C <command>
    to get output in English.
    If you enabled C locale, it should work.
    [root@archtoshiba ~]# LC_ALL=C pacman -Syu
    :: Synchronizing package databases...
    core is up to date
    extra is up to date
    community is up to date
    :: Starting full system upgrade...
    :: Replace ndiswrapper-utils with community/ndiswrapper? [Y/n] y
    resolving dependencies...
    looking for inter-conflicts...
    error: failed to prepare transaction (could not satisfy dependencies)
    :: ndiswrapper-lts: requires ndiswrapper-utils=1.56
    Sorry, lts requires utils...
    karol wrote:Edit: Ahhh, somebody put ndiswrapper back in community. https://aur.archlinux.org/packages.php?ID=49709
    So? What is the point?
    karol wrote:Again, what happens if you remove the AUR packages and install only the package from [community]?
    Ehm, I don't understand.
    I've not installed ndiswrapper-utils and ndiswrapper-lts from AUR (https://aur.archlinux.org/packages.php?ID=49935 & https://aur.archlinux.org/packages.php?ID=49713).
    edit: Neither ndiswrapper (https://aur.archlinux.org/packages.php?ID=49709)...
    Last edited by digitalone (2011-08-19 13:12:26)

  • [SOLVED] Can't update Arch for half an hour now

    Can't update arch reps today from 11 am till now on.
    I do have internet connection, I also can download and update apps via "pacman -S sonata".
    pacman -Sy
    :: Synchronizing package databases...
    error: failed retrieving file 'core.db' from mirrors.kernel.org : Network is unreachable
    Last edited by tasty_minerals (2011-09-06 09:53:51)

    tasty_minerals wrote:where is the list of alternative mirrors?
    Seriously? You can't find that yourself?
    Start by searching the wiki...

  • How can I update my app store account ?

    Hi, I have a new Iphone and I wanted to add some applications from apple store.
    Unfortunately, I had a message saying that I was using app store on a new device (true) and they needed to check some security thing from my visa card. Unfortunately, I had a new  card and do not have the previous one anylonger (the previous one expires in 1 year but had to be cancelled).
    Therefore I am blocked and cannot get into my account.
    How can I update my bank account and get into the apple store again ?
    Thanks
    Nadiege

    Great, it worked. i could update the account from the laptop (but not from the phone).
    Many thanks for such a swift feedback !!

  • I upgraded from 3gs and want to use my old 3gs as an ipod. how can i update my new apple ID on the 3gs as it still shows a previous one that I had?

    I recently upgraded from 3Gs to Iphone4 and want to use my old 3Gs as an ipod. how can i update
    the user ID on the 3gs to a new one that I have as it is still showing a previous user ID?

    Settings>Store...tap the ID shown...sign out...sign back in with the ID you want to use.

  • How can i update data in JTable at run time ?

    i am trying to build a client/server architecture for conducting quizzes & online tests.. My client will return a object to the server after the test is over, which contains details about the participant, his score and other details. i am putting the incoming object to an Vector. I'll create a new thread each time for the incoming connection and insert the object to the Vector.. Now, please tell me tat, how can i update my table automatically at run time so tat, my table is updated whenever a new object is entered into vector..
    here is my code for the table..
    public class MyTableModel extends AbstractTableModel {
        String columNames[] = { "ID", "NAME", "COLLEGE", "SCORE", "CELL" };
        /** Creates a new instance of MyTableModel */
        public MyTableModel() {
            Main.List = new Vector();
            SetDefaultData();
        public int getRowCount() {
            return Main.List == null ? 0 : Main.List.size();
        public int getColumnCount() {
            return columNames.length;
        public String getColumnName(int column) {
            return columNames[column];
        public boolean isCellEditable(int row,int col) {
            return false;
        public Object getValueAt(int rowindex, int columnindex) {
            if(rowindex < 0 || rowindex >= getRowCount())
                return "";
            Student row = (Student)Main.List.elementAt(rowindex);
            switch (columnindex)
                case 0 : return row.id;
                case 1 : return row.name;
                case 2 : return row.college;
                case 3 : return row.score;
                case 4 : return row.cell;
            return "";
        public String getTitle() {
            return "Student Table";
        private void SetDefaultData() {
            Main.List.removeAllElements();
            Main.List.addElement(new Student("CS041","Keerthivasan M","MNM",95,"9884326321"));
            Main.List.addElement(new Student("CS012","Arun M","MNM",90,"9884825780"));
            Main.List.addElement(new Student("CS019","Balaji S","MNM",79,"9841742068"));
            Main.List.addElement(new Student("CS005","Anand R","MNM",89,"9884130727"));
            Main.List.addElement(new Student("CS045","Manish J","MNM",55,"9841624625"));
            Main.List.addElement(new Student("CS013","Mangal S","MNM",5,"9841961742"));
    }

    In the future Swing related questions should be posted in the Swing forum.
    how can i update my table automatically at run time so tat, my table is
    updated whenever a new object is entered into vector..You don't update the Vector directly. You should be creating a method in your TableModel, called "addRow(...)". This method will do two things:
    a) add the Student object to the Vector
    b) invoke the fireTableRowsInserted(..) method of AbstractTableModel. This will cause the table to be repainted.

  • HT1212 I am unable to get our of a continuous cycle when trying to update or restore my iPad 2. Plug in to iTunes 12.0.1 (latest version). Click update, told can't update, have to restore. Restore fails with error 9. Any help appreciated.

    When I tried to update my iPad I got an error 9. Now, I am unable to access my iPad. It is in a continuous cycle when I try to update or restore the iPad 2. Plug in to iTunes 12.0.1 (latest version). Click update, told can't update, have to restore. Restore fails with error 9. Any help appreciated.
    Here's the cycle:
    I plug in my iPad when “cable to iTunes shows on iPad screen. It says "Your iPad can't be updated, you must restore it to factory settings." That bad enough news, but it gets worse.
    Click Restore
    Extracting software…
    Preparing iPad for restore
    Waiting for iPad…
    Verifying iPad restore with Apple…
    (empty bar under the Apple logo…does not show any activity)
    “The iPad “iPad” could not be restored. An unknown error occurred (9).”
    Notes: I just upgraded to OS X Yosemite 10.10.1 on my iMac (27-inch, Mid 2011) in the last week. It’s the first time I’m tried to backup/update my iPad since the iMac update.
    I swapped out the USB cable to a new cable and get the same results.
    I also unplugged all other USB devices from the iMac and security on my iPad and still get the same results.
    I find it strange that it shows no Serial number for my my iPad 2 when plugged in. It shows “Serial Number: n/a on the screen when it displays: “iPad Recovery Mode To update your iPad without erasing its contents, click Update. To restore your iPad to its factory settings, click Restore iPad.
    I prefer to update my iPad, but it displays “Your iPad can’t be updated, you must restore it to factory settings. If you previously backed up the iPad, click Restore Backup after the restore process completes.”
    It’s a continuous loop. I get the display on my iPad to plug in the iPad to iTunes, plug it in which ends after going through the above procedure saying an error occurred (9).
    So now I cannot use my iPad. When I turn it on I get the display showing me to plug it into iTunes with the cable. Since this is the only option I have I plug it in and the loop begins.
    Any advice would be appreciated.
    Thanks!

    Hello jaybearden,
    Thanks for the question. After reviewing your post, it sounds like you are not able to restore the iOS device since you get an error 9. I would recommend that you read this article, it may be able to help the issue.
    Resolve iOS update and restore errors - Apple Support
    Check your security software
    Related errors: 2, 4, 6, 9, 1000, 1611, 9006. Sometimes security software can prevent your device from communicating with either the Apple update server or with your device.
    Check your security software and settings to make sure that they aren't preventing a connection to the Apple servers.
    Thanks for using Apple Support Communities.
    Have a nice day,
    Mario

  • Can't update in mysql

    I am using JSP and MYSQL with a bean that does my database work.
    my search.jsp looks up records, when I click edit it sends the values to my inventory_admin.jsp
    When I make the changes to the data, the data is not saved in the database.
    Please, look see!
    <!--search.jsp-->
    <jsp:useBean id="inventoryBean" scope="session" class="mybeans.inventoryBean" />
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <%// Do search with bean.
         String s = request.getParameter("searchField");
         int searchId = -1;
         if(s != null)
              try
                   searchId = Integer.parseInt(s);
              catch(NumberFormatException e) {}
         //Do actual search with bean
         boolean rc = false;
         if(searchId != -1)
              rc = inventoryBean.findByPrimaryKey(searchId);
              %>
    <form action="search.jsp" method="post" enctype="application/x-www-form-urlencoded">
    <h2 align="center">Software Inventory </h2>
    <p align="center"> </p>
    <p>Lookup:
    <input name="searchField" type="text" id="searchField">
    <input type="submit" name="Submit" value="Submit">
    </p>
    </form>
    <%
         //Output 'not found' message if needed
         if(rc == false)
              out.println("<P><B>Product not found</B></P>");
    %>
    <table width="25%" border="0">
    <tr>
    <td>Item ID:</td>
    <td><jsp:getProperty name="inventoryBean" property="itemid" /></td>
    </tr>
    <tr>
    <td>Product Name:</td>
    <td><jsp:getProperty name="inventoryBean" property="item" /></td>
    </tr>
    <tr>
    <td>Platform:</td>
    <td><jsp:getProperty name="inventoryBean" property="platform" /></td>
    </tr>
    <tr>
    <td>Serial:</td>
    <td><jsp:getProperty name="inventoryBean" property="serial" /></td>
    </tr>
    <tr>
    <td>Description:</td>
    <td><jsp:getProperty name="inventoryBean" property="description" /></td>
    </tr>
    </table>
    <p>&nosave=yes">EDIT</a></p>
    <p align="center"> </p>
    </body>
    </html>
    <!--inventory_admin.jsp-->
    <jsp:useBean id="inventoryBean" scope="session" class="mybeans.inventoryBean" />
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <%-- Copy all form variables at once into the bean--%>
    <jsp:setProperty name="inventoryBean" property="*" />
    <%
         boolean saveResult = false;
         boolean notSaved = false;
         //Save our changes
         String s = request.getParameter("nosave");
         if(s == null || s.equals("yes") == false)
    saveResult = inventoryBean.update();
         else
              notSaved = true;
         //Do search with bean
         s = request.getParameter("itemid");
         int searchId = -1;
         if(s != null)
              try
                   searchId = Integer.parseInt(s);
              catch(NumberFormatException e) {}
         //Do actual search with Bean
         boolean rc;
         if(searchId != -1)
              rc = inventoryBean.findByPrimaryKey(searchId);
    %>
    <h2 align="center">Software Inventory - Edit Mode</h2>
    <FORM action="inventory_admin.jsp" method="post" enctype="application/x-www-form-urlencoded">
    <table width="25%" border="0">
    <tr>
    <td>ITEMID</td>
    <td><jsp:getProperty name="inventoryBean" property="itemid" /></td>
    </tr
    <tr>
    <td>Product Name:</td>
    <td><input name="description" type="text" value="<jsp:getProperty name="inventoryBean" property="item" />"></td>
    </tr>
    <tr>
    <td>Platform:</td>
    <td><input name="description" type="text" value="<jsp:getProperty name="inventoryBean" property="platform" />"></td>
    </tr>
    <tr>
    <td>Serial:</td>
    <td><input name="description" type="text" value="<jsp:getProperty name="inventoryBean" property="serial" />"></td>
    </tr>
    <tr>
    <td>Description:</td>
    <td><input name="description" type="text" value="<jsp:getProperty name="inventoryBean" property="description" />"></td>
    </tr>
    </table>
    <%
         if(notSaved == false)
              if(saveResult == true)
                   out.println("Changes saved");
              else
                   out.println("Changes NOT saved");
    %>
    <p><input type="submit" name="Submit" value="Submit"></p>
    <p align="center"> </p>
    </FORM>
    </body>
    </html>
    //inventory.java
    Here is the Bean Im using:
    // inventoryBean.java - Simple database bean for table products
    package mybeans; // Our custom 'package'.
    import mybeans.DBConfigInfo; // Import helper classes
    import mybeans.DBWorker; // for simpler database programming.
    // Import other packages here.
    import java.sql.*; // For database access.
    import java.util.Hashtable; // For findRecords().
    public class inventoryBean
    private boolean isBeanDataValid = false; // Set when bean contains valid data.
    private boolean isDBError = false; // Stores whether there was a processing error.
    private String dbErrorMsg = "(No error)";
    private DBWorker dbWorker; // Helper object for JDBC programming.
    // Attributes
    private String item = "";
    private String platform = "";
    private String serial = "";
    private String description = "";
    private int itemid = 0; // Primary key field
    public void clear()
    // Clears data in all your properties to 'empty' state.
    item = "";
    platform = "";
    serial = "";
    description = "";
    itemid = 0; // Primary key field
    // Accessor Methods
    public void setItem(String newItem) { item = newItem; }
    public String getItem() { return item; }
    public void setPlatform(String newPlatform) { platform = newPlatform; }
    public String getPlatform() { return platform; }
    public void setSerial(String newSerial) { serial = newSerial; }
    public String getSerial() { return serial; }
    public void setDescription(String newDescription) { description = newDescription; }
    public String getDescription() { return description; }
    public void setItemid(int newItemid) { itemid = newItemid; }
    public int getItemid() { return itemid; }
    // Operations
    // Default constructor.
    public inventoryBean()
    // Create a helper object to work with database.
    // DO NOT DELETE THIS CODE.
    dbWorker = new DBWorker();
    // Database Operations
    // Built-in methods:
    public boolean findByPrimaryKey(int searchId)
    // Use this method to find 1 record by primary key for your table.
    // (After this call, all fields will be loaded into your properties.)
    // Clear existing data, if any.
    clear();
    isBeanDataValid = false;
    // Query by primary key.
    boolean rc = dbWorker.open();
    if(rc == false)
    isDBError = true;
    dbErrorMsg = dbWorker.errorMsg;
    return false;
    try
    // 1) Get a connection.
    Connection conn = dbWorker.getConnection();
    // 2) Create a statement.
    Statement st = conn.createStatement();
    // 3) Build your SQL.
    String sql = "SELECT item, platform, serial, description, " +
    "itemid " +
    "FROM products " +
    "WHERE itemid=" + searchId;
    //System.out.println("DEBUG SQL =" + sql);
    // 4) Get a result set.
    ResultSet rs = st.executeQuery(sql);
    // 5) Move to first record
    if(rs.next())
    // 6) Retrieve fields into your properties using JDBC get??? methods.
    item = rs.getString("item");
    platform = rs.getString("platform");
    serial = rs.getString("serial");
    description = rs.getString("description");
    itemid = rs.getInt("itemid");
    // 7) Ensure non-null String fields with dbWorker.safeStr()
    item = dbWorker.safeStr(item);
    platform = dbWorker.safeStr(platform);
    serial = dbWorker.safeStr(serial);
    description = dbWorker.safeStr(description);
    // Set result code.
    isBeanDataValid = true;
    // 8) Close all DB objects.
    rs.close();
    st.close();
    dbWorker.close(); // Connection too.
    catch(SQLException e)
    System.out.println("Error in findByPrimaryKey (" + e.getMessage() + ")");
    return isBeanDataValid;
    // Update a record
    public boolean update()
    // Use this to update a record by a primary key.
    boolean resultCode = false;
    // Query by primary key.
    boolean rc = dbWorker.open();
    if(rc == false)
    isDBError = true;
    dbErrorMsg = dbWorker.errorMsg;
    return false;
    try // Remember to put all DB code inside a try block!
    // 1) Get a connection.
    Connection conn = dbWorker.getConnection();
    // 2) Create a statement.
    Statement st = conn.createStatement();
    // 3) Build your SQL.
    String sql = "UPDATE products SET item=" + dbWorker.sqlStr(item) + "," +
    "platform=" + dbWorker.sqlStr(platform) + "," +
    "serial=" + dbWorker.sqlStr(serial) + "," +
    "description=" + dbWorker.sqlStr(description)+
    " WHERE itemid=" + itemid;
    //System.out.println("DEBUG SQL =" + sql);
    // 4) Run action query.
    int rowsAffected = st.executeUpdate(sql);
    // 5) See if we succeeded (1 recorded affected).
    if(rowsAffected == 1)
    resultCode = true;
    else
    System.out.println("Warning: Can't update in update()!");
    // 6) Close all DB objects.
    st.close();
    dbWorker.close(); // Connection too.
    catch(SQLException e)
    System.out.println("Error in update (" + e.getMessage() + ")");
    return resultCode;
    // Delete a record
    public boolean delete(int deleteId)
    // Use this to delete a record by a primary key.
    boolean resultCode = false;
    // Query by primary key.
    boolean rc = dbWorker.open();
    if(rc == false)
    isDBError = true;
    dbErrorMsg = dbWorker.errorMsg;
    return false;
    try
    // 1) Get a connection.
    Connection conn = dbWorker.getConnection();
    // 2) Create a statement.
    Statement st = conn.createStatement();
    // 3) Build your SQL.
    String sql = "DELETE FROM products WHERE itemid=" + deleteId;
    //System.out.println("DEBUG SQL =" + sql);
    // 4) Run action query.
    int rowsAffected = st.executeUpdate(sql);
    // 5) See if we succeeded (1 recorded affected).
    if(rowsAffected == 1)
    resultCode = true;
    else
    System.out.println("Warning: Can't delete ID #" + deleteId + " in delete()!");
    // 6) Close all DB objects.
    st.close();
    dbWorker.close(); // Connection too.
    catch(SQLException e)
    System.out.println("Error in delete (" + e.getMessage() + ")");
    return resultCode;
    // Insert a new record.
    public boolean insert(String newItem, String newPlatform, String newSerial, String newDescription,
    int newItemid)
         // Use this to update a record by a primary key.
    boolean resultCode = false;
    // Query by primary key.
    boolean rc = dbWorker.open();
    if(rc == false)
    isDBError = true;
    dbErrorMsg = dbWorker.errorMsg;
    return false;
    try // Remember to put all DB code inside a try block!
    // 1) Get a connection.
    Connection conn = dbWorker.getConnection();
    // 2) Create a statement.
    Statement st = conn.createStatement();
    // 3) Build your SQL.
    String sql="INSERT INTO products(item, platform, serial, description, " +
    "itemid) " +
    "VALUES(" + dbWorker.sqlStr(newItem) + "," + dbWorker.sqlStr(newPlatform) + "," + dbWorker.sqlStr(newSerial) + "," + dbWorker.sqlStr(newDescription) + "," +
    newItemid + ")";
    //System.out.println("DEBUG SQL =" + sql);
    // 4) Run action query.
    int rowsAffected = st.executeUpdate(sql);
    // 5) See if we succeeded (1 recorded affected).
    if(rowsAffected == 1)
    resultCode = true;
    else
    System.out.println("Warning: Can't update in insert()!");
    // 6) Close all DB objects.
    st.close();
    dbWorker.close(); // Connection too.
    catch(SQLException e)
    System.out.println("Error in insert (" + e.getMessage() + ")");
    return resultCode;
    public int findMaxPrimaryKey()
    // Use this method to find the current max. value for a primary key
    // in the database for a given table.
    int retVal = -1;
    // Query by primary key.
    boolean rc = dbWorker.open();
    if(rc == false)
    isDBError = true;
    dbErrorMsg = dbWorker.errorMsg;
    return -1;
    try // Remember to put all DB code inside a try block!
    // 1) Get a connection.
    Connection conn = dbWorker.getConnection();
    // 2) Create a statement.
    Statement st = conn.createStatement();
    // 3) Build your SQL.
    String sql = "SELECT MAX(itemid) FROM products";
    //System.out.println("DEBUG SQL =" + sql);
    // 4) Get a result set.
    ResultSet rs = st.executeQuery(sql);
    // 5) Move to first record
    if(rs.next())
    // 6) Retrieve fields into your properties using JDBC get??? methods.
    retVal = rs.getInt(1); // Get first and only column.
    // 7) Close all DB objects.
    rs.close();
    st.close();
    dbWorker.close(); // Connection too.
    catch(SQLException e)
    System.out.println("Error in findMaxPrimaryKey (" + e.getMessage() + ")");
    return retVal;
    public Hashtable findRecords(String filter, String orderBy)
    // Use this method to return a Hashtable filled with
    // one or more records. You can specified a 'filter'
    // for finding records and 'orderBy' will determine the sort order.
    Hashtable retVal = new Hashtable();
    retVal.put("ROWCOUNT", "0");
    retVal.put("COLUMNCOUNT", "0");
    retVal.put("STATUS", "EMPTY");
    // Query by primary key.
    boolean rc = dbWorker.open();
    if(rc == false)
    isDBError = true;
    dbErrorMsg = dbWorker.errorMsg;
    return retVal;
    try // Remember to put all DB code inside a try block!
    // 1) Get a connection.
    Connection conn = dbWorker.getConnection();
    // 2) Create a statement.
    Statement st = conn.createStatement();
    // 3) Build your SQL.
    String sql = "SELECT item, platform, serial, description, " +
    "itemid " +
    "FROM products " +
    "WHERE " + filter + " " +
    "ORDER BY " + orderBy;
    //System.out.println("DEBUG SQL =" + sql);
    // 4) Get a result set.
    ResultSet rs = st.executeQuery(sql);
    int rowCount = 0;
    // 5) Move to first record (and then next) record.
    while(rs.next())
    // 6) Retrieve fields into your properties using JDBC get??? methods.
    String thisItem = rs.getString("item");
    String thisPlatform = rs.getString("platform");
    String thisSerial = rs.getString("serial");
    String thisDescription = rs.getString("description");
    int thisItemid = rs.getInt("itemid");
    // 7) Ensure non-null String fields with dbWorker.safeStr()
    thisItem = dbWorker.safeStr(thisItem);
    thisPlatform = dbWorker.safeStr(thisPlatform);
    thisSerial = dbWorker.safeStr(thisSerial);
    thisDescription = dbWorker.safeStr(thisDescription);
    // 8) Load this row into our Hashtable.
    // The convention here is to pack each row's column name with an ID
    // indicating the row. "ProjectId" + "0" = "ProjectId0" ===mapped to===> Value
    // Put this record into Hashtable.
    retVal.put("item" + rowCount, thisItem);
    retVal.put("platform" + rowCount, thisPlatform);
    retVal.put("serial" + rowCount, thisSerial);
    retVal.put("description" + rowCount, thisDescription);
    retVal.put("itemid" + rowCount, "" + thisItemid);
    rowCount++;
    // 9) Close all DB objects.
    rs.close();
    st.close();
    dbWorker.close(); // Connection too.
    // Write info to our hashtable--Since this container hold virtually anything,
    // you can put in whatever 'metadata' you want about your result set.
    retVal.put("ROWCOUNT", "" + rowCount);
    retVal.put("COLUMNCOUNT", "5");
    retVal.put("STATUS", "OK");
    catch(SQLException e)
    System.out.println("Error in findRecords (" + e.getMessage() + ")");
    retVal.put("STATUS", "ERROR");
    return retVal;
    //============================================================
    // DO NOT CHANGE THE CODE BELOW.
    //============================================================
    public boolean isValid()
    // Does bean contain real data?
    return isBeanDataValid;
    public boolean isError()
    // Returns true if there was a DB error.
    return isDBError;
    public String getErrorMsg()
    // Returns error message, if any.
    return dbErrorMsg;
    //=====================================================================
    // TODO: Remember to comment out main() with /* */ for production code!
    //=====================================================================
    // TEST DRIVER CODE
    public static void main(String[] args)
    // Test driver code goes here.
    String beanName = "inventoryBean";
    String tableName = "products";
    boolean isDataValidationError = false;
    // Exercise CRUD functionality of this bean.
    System.out.println("==============================================================");
    System.out.println("Starting Test Driver for bean " + beanName + "....");
    System.out.println("==============================================================");
    // Create bean.
    inventoryBean myBean = new inventoryBean();
    // Create a new record.
    int newId = myBean.findMaxPrimaryKey();
    newId++;
    boolean rc = myBean.insert("e", "t", "g", "R",
    newId);
    if(rc)
    System.out.println("SUCCESS: Inserted new record #= " + newId + ".");
    else
    System.out.println("ERROR! Can't insert record #= " + newId + ".");
    System.out.println("====================================================");
    System.out.println("VALIDATION FAILED: Test driver generated an error.");
    System.out.println("====================================================");
    return;
    // Retrieve a record
    rc = myBean.findByPrimaryKey(newId);
    if(rc)
    System.out.println("SUCCESS: Record #" + newId + " found.");
    else
    System.out.println("====================================================");
    System.out.println("VALIDATION FAILED: Test driver generated an error.");
    System.out.println("====================================================");
    System.out.println("ERROR! Record #" + newId + " NOT found.");
    // Simulate using set??? accessor methods with test data.
    // (Note: We don't change the primary key.)
    int testItemid = newId;
    System.out.println("Testing set???() accessor methods....");
    System.out.println("Setting Record #" + newId + " to:");
    System.out.println(" inventoryBean.setItem(testItem); // = R");
    myBean.setItem(testItem);
    System.out.println(" inventoryBean.setPlatform(testPlatform); // = Y");
    myBean.setPlatform(testPlatform);
    System.out.println(" inventoryBean.setSerial(testSerial); // = E");
    myBean.setSerial(testSerial);
    System.out.println(" inventoryBean.setDescription(testDescription); // = k");
    myBean.setDescription(testDescription);
    System.out.println(" inventoryBean.setItemid(testItemid); // = " + newId);
    myBean.setItemid(testItemid);
    // Call update.
    rc = myBean.update();
    if(rc)
    System.out.println("SUCCESS: Record #" + newId + " updated.");
    else
    System.out.println("ERROR! Record #" + newId + " NOT updated.");
    System.out.println("====================================================");
    System.out.println("VALIDATION FAILED: Test driver generated an error.");
    System.out.println("====================================================");
    return;
    // Requery and validate each field.
    rc = myBean.findByPrimaryKey(newId);
    if(rc)
    System.out.println("SUCCESS: Updated Record #" + newId + " found.");
    else
    System.out.println("====================================================");
    System.out.println("VALIDATION FAILED: Test driver generated an error.");
    System.out.println("====================================================");
    System.out.println("ERROR! Record #" + newId + " NOT found");
    // Simulate using get??? accessor methods.
    // Validate updated values against test values.
    System.out.println("Validating Record #" + newId + ":");
    String testData;
    String actualItem = myBean.getItem();
    testData = "R";
    if(testData.equals(actualItem))
    System.out.println(" OK: inventoryBean.getItem() = actualItem");
    else
    System.out.println(" ERROR! inventoryBean.getItem() returned [" + actualItem + "] instead of [R]");
    isDataValidationError = true;
    String actualPlatform = myBean.getPlatform();
    testData = "Y";
    if(testData.equals(actualPlatform))
    System.out.println(" OK: inventoryBean.getPlatform() = actualPlatform");
    else
    System.out.println(" ERROR! inventoryBean.getPlatform() returned [" + actualPlatform + "] instead of [Y]");
    isDataValidationError = true;
    String actualSerial = myBean.getSerial();
    testData = "E";
    if(testData.equals(actualSerial))
    System.out.println(" OK: inventoryBean.getSerial() = actualSerial");
    else
    System.out.println(" ERROR! inventoryBean.getSerial() returned [" + actualSerial + "] instead of [E]");
    isDataValidationError = true;
    String actualDescription = myBean.getDescription();
    testData = "k";
    if(testData.equals(actualDescription))
    System.out.println(" OK: inventoryBean.getDescription() = actualDescription");
    else
    System.out.println(" ERROR! inventoryBean.getDescription() returned [" + actualDescription + "] instead of [k]");
    isDataValidationError = true;
    int actualItemid = myBean.getItemid();
    if(actualItemid == newId)
    System.out.println(" OK: inventoryBean.getItemid() = actualItemid");
    else
    System.out.println(" ERROR! inventoryBean.getItemid() returned [" + actualItemid + "] instead of [" + newId + "]");
    isDataValidationError = true;
    // Cleanup with delete.
    rc = myBean.delete(newId);
    if(rc)
    System.out.println("SUCCESS: Record #" + newId + " deleted.");
    else
    System.out.println("ERROR! Record #" + newId + " NOT deleted.");
    // Now test out findRecords() for up to 100 records.
    Hashtable data = myBean.findRecords("itemid > 0", "itemid");
    String s = (String)data.get("STATUS");
    if(s != null && s.equals("OK"))
    s = (String)data.get("ROWCOUNT");
    int rowCount = Integer.parseInt(s);
    if(rowCount > 100) // Just output first 100 records.
    rowCount = 100;
    System.out.println("SUCCESS: Returning " + rowCount + " records (100 max.) using findRecords():");
    for(int i = 0; i < rowCount; i++)
    System.out.println(" Row #" + i + "=" +
    data.get("item" + i) + ", " +
    data.get("platform" + i) + ", " +
    data.get("serial" + i) + ", " +
    data.get("description" + i) + ", " +
    data.get("itemid" + i));
    else
    System.out.println("ERROR! No rows returned using findRecords()!");
    System.out.println("====================================================");
    System.out.println("VALIDATION FAILED: Test driver generated an error.");
    System.out.println("====================================================");
    return;
    if(isDataValidationError == false)
    // Print final success message.
    System.out.println("================================================================================");
    System.out.println("VALIDATION SUCCESS! Bean " + beanName + " passed all automated tests.");
    System.out.println("================================================================================");
    else
    System.out.println("====================================================================================");
    System.out.println("ERROR! Tests completed but bean " + beanName + " had a data validation error.");
    System.out.println("====================================================================================");

    Couple of pointers.
    1 - use [ code ] tags to post code
    2 - that is WAY too much code for more than a cursory glance. You're lucky the problem was easy to spot.
    Your problem lies in your edit JSP form:
    <td>Product Name:</td>
    <td><input name="description" type="text" value="<jsp:getProperty name="inventoryBean" property="item" />"></td>Note that the name of the input field is different from the jsp property you are populating it with.
    In fact, all of your input fields have a name of "description"
    I would recommend on your inventory_admin.jsp page that you put the following debugging code to make sure that the parameter values come through and are set correctly.
      out.println("name = param: " + request.getParameter("name") + "bean = " + inventoryBean.getName() + "<BR>");
      out.println("description = param:" + request.getParameter("description") + "bean = " + inventoryBean.getDescription() + "<BR>");
      ...

  • Can not update request in data target

    Hi,
    We have a process chain for master data (10 parallel) loads.  One of the load
    failed with error "can not update request REQU_46xxxxxxxxxxxxxx in data target".
    When I checked the InfoPackage
    (a) update: full load
    (b) it has data selection
    (c) processing :PSA and then to data targets
    (d) Data targets: update in all data targets for which active rules exist.
    But I do not see any list of data targets here.
    Can some one please suggest me how do I correct this load failure.
    Thanks

    Hi Wondewossen, NS and Nagesh,
    Thanks for the information. I am in support, and the developer is
    not here now.
    I have checked Header tab in the monitor, in this there
    is a update symbol and infosource name and an -->
    but after arrow there is nothing.
    when I click on this I get a message
    "No active update rules exist".
    Can you please advice me how to I correct this.
    Thanks

Maybe you are looking for