Error opening OWA in environment coexisting 2010 2013

Good Morning,
I am facing the following problem was realziado uam mailbox migration from Exchange 2010 to Exchange 2013, however this account has link with BES for Exchange, where it was necessary to return to 2010 after it not possible to account be accessed by Exchange
OWA 2013 with the error below:
A problem occurred while you were trying to use your mailbox.
X-OWA-Error: Microsoft.Exchange.Data.Storage.NotSupportedWithServerVersionException
X-OWA-Version: 15.0.847.32
X-FEServer: <name exchange server 2013>
X-BEServer: <name exchange server 2013>
Date: 15/07/2014 14:12:13
Version 2010: 14.3.123.4
Version 2013: 15.0.847.32
Grateful for the assistance.

Hi,
From your description, I would like to clarify the following things:
1. Please check if the issue is related to AD replication.
2. Open ADUC -> under System -> Properties of AdminSDholder Folder -> Security -> Authenticated Users -> Advanced -> Enable inheritance.
3. Restart the Microsoft Exchange Active Directory Topology service on Exchange 2010 and Exchange 2013.
4. Recycle the DefaultAppPool and MSExchangeOWAAppPool Application Pools in IIS manager on both servers and check the result.
Hope it helps.
Best regards,
Amy Wang
TechNet Community Support

Similar Messages

  • Exchange 2010/2013 co-existence and Lync integration

    Hello,
    I'm looking at integrating Lync Server 2013 into my lab environment, which consists of a mixed 2010/2013 Exchange environment.
    UM - Exchange 2010
    CAS - Exchange 2013
    MBX - Exchange 2010
    MBX - Exchange 2013
    I've been reading about associating CAS and MBX servers with UM dial plans, when integrating with Lync.
    The Technet articles, and MS Press documentation I've read suggests that
    all CAS and MBX servers need to be associated with the dial plan.
    Does this include the 2010 MBX servers?
    As far as I was aware, in a co-existence environment between 2010/2013 all traffic is proxied to the MBX servers via the CAS 2013 role?
    Does this rule still apply when UM and Lync exist in the environment?
    Also, does the 2010 UM server need to be associated with the Lync UM dial plan, or does the 2013 CAS server handle this traffic as well?
    Thanks
    Matt

    So, just the UM server in 2010 would be associated with the dialplan, you won't even have the option to add a 2010 MBX server.
    The traffic isn't proxied by the 2013 CAS, it's more of a redirect, and yes this happens.  A lot of what will happen under the hood will be somewhat transparent, Lync will determine where it wants to send the UM traffic.  You can
    watch this in the Lync logger by watching SIPStack.
    The 2010 UM server can be associated with the dial plan, but you might not need it unless you're trying to recreate that specifically in your lab.  Exchange 2013 UM can serve mailboxes on an Exchange 2010 server.
    I would suggest just deploying it in your lab and watching what happens, that's half the fun. :)
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question please click "Mark As Answer".
    SWC Unified Communications

  • Sorry, we couldn't open...Error opening office documents from SharePoint 2013 in the desktop applications

    Sorry, we couldn't open...Error opening office documents from SharePoint 2013 in the desktop applications        
    One of our Managers encounters the error 'A problem occurred while accessing the Office document cache.  Do you want to repair this problem?'
    Then When he says yes it give a warning that the cache will be backed up and replaced
    Then it says 'A new office document Cache has been created...'
    Then it loads this cache with an error
    Then After all that the next time he tries to open the document it says  is encountered "Sorry, we couldn't open 'URL."
    We have Reinstalled office 2013 on the users PC repaired the cache numerous times
    Followed -  http://office.microsoft.com/en-gb/word-help/manually-rename-the-office-document-cache-HA101848838.aspx
    Updated Lync to 2013 leaving Access as the only office 2010 application (required for legacy systems access)
    Repair installed office 2010 and office 2013 again
    The SharePoint site has been added to the trusted sites list and the set up assistant run from office 365
    And the issue remains the Same all other users including some who also have Access 2010 for legacy systems access have no Issues OS is windows 7 32 Bit browser is IE 9
    Office 365 said
    Reply by Rachel Zhang MSFT Support
    Hi Alex,
    From your description, I notice that the issue is related to Office client. We would like to help you, but I’m sorry that our forum does not focus on this scenario and has limited resources regarding it. However, we have a dedicated support forum where
    the support engineers will help you with the issues about Office client:
    Microsoft Office Community:
    http://answers.microsoft.com/en-us/office/forum/office_2013_release?tm=1365567547805
    Feel free to sign in to the Office community and click Participate->Ask a Question to post the question with the relevant information.
    Microsoft Office Community:  
    Feel free to sign in to the Office community and click to post the question with the relevant information.
    Office team said
    Hello Alex,
    Thank you for posting your query in Microsoft Office Community.

    Check if other excel works fine
    Do you have any script\macro in excel file
    Check if all application pool on all servers are running
    both office and IE should be same build (64 or 32 bit)
    what is the error message in ULS log and Event viewer
    If this helped you resolve your issue, please mark it Answered

  • One Note documents on S/P 2013 are not opening/syncing with one note (2010) desktop clients

    Hi,
    We have S/p 2010 and S/P 2013 running in our company. we also have some computers with office 2010 and others with office 2013.
    since a few days ago, the desktop one note apps are failing to open one note documents stored on S/P 2013. they can still access/sync oneNote docs on S/P 2010.
    I can not trace back the problem to anything. and it happens to all stations having onenote 2010. the users running onenote 2013 are having no trouble with either S/P
    Any ideas?
    Thanks in advance

    Hi Yiannis,
    What was the error message when you opened the OneNote file from SharePoint 2013 in OneNote desktop?
    I recommend to change the settings below in SharePoint document library where the OneNote file stores:
    Turn off Required Check Out in the SharePoint Document Library.
    Turn off Minor Versions in the SharePoint Document Library.
    Turn off Required Properties in the SharePoint Document Library.
    For detailed steps, please refer to the link below:
    https://support.office.com/en-sg/article/Troubleshoot-errors-in-OneNote-40976dfa-818f-4e5f-b8fb-b0fbb9bf785a
    If above cannot work, please check if the site in read-only mode.
    http://blog.portiva.nl/2014/06/25/sharepoint-2013-site-stuck-in-read-only-mode/
    If that is the case, then you need to ask your administrator to turn off read-only mode. However, if this is not an option, you can follow these steps in the link below to work around the issue.
    https://support.microsoft.com/en-us/kb/2777002
    Best regards,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Getting error "IntelliSense: cannot open source file "Environ.h"

    Hi,
    I have a VC++ project which adds tool bar to arobat reader. But when i build this project using VS 2010 it's giving a error "IntelliSense: cannot open source file "Environ.h" and some other header files.
    Please suggest me to resolve this issue.
    Thanks
    Shiva

    Hi,
    Thanks for yourreply, can you tell me which version or VS it supports.
    Thanks
    Shiva

  • When opening OWA getting error identitiy not verified

    Dear All,
    Need help on the same, we have deployed a third party SSL certificate on my CAS server 2010 previously it was running with self signed certificate, but after applying certificate it was having some problem so we roll back and removed the certificates
    from Server, but now users are facing error duinring opening OWA site giving ssl certificated error, it says identity not verified and https is coming in red and stirked out.
    Regards,
    Sudhir

    Hello,
    Please follow the Ed's suggestion. Try to apply a SAN certificate to check the result.
    Here is an article for your reference.
    http://technet.microsoft.com/en-us/library/aa995942(v=exchg.141).aspx
    Cara Chen
    TechNet Community Support

  • Redirection loop detected while opening Exchange 2007 mailboxes through Exchange 2013 OWA page

    Team, in our infra Exchange 2013 CU8 & Exchange 2007 SP3 RU15 running. Exchange 2013 recently deployed but while opening exchange 2007 users mailbox through 2013 OWA getting error "Redirection loop detected". Want to update you few things :
    Public DNS record created as mail.myinfra.in with x.x.x.2 IP and legacy.myinfra.in with x.x.x.3 IP.
    Virtual directory modified mail.myinfra.in for 2013 & legacy.myinfra.in for 2007.
    All the OWA request need to pass through public DNS only no internal DNS record for OWA.
    Through ISA already rule created and tested also like https://mail.myinfra.in/owa giving me 2013 OWA page & https://legacy.myinfra.in/owa giving 2007 owa page. Only problem while opening https://mail.myinfra.in/owa with 2013 mailbox id/pwd working fine
    but with 2007 mailbox id/pwd giving error "Redirection loop detected".
    Appreciate if you can help quickly.

    Hello
    tip: check iis log on both of exch servers and check  owa  application haven't got "HTTP redirect" enabled.
    sorry my english

  • Can not open pdf file in Outlook 2010 - error opening document

    when I click on the PDF file in the email (Outlook 2010), Adobe opens but it pops a window "There was an error opening this document. Access denied". If I save the document as a file, aka to the desktop, I can open it then.
    Also also I click on the ok button in adobe, it posted a Runtime error! application has requested the RunTime to terminate it in an unusal way.
    has anyone seen this issue. Desktop is using Windows XP, 4 gig ram, Adobe X verision 10.0.1

    Did you try this?  It worked for me.
    http://www.darrenstraight.com/blog/2010/12/16/adobe-reader-x-there-was-an-error-opening-th is-document-access-denied/
    Open up Adobe Reader X
    On the Toolbar Menu go to Edit > Preferences
    Go to the general tab under Categories.
    Untick “Enable Protected Mode at Startup”
    If asked if sure, click Yes and then Ok.
    Now close Adobe Reader X and try opening the PDF again.

  • 3138 SQL error opening sqlite db file from Outlook 2010 as attachment

    Has anyone of you tried sending the sqlite db file thru e-mail and then open the file from Outlook 2010?
    I have an air app that can be opened by doubleclicking the sqlite database file (invoke event). The file is sent via e-mail from the app itself, so another user can run the app directly from their e-mail client once he receives the db. Now everything works fine unless you use Outlook 2010 - when I open it I get an sql error 3138 - do you know what can be the problem? Everything is fine when I'm using different e-mail client (the same e-mail account, just other client) like Outlook 2003 or Thunderbird or Opera. I'm guessing Outlook 2010 is using some kind of protection to attachments that is making the file not understandable by the app, but Microsoft seems to ignore my e-mails sent to them with the same question. The db file is not encrypted if that changes anything and saving the file from outlook to desktop and then running does not help. When I do the same using Outlook 2003 everything works as it should, but unfortunatelly my customer upgraded to 2010 :/ Any ideas would be much appreciated.

    This looks like a new behavior of Outlook 2010 and isn't specific to PDFs. You will need to "save as" the document. There is a thread at Microsoft forums about this with some possible workarounds:
    http://social.technet.microsoft.com/Forums/en-US/outlook/thread/927d678d-b55b-4732-93cb-f1 3ed1dacf96/

  • Exchange 2010/2013 coexistence: OWA proxy not working properly ":-( Something went wrong"

    Hi
    Exchange 2010 users are NOT able to connect to their mailboxes when they go through exchange 2013 OWA address.  We get a message that says following ---> "Something went wrong"
    Following is our URL.  The address is pointing to 2013 CAS loadbalancer VIP.  Outlook anywhere is working fine.  What is going on?
    Important: All my exchange 2010 / 2013 URIs are the same as suggested by Microsoft (Owa, ecp, activesync, ews, autodiscover): --> mail.domain.com/XXX

    Hello Rawa,
    Can you log on Exchange 2010 OWA using its localhost address?
    Please make sure the intenralurl value is set to Exchange 2010’s local host name and set the Externalurl to Null.
    http://technet.microsoft.com/en-us/library/bb310763(v=exchg.141).aspx
    Thanks,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Simon Wu
    TechNet Community Support

  • Publishing Exchange coexistance in 2010/2013 in TMG

    I already asked this in the TMG forums and didnt really get the answers there, so hoping I get better luck
    here, so slightly rephrased:
    Environment:
    Two Windows 2008 R2, Exchange 2010 SP3 servers, currently holding all mailboxes
    Two Windows 2012 R2, Exchange 2013 SP1 servers, setup in progress
    Two Windows 2008 R2, TMG 2010, V7.0.9193.540 publishing both Exchange 2010 servers.
    Scenario:
    I need to allow incoming and outgoing emails through TMG to both Exchange 2010 and 2013 as it will take me weeks, if not months before all mailboxes are in 2013.
    Question:
    1. How do I need to configure TMG to allow both Exchange 2010 and 2013 simultaneously? 
    2. Do I just redirect all SMTP to Exchange 2010 mailboxes to Exchanges 2013 in TMG and 2013 just pass on the traffic to 2010 if it doesn't have the mailbox?
    Hoping to hear from someone whos actually had 2010/2013 in coexistence with TMG doing the publishing and firewalling for Exchange. Thanks.

    These answers assume that all servers are in the same Exchange organization.
    1.  Exchange 2013 will proxy all Exchange 2010 traffic, so all you should route all traffic through and publish the Exchange 2013 servers rather than trying to publish both.  Unfortunately, TMG hasn't been updated with a wizard for Exchange 2013. 
    I've seen this article that explains how to publish Exchange 2013, but I haven't tried it myself since none of my Exchange 2013 customers have deployed TMG with it.  It does come from a source I would trust.
    http://blogs.technet.com/b/exchange/archive/2012/11/21/publishing-exchange-server-2013-using-tmg.aspx
    2.  Generally I don't recommend routing SMTP through TMG as it doesn't offer much value for that, but there's no reason you can't do it.  You should not have to worry about the server to which you route SMTP since SMTP mail will find
    its way to the correct destination regardless of where you submit it.  It is my preference to change your routing so that all mail goes through the Exchange 2013 servers early in the project rather than late.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • Applying CU4 for Exchange 2013 SP1 in a mixed 2010 / 2013 Environment

    We're planning to apply Exchange 2013 SP1 CU in our mixed 2010 / 2013 environment. We'd also like to apply Exchange 2010 SP3 Rollup 5 as well. Are there any gotchas or best practices on what update to apply first?
    Orange County District Attorney

    We are planning to update our 2013 from CU5 to CU8
    and 2010 SP3 to Rollup 9
    I cant find any official documentation from MS concerning the upgrade path. Example. 
    Exchange 2013 first, then 2010. Like the above post outline. 
    I see 2010 being upgraded first thus bring version numbers closer together, reducing incompatibilities. 
    Do you still feel this is the appropriate install procedure? 
    Have you done this? 
    Djoe

  • Exchange 2010-2013 co-existence - need for OWA/ActiveSync legacy namespace?

    Hi all
    Straight to the point: how to I update units that were set up manually with Exchange ActiveSync (pointing to owa.domain.com) with a temporary legacy namespace owa-legacy.domain.com, and then back to owa.domain.com?
    Background: I did a test run of migrating a single-server installation from Exchange 2010 to Exchange 2013. As expected, after moving a user's mailbox to the new Exchange 2013 CAS with owa.domain.com still pointing to Exchange 2010, the user
    was unable to log in at the Exchange 2010 OWA, and the ActiveSync unit was unable to fetch mail.
    So I created a legacy namespace (owa-legacy.domain.com) and set this as the URL on the Exchange 2010 server, and waited for it to populate, then switched owa.domain.com to Exchange 2013. But the URL on ActiveSync units was still pointing to the wrong URL.
    What did I overlook or not understand, or am I making migration more complex than needed?
    Thanks for reading and best regards
    /Maurice
    PS: here were some of my pre-post readings:
    Exchange 2003-2013 co-existence, even better
    Exchange 2003-2013 co-existence,
    Exchange 2010-2013 co-existence slides,
    Upgrading ActiveSync to Exchange 2010,

    Hi
    Is that because External URL on Internet facing CAS servers were set to Blank,and Users are not able to get Updated URL
    Please try to Add the External URL and made sure that all the required configurations are set Appropriately.
    Also I suggest posting on Exchange ActiveSync Forum as well
    http://social.technet.microsoft.com/Forums/en-US/home?forum=exchangesvrmobility
    Cheers
    If you have any feedback on our support, please click
    here
    Zi Feng
    TechNet Community Support

  • Error opening environment more than once

    Hi,
    I have two java classes which both need to access a container in an environment (in parallel). When the first class is instantiated the environment is opened successfully. However, when the second class subsequently attempts to open the same environment I get an error. (I do not want to close the env from the first class, while the second class does its thing)
    The classes are Stylesheet extensions for an xmleditor which allows the stylesheet to look up item ID codes and display their names to the user by looking up the values in an xml file stored in a bdbxml container. There is a situation where two different objects need to have access to the environment at the same time - but its giving me an error when I instantiate the env for the second time - without having closed the first one)
    Any help would by gratefully received
    Kind Regards
    Swami Kevala
    I thought I could create multiple handles to the same environment?

    First is a class to encapsulate the environment (lifted mostly from the example code)
    package org.isha.archives.bdbxml;
    import java.io.*;
    import java.util.*;
    import com.sleepycat.db.*;
    import com.sleepycat.dbxml.*;
    //Class used to open and close a Berkeley DB environment
    public class DbEnv
    private Environment dbEnv_ = null;
    private XmlManager mgr_ = null;
    private boolean dbEnvIsOpen_ = false;
    private File path2DbEnv_ = null;
    public DbEnv(File path2DbEnv)
         throws Throwable {
              if (! path2DbEnv.isDirectory()) {
                   throw new Exception(path2DbEnv.getPath() +
                             " does not exist or is not a directory.");
              EnvironmentConfig config = new EnvironmentConfig();
              config.setCacheSize(50 * 1024 * 1024);
              config.setAllowCreate(true);
              config.setInitializeCache(true);
              config.setTransactional(true);
              config.setInitializeLocking(true);
              config.setInitializeLogging(true);
              config.setErrorStream(System.err);
              config.setThreaded(true);
              config.setRunRecovery(true);
              config.setLogAutoRemove(true);
              dbEnv_ = new Environment(path2DbEnv, config);
              //Boolean used to know whether to close the environment
              // when the cleanup() method is called.
              dbEnvIsOpen_ = true;
              path2DbEnv_ = path2DbEnv;
              mgr_ = new XmlManager(dbEnv_, null);
    //Returns the path to the database environment
    public File getDbEnvPath() { return path2DbEnv_; }
    //Returns the database environment encapsulated by this class.
    public Environment getEnvironment() { return dbEnv_; }
    //Returns the XmlManager encapsulated by this class.
    public XmlManager getManager() { return mgr_; }
    //Used to close the environment
    public void cleanup() throws DatabaseException
    if (dbEnvIsOpen_) {
    dbEnv_.close();
    dbEnvIsOpen_ = false;
    Second is a class which encapsulates a container with a method for querying itself
    package org.isha.archives.bdbxml;
    import java.io.*;
    import java.util.*;
    import com.sleepycat.db.*;
    import com.sleepycat.dbxml.*;
    //Class used to open, query and close a Berkeley DB container
    public class DbContainer
         private XmlContainer dbCont_ = null;
    private XmlManager mgr_ = null;
    private boolean dbContainerIsOpen_ = false;
    private File path2DbContainer_ = null;
    private XmlContainerConfig cfg_= null;
    private String cntr_ = "";
    public DbContainer(XmlManager myManager, String containerFileName, XmlContainerConfig containerConfig)
              throws Throwable {
              String containerFilepath = myManager.getHome() + "\\" + containerFileName;
              path2DbContainer_ = new File(containerFilepath);
              mgr_ = myManager;
              cfg_ = containerConfig;
              cntr_ = containerFileName;
              if (! path2DbContainer_.isFile()) {
                   throw new Exception(path2DbContainer_.getPath() +
                             " does not exist or is not a directory.");
              dbCont_ = new XmlContainer();
    //Return the XmlContainer itself
    public XmlContainer getContainer() { return dbCont_; }
    //Returns the filename of the container
         public String getFilename() { return cntr_; }
    //Returns the XmlManager encapsulated by this class.
    public XmlManager getManager() { return mgr_; }
    //Used to close the container
    public void close() throws DatabaseException
    if (dbContainerIsOpen_) {
    dbCont_.close();
    dbContainerIsOpen_ = false;
    //Used to open the container
    public void open() {
              try {
                   dbCont_ = mgr_.openContainer(cntr_, cfg_);
                   dbContainerIsOpen_ = true;
              catch (Exception e) {
    //Used to query the container
    public String[] runQuery(String myQuery){
              String [] queryOutput = null;
              int counter = 0;
              try {
                   XmlQueryContext context = mgr_.createQueryContext();
                   //Default namespace declaration does not work yet - this will work in the next release of BDB XML
                   //Until then we have to remove the namespace declaration from the reference.xml root element
                   //When this becomes available we can add the namespace declaration and uncomment the following line
                   //context.setNamespace("", defaultNS);
                   XmlResults results = mgr_.query(myQuery, context);
                   //Get the result set
                   queryOutput = new String[results.size()];
                   XmlValue value = results.next();
                   while (value != null)
                        queryOutput[counter] = value.asString().replaceAll("\\n", "").replaceAll(" "," ");
                        System.out.println(queryOutput[counter]);
                        counter ++;
                        value = results.next();
              catch (Exception e) {
                   //Exception Handling code here
              return queryOutput;
    Now to explain what is happening:
    When I open an xml document in xmlmind, it displays the document according to a prespecified CSS sheet. Sometimes the CSS rules alone are not sufficient to achieve the necessary effect/functionality, so the API allows you to write your own class, which contains methods to do what you want. As soon as the xml document is displayed, the CSS extension class gets instantiated.
    Here is my extension class (called StyleSheetExtension). It contains a method called getKeywords. This method can then be invoked from within the CSS sheet, and is used to replace the keyword ID codes in the xml document with their corresponding keyword names - stored in an xml reference look-up document...
    package org.isha.archives.xmlmind;
    import com.xmlmind.xmledit.xmlutil.*;
    import com.xmlmind.xmledit.doc.*;
    import com.xmlmind.xmledit.view.DocumentView;
    import com.xmlmind.xmledit.stylesheet.StyleValue;
    import com.xmlmind.xmledit.stylesheet.StyleSpec;
    import com.xmlmind.xmledit.stylesheet.StyleSpecsBase;
    import com.xmlmind.xmledit.styledview.StyledViewFactory;
    import com.xmlmind.xmledit.styledview.CustomViewManager;
    import com.sleepycat.dbxml.*;
    import com.sleepycat.db.*;
    import java.io.File;
    import java.util.logging.*;
    import java.util.*;
    import org.isha.archives.bdbxml.DbContainer;
    import org.isha.archives.bdbxml.DbEnv;
    public class StyleSheetExtension {
         //Logging variables
         private Logger logger = Logger.getLogger("StyleSheetExtension");
         private Handler fh = null;
         private java.util.logging.Formatter sf = null;
         //XMLMind variables
         private static final Namespace NS = Namespace.get("http://www.ishafoundation.org/archives/schema/transcript");
         //BDB variables
         private DbEnv myDbEnv = null;
         private File envDir = new File("C:\\BerkeleyDB");
         private DbContainer myDbContainer = null;
         private String containerFileName = "reference.dbxml";
         private XmlContainerConfig containerCfg = null;
         //Define Constructor
         public StyleSheetExtension(String[] args, StyledViewFactory viewFactory) {
    //Set up simple logging system
    try {
    fh = new FileHandler("%t/_styleSheetExtn.log");
    sf = new SimpleFormatter();
    fh.setFormatter(sf);
    logger.addHandler(fh);
    logger.setLevel(Level.ALL);
    logger.info("Starting StyleSheetExtension Class constructor");
    } catch (Exception e)
    {System.out.println("CustomErr: " + e.getMessage());
                    //Exception Handling code
    //Create custom BDB Environment and Container Objects
    try {
                        myDbEnv = new DbEnv(envDir);
                        containerCfg = new XmlContainerConfig();
                        myDbContainer = new DbContainer(myDbEnv.getManager(), containerFileName, containerCfg);
                        myDbContainer.open();
                   } catch (Throwable t) {
                        logger.severe("Problem with Env or Container new thing");
    viewFactory.addDependency( NS, "topic", NS, "keywordIDs");
         public StyleValue getKeywords (StyleValue[] args, Node contextNode,
                             StyledViewFactory viewFactory) {
    //Get keyword IDs as a String array
    String[] keywordID = null;
    String[] keywordValue = null;
    String keywordIDStr = "";
    String keywordValueStr ="";
    Name keywordIDs = Name.get("keywordIDs");
    keywordIDStr = contextNode.attributeValue(keywordIDs).trim();
    keywordID = keywordIDStr.split("\\s+");
    keywordValue = new String[keywordID.length];
    //for each keyword ID element retrieve the corresponding keyword value
    logger.info("getting values");
                   keywordValue = getKeywordValuesFromDB(keywordID);
                   Arrays.sort(keywordValue);
                   logger.info(keywordValue[0] + " " + keywordValue[1]);
                   int i = 0;
                   for(i=0; i < keywordID.length; i++) {
                        keywordValueStr += keywordValue[i] + " ";
                   keywordValueStr = keywordValueStr.trim();
              return StyleValue.createString(keywordValueStr);
    private String[] getKeywordValuesFromDB(String[] IDs){
                   String[] values = new String[IDs.length];
                   String id = "";
                   String value = "";
                   String flwor = "";
                   int i = 0;
                   for(i=0; i < IDs.length; i++) {
                        id = IDs.trim();
                        flwor = "for $i in collection('" + myDbContainer.getFilename() + "') /reference/keywords/keyword \n";
                        flwor += "let $id := $i/@id/text() \n";
                        flwor += "let $val := $i/@value/text() \n";
                        flwor += "where $id = '" + id + "'\n";
                        flwor += "return $val";
                        String[] temp = new String[1];
                        temp = myDbContainer.runQuery(flwor);
                        values[i] = temp[0];
                        logger.info("value is: " + values[i]);
                   return values;
    package org.isha.archives.xmlmind;
    import com.xmlmind.xmledit.xmlutil.*;
    import com.xmlmind.xmledit.doc.*;
    import com.xmlmind.xmledit.view.DocumentView;
    import com.xmlmind.xmledit.stylesheet.StyleValue;
    import com.xmlmind.xmledit.stylesheet.StyleSpec;
    import com.xmlmind.xmledit.stylesheet.StyleSpecsBase;
    import com.xmlmind.xmledit.styledview.StyledViewFactory;
    import com.xmlmind.xmledit.styledview.CustomViewManager;
    import com.sleepycat.dbxml.*;
    import com.sleepycat.db.*;
    import java.io.File;
    import java.util.logging.*;
    import java.util.*;
    import org.isha.archives.bdbxml.DbContainer;
    import org.isha.archives.bdbxml.DbEnv;
    public class StyleSheetExtension {
         //Logging variables
         private Logger logger = Logger.getLogger("StyleSheetExtension");
         private Handler fh = null;
         private java.util.logging.Formatter sf = null;
         //XMLMind variables
         private static final Namespace NS = Namespace.get("http://www.ishafoundation.org/archives/schema/transcript");
         //BDB variables
         private DbEnv myDbEnv = null;
         private File envDir = new File("C:\\BerkeleyDB");
         private DbContainer myDbContainer = null;
         private String containerFileName = "reference.dbxml";
         private XmlContainerConfig containerCfg = null;
         //Define Constructor
         public StyleSheetExtension(String[] args, StyledViewFactory viewFactory) {
    //Set up simple logging system
    try {
    fh = new FileHandler("%t/_styleSheetExtn.log");
    sf = new SimpleFormatter();
    fh.setFormatter(sf);
    logger.addHandler(fh);
    logger.setLevel(Level.ALL);
    logger.info("Starting StyleSheetExtension Class constructor");
    } catch (Exception e)
    {System.out.println("CustomErr: " + e.getMessage());
                    //Exception Handling code
    //Create custom BDB Environment and Container Objects
    try {
                        myDbEnv = new DbEnv(envDir);
                        containerCfg = new XmlContainerConfig();
                        myDbContainer = new DbContainer(myDbEnv.getManager(), containerFileName, containerCfg);
                        myDbContainer.open();
                   } catch (Throwable t) {
                        logger.severe("Problem with Env or Container new thing");
    viewFactory.addDependency( NS, "topic", NS, "keywordIDs");
         public StyleValue getKeywords (StyleValue[] args, Node contextNode,
                             StyledViewFactory viewFactory) {
    //Get keyword IDs as a String array
    String[] keywordID = null;
    String[] keywordValue = null;
    String keywordIDStr = "";
    String keywordValueStr ="";
    Name keywordIDs = Name.get("keywordIDs");
    keywordIDStr = contextNode.attributeValue(keywordIDs).trim();
    keywordID = keywordIDStr.split("\\s+");
    keywordValue = new String[keywordID.length];
    //for each keyword ID element retrieve the corresponding keyword value
    logger.info("getting values");
                   keywordValue = getKeywordValuesFromDB(keywordID);
                   Arrays.sort(keywordValue);
                   logger.info(keywordValue[0] + " " + keywordValue[1]);
                   int i = 0;
                   for(i=0; i < keywordID.length; i++) {
                        keywordValueStr += keywordValue[i] + " ";
                   keywordValueStr = keywordValueStr.trim();
              return StyleValue.createString(keywordValueStr);
    private String[] getKeywordValuesFromDB(String[] IDs){
                   String[] values = new String[IDs.length];
                   String id = "";
                   String value = "";
                   String flwor = "";
                   int i = 0;
                   for(i=0; i < IDs.length; i++) {
                        id = IDs[i].trim();
                        flwor = "for $i in collection('" + myDbContainer.getFilename() + "') /reference/keywords/keyword \n";
                        flwor += "let $id := $i/@id/text() \n";
                        flwor += "let $val := $i/@value/text() \n";
                        flwor += "where $id = '" + id + "'\n";
                        flwor += "return $val";
                        String[] temp = new String[1];
                        temp = myDbContainer.runQuery(flwor);
                        values[i] = temp[0];
                        logger.info("value is: " + values[i]);
                   return values;
    This instance (and consequently the newly created env and container objects) stay alive until the document is closed.
    The xmlmind API also allows you to specify custom classes that will return a component that can be embedded in the stylesheet. (My class returns a JButton which - when clicked - brings up a dialog box which allows the user to specify /modify/addnew keywords to the selected text). As soon as the button is pressed I create a new env and container instance, for the duration of the pop-up window (since I have no way to pass the reference to the existing environment created by the StyleSheetExtension class.
    Here's the class defn: (Here goes!) The env and container stuff is at the start of the nested-nested class called KpForm.
    package org.isha.archives.xmlmind;
    import com.sleepycat.dbxml.*;
    import com.sleepycat.db.*;
    import java.awt.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.text.AttributeSet;
    import javax.swing.text.AbstractDocument;
    import javax.swing.text.DocumentFilter;
    import javax.swing.text.BadLocationException;
    import javax.swing.event.*;
    import javax.swing.text.DocumentFilter.FilterBypass;
    import java.util.*;
    import java.util.regex.*;
    import java.lang.*;
    import com.xmlmind.xmledit.xmlutil.*;
    import com.xmlmind.xmledit.doc.Element;
    import com.xmlmind.xmledit.edit.*;
    import com.xmlmind.xmledit.stylesheet.*;
    import com.xmlmind.xmledit.styledgadget.*;
    import com.xmlmind.xmledit.styledview.*;
    import com.xmlmind.xmledit.doc.*;
    import java.util.logging.*;
    import org.isha.archives.bdbxml.DbEnv;
    import org.isha.archives.bdbxml.DbContainer;
    public class OpenKeywordPicker implements ComponentFactory {
    public Component createComponent(Element element,
    Style style, StyleValue[] parameters,
    StyledViewFactory viewFactory,
    boolean[] stretch){
    KeywordEdit topic = new KeywordEdit();
    return topic;
         private class KeywordEdit extends JButton {
              //private Element element;
              public KeywordEdit()
                   super.setText("Edit");
                   super.addMouseListener(new java.awt.event.MouseAdapter() {
                                  public void mouseClicked(java.awt.event.MouseEvent evt) {
                                       myJButtonMouseClicked(evt);
              private void myJButtonMouseClicked(java.awt.event.MouseEvent evt) {
                        KpForm myForm = new KpForm();
                        myForm.setVisible(true);
    private class KpForm extends javax.swing.JFrame {
         // Variables declaration - do not modify
         private javax.swing.JButton jButton1;
         private javax.swing.JButton jButton2;
         private javax.swing.JButton jButton3;
         private javax.swing.JButton jButton4;
         private javax.swing.JButton jButton5;
         private javax.swing.JButton jButton6;
         private javax.swing.JLabel jLabel1;
         private javax.swing.JLabel jLabel2;
         private javax.swing.JLabel jLabel3;
         private javax.swing.JLabel jLabel4;
         private javax.swing.JLabel jLabel5;
         private javax.swing.JList jList1;
         private javax.swing.JList jList2;
         private javax.swing.JList jList3;
         private javax.swing.JScrollPane jScrollPane1;
         private javax.swing.JScrollPane jScrollPane2;
         private javax.swing.JScrollPane jScrollPane3;
         private javax.swing.JScrollPane jScrollPane4;
         private javax.swing.JTextArea jTextArea1;
         private javax.swing.JTextField jTextField1;
         private DefaultListModel model_1 = new DefaultListModel();
              private DefaultListModel model_2 = new DefaultListModel();
              private DefaultListModel model_3 = new DefaultListModel();
              private javax.swing.JOptionPane jOptionPane1;
              //private KeywordFilter filter_1 = new KeywordFilter();
              //BDB variables
              private DbEnv myDbEnv = null;
              private File envDir = new File("C:\\BerkeleyDB");
              private DbContainer myDbContainer = null;
              private String containerFileName = "reference.dbxml";
              private XmlContainerConfig containerCfg = null;
              private Logger logger = Logger.getLogger("OpenKeywordPicker.KeywordEdit.KpForm");
              private Handler fh = null;
              private java.util.logging.Formatter sf = null;
    // End of variables declaration
         /** Creates new form kpForm */
         public KpForm() {
                   super();
         initComponents();
         customInit();
              private void customInit(){
                        //Set up simple logging system
                   try {
                        fh = new FileHandler("%t/_keywordPicker.log");
                        sf = new SimpleFormatter();
                        fh.setFormatter(sf);
                        logger.addHandler(fh);
                        logger.setLevel(Level.ALL);
                        logger.info("Starting Custom initialization");
                   } catch (Exception e) {System.out.println("CustomErr: " + e.getMessage());
                              //Exception Handling code
                        //Create custom BDB Environment and Container Objects
                        try {
                             logger.info("0");
                             myDbEnv = new DbEnv(envDir);
                             logger.info("1");
                             containerCfg = new XmlContainerConfig();
                             logger.info("2");
                             myDbContainer = new DbContainer(myDbEnv.getManager(), containerFileName, containerCfg);
                             logger.info("3");
                             myDbContainer.open();
                        } catch (Throwable t) {
                             logger.severe("Problem with Env or Container new thing - Component: "+ t.getMessage());
              String[] dbIDKeywords;
              jList1.setModel(model_1);
              jList2.setModel(model_2);
              jList3.setModel(model_3);
              dbIDKeywords = getKeywordsFromDB();
              int i=0;
              for(i=0; i < dbIDKeywords.length; i+=2){
              model_1.addElement(new keywordOb(dbIDKeywords[i], dbIDKeywords[i+1]));
              jList1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              jList2.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              jList3.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              //Setup Document Filter for TextField component
              AbstractDocument doc;
              doc = (AbstractDocument)(jTextField1.getDocument());
              doc.setDocumentFilter(filter_1);
              //Setup Document Listener for TextField component
              jTextField1.getDocument().addDocumentListener(new DocumentListener(){
              public void insertUpdate(DocumentEvent e) {
              String val = jTextField1.getText();
              if(val != null & val.trim() != ""){
              jButton1.setEnabled(true);
              else {
              jButton1.setEnabled(false);
              public void removeUpdate(DocumentEvent e) {
              String val = jTextField1.getText();
              if(val != null & !val.trim().equals("")){
              jButton1.setEnabled(true);
              else {
              jButton1.setEnabled(false);
              public void changedUpdate(DocumentEvent e) {
              //Plain text components do not fire these events
              private String[] getKeywordsFromDB(){
              String[] k = null;
              String flwor = "";
              flwor = "for $i in collection('" + containerFileName + "') /reference/keywords/keyword \n";
              flwor += "let $id := $i/@id/text() \n";
              flwor += "let $val := $i/@value/text() \n";
              flwor += "order by $val ascending \n";
              flwor += "return ($id, $val)";
              return k = myDbContainer.runQuery(flwor);
              private class keywordOb implements Comparable{
              private String id;
              private String value;
              public keywordOb(String id, String value){
              this.id = id;
              this.value = value;
              public String getId(){
              return id;
              public String getValue(){
              return value;
              public String toString(){
              return value;
              public int compareTo(Object o){
                                  int result = (((keywordOb)this).toString()).compareTo(((keywordOb)o).toString());
                                  return result;
              private class questionOb implements Comparable{
              private String id;
              private String value;
              private String[] keywordRefs;
              public questionOb(String id, String value, String[] keywordRefs){
              this.id = id;
              this.value = value;
              this.keywordRefs = keywordRefs;
              public questionOb(){
              this.id = "";
              this.value = "";
              this.keywordRefs = null;
              public String getId(){
              return id;
              public String getValue(){
              return value;
              public String toString(){
              return value;
              public String[] getKeywordRefs(){
              return keywordRefs;
              public void setId(String id){
              this.id = id;
              public void setValue(String value){
              this.value = value;
              public void setKeywordRefs(String[] keywords){
              this.keywordRefs = keywordRefs;
              public int compareTo(Object o){
                             int result = (((questionOb)this).toString()).compareTo(((questionOb)o).toString());
                             return result;
              //Add New Keyword to xml reference File
              private void addNewKeyword(String k){
              String keyword = k;
              int len = jTextField1.getDocument().getLength();
              //Tidy up string
              keyword = keyword.trim();
              keyword = keyword.replaceAll("\\s+"," ");
              keyword = capitalizeWords(keyword);
              String flwor = "";
              //Check that the keyword value doesn't already exist
              flwor = "let $i := collection('" + containerFileName + "')/reference/keywords/keyword[@value = '" + keyword + "'] \n";
              flwor += "return \n";
              flwor += "if(count($i)) then fn:true() \n";
              flwor += "else fn:false() \n";
              boolean keywordExists = bDbConnection.runBooleanQuery(flwor);
              if (keywordExists){
              jOptionPane1.showMessageDialog(new Frame(),
              "The keyword '" + keyword + "' already exists", "Message", jOptionPane1.INFORMATION_MESSAGE);
              try {
              jTextField1.getDocument().remove(0,len);
              } catch (Exception ex) {
              ex.printStackTrace();
              //Terminate method execution
              return;
              //Need to get ID of last keyword
              flwor = "for $i in collection('" + containerFileName + "')/reference/keywords/keyword/@id/text() \n";
              flwor += "order by $i descending \n";
              flwor += "return $i[fn:last()]";
              String[] lastIDArray = new String[1];
              lastIDArray = bDbConnection.runQuery(flwor);
              String lastIDStr = lastIDArray[0];
              //create incremented ID value
              //Note: XML ID attributes must start with a letter - that's why we need to do all this nonsense!
              int lastIDNum = new Integer(lastIDStr.substring(1));
              int nextIDNum = ++lastIDNum;
              String nextIDStr = String.format("%04d", nextIDNum);
              nextIDStr = "K" + nextIDStr;
              //OK Finally - actually add the keyword to the xml reference file
              //use BDB API for updating - since XQuery does not allow
              try
              XmlQueryContext qc = myManager.createQueryContext();
              XmlUpdateContext uc = myManager.createUpdateContext();
              XmlModify mod = myManager.createModify();
              XmlQueryExpression select = myManager.prepare("/reference/keywords", qc);
              mod.addAppendStep(select, XmlModify.Element, "keyword", "");
              select = myManager.prepare("/reference/keywords/keyword[fn:last()]", qc);
              mod.addAppendStep(select, XmlModify.Attribute, "id", nextIDStr);
              mod.addAppendStep(select, XmlModify.Attribute, "value", keyword);
              XmlDocument updateDoc = myContainer.getDocument(docName);
              XmlValue docValue = new XmlValue(updateDoc);
              mod.execute(docValue, qc, uc);
              catch(Exception e){
              System.out.println("Error adding keyword: " + e.getMessage());
              //Add the new keyword to the list of selected keywords
              model_2.addElement(keyword);
              sortModelElements(model_2);
              try {
              jTextField1.getDocument().remove(0,len);
              } catch (Exception ex) {
              ex.printStackTrace();
              private questionOb[] getQuestionsFromDB(keywordOb[] keywordIDs){
              questionOb[] qobs = null;
              String seq = "";
              String flwor = "";
              int num = 0;
              seq = keywordObsToSeq(keywordIDs);
              flwor = "for $i in " + seq + "\n";
              flwor += "let $q := collection('" + containerFileName + "') /reference/questions/question[./keywordRef/@idref/text() = $i] \n";
              flwor += "return $q";
              try
              XmlQueryContext context = myManager.createQueryContext();
              context.setEvaluationType(XmlQueryContext.Eager);
              context.setReturnType(XmlQueryContext.DeadValues);
              XmlResults results = myManager.query(flwor, context);
              // Report Query Info
              String message = "Found ";
              message += results.size() + " entries for query: '";
              message += flwor + "'\n";
              System.out.println(message);
              int numQuestions;
              numQuestions = results.size();
              qobs = new questionOb[numQuestions];
              String[] keyRefs = new String[1];
              String[] keyRefs2 = new String[1];
              XmlResults atts, atts2 = null;
              XmlValue keyRefElem, keyRefAtt = null;
              int i;
              for(i=0; i < numQuestions; i++){
              XmlValue val = results.next();
              atts = val.getAttributes();
              String id = atts.next().getNodeValue();
              String value = atts.next().getNodeValue();
              keyRefElem = val.getFirstChild();
              int j=0;
              while (!keyRefElem.isType(XmlValue.NONE)){
              if(keyRefElem.getType() == XmlValue.TEXT_NODE){
              keyRefElem = keyRefElem.getNextSibling();
              if(keyRefElem.isType(XmlValue.NONE)){
              break;
              System.out.println("1");
              atts2 = keyRefElem.getAttributes();
              System.out.println("2");
              keyRefs[j] = atts2.next().getNodeValue();
              System.out.println("3" + keyRefs[j]);
              System.arraycopy(keyRefs,0,keyRefs2,0,j+1);
              System.out.println("4");
              keyRefs = new String[j+2];
              System.out.println("5");
              System.arraycopy(keyRefs2,0,keyRefs,0,j+1);
              System.out.println("6");
              keyRefs2 = new String[j+2];
              System.out.println("7");
              keyRefElem = keyRefElem.getNextSibling();
              System.out.println("8");
              j++;
              System.out.println(keyRefs[0]+keyRefs[1]);
              //Create new Question Object with retrieved values
              System.out.println("bef");
              questionOb qo = new questionOb(id, value, keyRefs);
              System.out.println("aft");
              qobs[i] = qo;
                        catch(Exception e)
              System.out.println("XML Exception is "+ e.getMessage());
              return qobs;
              private void sortModelElements(DefaultListModel model){
              //Getting the size of the model
              int size = model.getSize();
              //Creating the keyword object based on the size of the model
              keywordOb[] word = new keywordOb[size];
              int i=0;
              //keywordOb j;
              for(i=0; i < size; i++){
              word[i] = (keywordOb) model.getElementAt(i);
              Arrays.sort(word);
              for(i=0; i < size; i++){
              //model.setElementAt(word[i], i);
              model.set(i,word[i]);
              public void messageBox(String message)
              jOptionPane1.showMessageDialog(new Frame(), message , "Message", jOptionPane1.INFORMATION_MESSAGE);
              class KeywordFilter extends DocumentFilter {
              public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr)
              throws BadLocationException {
              int len = fb.getDocument().getLength();
              if(len==0 & noFunnyChars(string) & !string.trim().equals("")){
              fb.insertString(offset, string, attr);
              if(len > 0 & noFunnyChars(string) & len < 30){
              fb.insertString(offset, string, attr);
              public void replace(FilterBypass fb, int offset, int length, String string, AttributeSet attr)
              throws BadLocationException {
              int len = fb.getDocument().getLength();
              if(len==0 & noFunnyChars(string) & !string.trim().equals("")){
              fb.replace(offset, length, string, attr);
              if(len > 0 & noFunnyChars(string) & len < 30){
              fb.insertString(offset, string, attr);
              private boolean noFunnyChars(String s){
              String regex = "[A-Za-z\\s]+";
              boolean b = Pattern.matches(regex, s);
              return b;
              private String capitalizeWords(String s){
              String s2;
              char[] c = s.toCharArray();
              int i = 0;
              c[0] = Character.toUpperCase(c[0]);
              for(i=0; i < c.length; i++){
              if (!Character.isLetter(c[i])){
              c[i+1] = Character.toUpperCase(c[i+1]);
              s2 = String.valueOf(c);
              return s2;
              private String keywordObsToSeq(keywordOb[] a) {
              StringBuffer result = new StringBuffer();
              String resultStr = "";
              result.append("('" + a[0].getId() + "', ");
              for (int i=1; i < a.length; i++) {
              result.append("'" + a[i].getId() + "', ");
              resultStr = result.toString();
              resultStr = resultStr.trim();
              resultStr = resultStr.substring(0,resultStr.length()-1) + ")";
              return resultStr;
         // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
              private void initComponents() {
              jScrollPane1 = new javax.swing.JScrollPane();
              jList1 = new javax.swing.JList();
              jScrollPane2 = new javax.swing.JScrollPane();
              jList2 = new javax.swing.JList();
              jLabel1 = new javax.swing.JLabel();
              jLabel2 = new javax.swing.JLabel();
              jLabel3 = new javax.swing.JLabel();
              jTextField1 = new javax.swing.JTextField();
              jButton1 = new javax.swing.JButton();
              jButton2 = new javax.swing.JButton();
              jButton3 = new javax.swing.JButton();
              jScrollPane3 = new javax.swing.JScrollPane();
              jList3 = new javax.swing.JList();
              jLabel4 = new javax.swing.JLabel();
              jButton4 = new javax.swing.JButton();
              jButton5 = new javax.swing.JButton();
              jLabel5 = new javax.swing.JLabel();
              jScrollPane4 = new javax.swing.JScrollPane();
              jTextArea1 = new javax.swing.JTextArea();
              jButton6 = new javax.swing.JButton();
              setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
              jList1.addMouseListener(new java.awt.event.MouseAdapter() {
              public void mouseClicked(java.awt.event.MouseEvent evt) {
              jList1MouseClicked(evt);
              jScrollPane1.setViewportView(jList1);
              jList2.addMouseListener(new java.awt.event.MouseAdapter() {
              public void mouseClicked(java.awt.event.MouseEvent evt) {
              jList2MouseClicked(evt);
              jScrollPane2.setViewportView(jList2);
              jLabel1.setText("Available Keywords");
              jLabel2.setText("Selected Keywords");
              jLabel3.setText("Add New Keyword");
              jTextField1.setFont(new java.awt.Font("Tahoma", 0, 12));
              jTextField1.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
              jTextField1ActionPerformed(evt);
              jButton1.setText("Add Keyword");
              jButton1.setEnabled(false);
              jButton1.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
              jButton1ActionPerformed(evt);
              jButton2.setText("Modify Keyword");
              jButton3.setText("Remove Keyword");
              jList3.setModel(new javax.swing.AbstractListModel() {
              String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
              public int getSize() { return strings.length; }
              public Object getElementAt(int i) { return strings[i]; }
              jScrollPane3.setViewportView(jList3);
              jLabel4.setText("Questions");
              jButton4.setText("OK");
              jButton4.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
              jButton4ActionPerformed(evt);
              jButton5.setText("Cancel");
              jLabel5.setText("Add New Question");
              jTextArea1.setColumns(20);
              jTextArea1.setRows(2);
              jScrollPane4.setViewportView(jTextArea1);
              jButton6.setText("Add Question");
              javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
              getContentPane().setLayout(layout);
              layout.setHorizontalGroup(
              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
              .addContainerGap(488, Short.MAX_VALUE)
              .addComponent(jButton5)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
              .addGap(29, 29, 29))
              .addGroup(layout.createSequentialGroup()
              .addGap(38, 38, 38)
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(layout.createSequentialGroup()
              .addComponent(jButton6)
              .addContainerGap())
              .addGroup(layout.createSequentialGroup()
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
              .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 559, Short.MAX_VALUE)
              .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
              .addComponent(jLabel5)
              .addComponent(jLabel4)
              .addGroup(layout.createSequentialGroup()
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel1)
              .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE))
              .addGap(31, 31, 31)
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel2)
              .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE))
              .addGap(32, 32, 32)
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
              .addComponent(jLabel3)
              .addComponent(jButton1)
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
              .addComponent(jButton2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
              .addComponent(jButton3, javax.swing.GroupLayout.Alignment.LEADING))))
              .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 559, Short.MAX_VALUE)))
              .addContainerGap(58, Short.MAX_VALUE))))
              layout.setVerticalGroup(
              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(layout.createSequentialGroup()
              .addGap(24, 24, 24)
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
              .addGroup(layout.createSequentialGroup()
              .addComponent(jLabel1)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE))
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
              .addGroup(layout.createSequentialGroup()
              .addComponent(jLabel2)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE))
              .addGroup(layout.createSequentialGroup()
              .addComponent(jLabel3)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jButton1)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
              .addComponent(jButton2)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jButton3))))
              .addGap(29, 29, 29)
              .addComponent(jLabel4)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)
              .addGap(20, 20, 20)
              .addComponent(jLabel5)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jButton6)
              .addGap(31, 31, 31)
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
              .addComponent(jButton4)
              .addComponent(jButton5))
              .addGap(21, 21, 21))
              pack();
    }// </editor-fold>
              //Event handlers
              private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
              // TODO add your handling code here:
                        try {
                             myDbContainer.close();
                             myDbEnv.cleanup();
                        } catch (Exception e) {
                             logger.info("Could not close container/or env - Component");
                        super.setVisible(false);
                        super.dispose();
                   private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
              // TODO add your handling code here:
                        String val;
                        val = jTextField1.getText();
                        if(val != null & val.trim() != "" & noFunnyChars(val) ){
                             jButton1.setEnabled(true);
                        else {
                             jButton1.setEnabled(false);
                   private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
              // TODO add your handling code here:
                   // Add new keyword to the xml reference file
                        //addNewKeyword(jTextField1.getText());
                   private void jList2MouseClicked(java.awt.event.MouseEvent evt) {
              // TODO add your handling code here:
                        if(evt.getClickCount() == 2) {
                             keywordOb k = (keywordOb)jList2.getSelectedValue();
                             model_2.removeElement(k);
                             model_1.addElement(k);
                             sortModelElements(model_1);
                             questionOb q = null;
                             //Remove associated questions from listbox
                             int i,j;
                             for(i=0; i < model_3.size(); i++){
                                  q = (questionOb)model_3.getElementAt(i);
                                  for(j=0; j < model_3.size(); j++){
                                       if (q.getKeywordRefs()[j].equals(k.getId())){
                                            model_3.removeElement(q);
                                            i--;
                                            break;
                   private void jList1MouseClicked(java.awt.event.MouseEvent evt) {
              // TODO add your handling code here:
                   if(evt.getClickCount() == 2) {
                             //Getting properties of the selecteditem item in jList1.
                        keywordOb k = (keywordOb)jList1.getSelectedValue();
                        //Removing the element from jList1
                        model_1.removeElement(k);
                        //Adding the element to jList2
                        model_2.addElement(k);
                        sortModelElements(model_2);
                        //Load the questions for the selected keywords
                        int len;
                        len = model_2.getSize();
                        keywordOb[] dbQuestionsOb = new keywordOb[5];
                        keywordOb[] selectedKeywordsOb = new keywordOb[len];
                        String[] selectedKeywordIDs = new String[len];
                        int i;
                        for(i=0; i < len; i++) {
                             selectedKeywordsOb[i] = (keywordOb)model_2.getElementAt(i);
                             selectedKeywordIDs[i] = selectedKeywordsOb[i].getId();
                        questionOb[] questionsOb = getQuestionsFromDB(selectedKeywordsOb);
                        model_3.removeAllElements();
                        for(i=0; i < questionsOb.length; i++){
                             model_3.addElement(questionsOb[i]);
                        // sortModelElements(model_3);
    I think thats too much code for one post!

  • Insert PDF Into 2013 Word Doc. Message There was an error opening this Doc This file cannot be found

    To All,
    I recently purchased a brand new Dell Laptop Inspiron 5521 Windows 7 Home Premium with purchase of Microsoft Office 2013 and already preinstalled Adobe Reader X. When trying to insert object being a saved pdf documentinto Word Doc., I keep receiving the following message: [There was an error opening this document. This file cannot be found.] Why?

    I don't know but I wouldn't expect it to work anyway. What do you expect to happen?

Maybe you are looking for