Can I create a JTA EntityManagerFactory in a utility class in a .jar file?

I have utility classes in a .jar file inside of a .war file deployed in Glassfish 3.1. One of these utility classes, CredentialsUtil, needs to access a database. I can't inject an EntityManager into CredentialsUtil since it is not an EJB. (For security reasons I don't want to make CredentialsUtil an EJB. I want it to be a POJO.)
In CredentialsUtil I need an EntityManagerFactory that is connected to a datasource defined in Glassfish. Here is the line from CredentialsUtil.java and from the persistence.xml both of which will be in the util.jar file:
EntityManagerFactory emf = Persistence.createEntityManagerFactory("Credpu");
<persistence-unit name="Credpu" transaction-type="JTA">
I can't use RESOURCE_LOCAL since any changes to the datasource configuration must be done in Glassfish rather than changing persistence.xml.
(The transaction context is not important in CredentialsUtil. It will be called by a WS-Security handler which may not have a transaction context.)
Can I put the persistence.xml and the CredentialsUtil class that creates the EntityManagerFactory from it inside of the util.jar file (which will be in a .war), or do I have to move the class and a copy of the persistence.xml file out to the .war file? (I'll have to leave persistence.xml in the .jar file too since there are some @Entity in the .jar file. I don't know why but there are @Entity pojos in the .jar file.)
I'd like to use the existing persistence.xml, but if I can't is there is a way to create an EntityManagerFactory (or EntityManager) that gets its datasource directly from Glassfish, ignoring persistence.xml?
Thanks.

Styles in Pages are saved in the documents (or templates). There is no easy method for adding a style to a built-in template (and it is strongly recommended that you do not tamper with them). You can open a built- in template, add your style and save it as a user template so that your new style will be standard in documents created from that template.

Similar Messages

  • Can't create a new illustration. Problems occurred while saving the print file.

    I can't open a new Illustrator file. It sends me this error: Can't create a new illustration. Problems occurred while saving the print file. ID:-1
    I opened a previous document created in CC, but it will not allow me to copy and paste items from one doc to another.
    I have rebooted with no avail.
    System:
    Adobe Creative Cloud CC
    Mac Book Pro 2012
    2.6 GHz Intel Core i7
    8 GB 1600 MHz DDR3

    Is a printer connected? Is it turned ON? Is the driver up to date?
    Illustrator checks this every time and also writes information on the printer into the file.

  • After downloading 4.0 I get this message: JavaScript application can't create mcafee plug-in object: TypeError: components.classes[cid] is undefined

    I finished downloading Firefox 4.o to my Mac OS.X.
    When I try to open a website I get the message:
    [JavaScript Application] can't create mcafee plug-in object: TypeError: Components.classes[cid] is undefined
    If I click the OK button, the site opens, but without the McAfee alert at the bottom of the window.
    I had just downloaded 3.6.16, and got box suggesting download version 4.0 for better security, but that seems to be where the problem is!

    That indicates that an add-on you are using is not compatible, considering the other errors it is possibly the McAfee add-on. To confirm what add-on is causing this use the procedure in this link - https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Can't create mcafee plug-in object: TypeError: Components.classes[cid] is undefined

    I updated to Firefox 4.0 and ever since then, I get this message when I try to open Firefox:
    can't create mcafee plug-in object: TypeError: Components.classes[cid] is undefined
    I have a Mac and have McAfee protection for Mac. This problem did not happen before I updated Firefox. Once I click on "OK" Firefox opens.

    This issue is most likely caused by a McAfee extension that isn't working properly and you will have to disable the extension that causes it.
    You can also check if there is an update available from McAfee that fixes this problem.

  • The following error message came when I tried to open Firefox and install Firefox Home. "can't create mcafee plug-in object: TypeError: Components.classes[cid] is undefined"

    The following error message came when I tried to open Firefox and install Firefox Home.
    "can't create mcafee plug-in object: TypeError: Components.classes[cid] is undefined"

    This issue can be caused by an extension or plugin that isn't working properly.
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]

  • Can I create the object of an protected inner class of a Base class in to t

    Dear All,
    Can I create the object of an protected inner class of a Base class in to the subclass ?
    e.g.
    public class Base{
         protected class Inner {};
    Public class Sub extends Base{
         Public Inner amethod (){
              Return new Inner(); //here I get an exception as
                                //Inner has protected access
    }Regards,
    Ishan

    @Op. The code that you posted isn't close to compiling. Java is case sensitive. It should be public and not Public, and return instead of Return.
    Kaj

  • I got 3.95GB available on my flash drive and need 4GB to reinstall lion osx how can i create space on usb using Disk Utility ??!

    I got 3.95GB available on my flash drive and need 4GB to reinstall lion osx how can i create space on usb using Disk Utility ??!

    What is the capacity of the flash drive?
    You might also be able to reinstall Lion without a flash drive, by booting up the computer holding the Command + R keys, and choosing Reinstall OS X.

  • To create a desktop shortcut icon for the application for a jar file

    Hi
    I have created a jar file for my application. when i double click this jar file, the application opens.
    What i want is--
    Instead of user clicking on the jar file, my application also has to create a desktop shortcut icon.
    If the user clicks on the icon which is on the desktop the application should open.
    Please suggest me.
    Thanks in advance.

    >
    Please suggest me.>Launch the application using java webstart. A webstart launch offers things like a splash screen, automatic updates, and desktop integration in the form of desktop shortcuts and program menu items. If the launch file specifies icons, they are used for the shortcuts, otherwise a generic icon is used.
    For a comparison between a sandboxed webstart launch and a plain app., try the [Text Width Checker|http://pscode.org/twc/].
    While the TWC can run OK within the security sandbox, many applications need to be digitally signed and request extended permissions, to do what they need to do.
    STBC is an all-permissions webstart launch.
    Edit 1:
    And for one that definitely suggests desktop shortcuts (I usually avoid them, in favor of a menu item only), try the sandboxed [demo of the PrintService|http://pscode.org/jws/api.html#prs], which prompts the user to choose.
    Edited by: AndrewThompson64 on Sep 2, 2008 10:49 PM

  • Can I create a custom table of contents and link to other .pdf files based on responses to a form?

    Hey Everyone! First post ever, so bear with me:
    I'm trying to create a streamlined method to use a form  to let myself and others add information and select certain options to put together a custom table of contents. Basically, I would like to have a form with a series of text fill and single/multiple choice options that will automatically populate a table of contents based on the selections and will link to other .pdf files that are associated with the selections. I was hoping this would be possible with a form, but I'm relatively new to the function of the software as a whole and my research came up short. Any suggestions on how to start are more than welcome, and if I wasn't quite clear enough I would be happy to elaborate.
    Thanks for your time!

    You would need to search for other PDF creation software that can accomplish what you desire.
    There are many cheaper  PDF creation alternatives other than Adobe's Acrobat Pro software.
    Also, try doing a web search under these terms to see if you can find an app/software/solution that may work for you.
    How to create table of contents in PDF files

  • Can I create more than one URL link in a single Flash (SWF) file?

    I created a simple SWF slideshow in Flash with 5 slides. I was able to link one URL to the whole file by adding an alpha button.
    What I can't figure out is how to add a URL link to each slide. The SWF file i sused on a website and I would like to be able to click on a particular slide as it is playing to go the a site or page that applies to that slide.
    Is there a way or code I can use to do this??
    This is the code I am currently using for the button now.
    ja_btn.addEventListener(MouseEvent.CLICK,mouseClick);
    function mouseClick(event:MouseEvent):void
                   var request = new URLRequest("http://www.jakeandamos.com/");
                    navigateToURL (request,"_blank");
    I am just learning this stuff so I can use your help, Thanks!

    You cannot duplicate instance names or function names, so you'll need to create unique names for each one that behaves differently.  So you can only have one function named "mouseClick"... if you want to have another function to link somewhere else you need to create a new name for that function ("mouseClick2" would work)
    There are alternate approaches, but for now this will be the easiest for you to deal with.

  • Can't create a 3rd partition in Disk Utility

    Long story short I have used Boot Camp to get Windows, so I have 2 partitions. But, I need to create another partition to install another copy of Windows on it, but Disk Utility has grayed out the '+' to allow me to create a new partition. All I can do is delete the 'BOOTCAMP' partition which I don't want to do. I tried another way by going into Boot Camp Assistant and installing Windows through there. I have a bootable USB drive and I know how to install it, all that's stopping me is the partition issue.
    Any ideas?
    If it helps, I'm using a Late 2013 MacBook Pro with a 15" Retina Display, 2.5 GHz, 512 GB SSD, 16 GB RAM and a NVIDIA GT 750 M.
    Thank you for your help

    Good thing to mention that, I forgot to do that.
    Unfortunately it did not help.. The screen to remove the existing Boot Camp partition does not pop up, it just tries to create the new Boot Camp partition.
    The partition I'm trying to create it 150GB. The 50GB mentioned above was on the stock Fujitsu 250GB disk.
    Edit:
    I'm actually trying to avoid using Boot Camp Assistant.. I became to dislike the utility due to problems creating a partition on my previous HD.
    I would like to create a partition using Disk Utility and then install Windows 7 by selecting that DVD to boot from.
    Thank you for the tip though, I'll post it there as well!

  • Can I create a fillable PDF that allows the user to attach a file to the submitted form?

    There are suggestions in the Help documentation and on this site that indicate it is possible to attach files to a fillable PDF form that is being submitted. But I do not see any instructions for adding this functionality to a form. I am using Acrobat 9 Pro to create my form. I have a Submit button with an Action/Menu Item/Submit a form option, and the URL link for the submission is a local coldfusion file with a #FDF suffix. The export format is HTML. The form also contains a hidden EMAILTO field, with an Options/DefaultValue option identifying the recipient's email address. (I'm guessing the local cfm file uses this field.) There is also a hidden URL field in the form, and its Options/DefaultValue specifies the URL of the fillable form itself. (Perhaps the local cfm file uses this field too.)
    How can I add functionality to this form, using Adobe/PDF, to allow the user who submits the form to attach a file to the submission?

    You have to first configure a text field so it can be used for file selection. You do this on the Options tab of the field properties dialog. In order to select the corresponding check box, make sure only the "Scroll long text" option is selected.
    You then can set up a button that has the following JavaScript attached to the Mouse Up event:
    // Mouse Up script for button
    getField("upload_text_field").browseForFileToSubmit();
    Replace "upload_text_field" with the actual name of the file selection text field.

  • Can I create a link in a text cell that will open another file?

    I am creating a template in Numbers that I can use to log meeting session data, such as length, date, notes of the meeting content, action items and then also have a field (cell) for links to outside documents relevant to the meeting or client.  I see how I can create a link to a webpage or an email, but not to another file on my hard drive, so that when I am in the file and reviewing notes, I can just click to open the items being referred to.
    Does that make sense?
    Thanks,
    Cliff

    Well, if you specifically know the name of the application in question and how it accepts parameters, you can try using Runtime.exec()
    If you're willing to sacrifice platform independence (which it sounds like you are, since you specifically mentioned Explorer), you can try using the NTVDM "call" command, which taps into the file associations in the registry and launches the appropriate application.
    I guess it would depend on the exact functionality you want. :)

  • Can I create many short rough cuts from one large vob or mts file?

    If so, how?  I am new to editing and using CS6 Premier Pro and Prelude.

    As JStrawn points out, Importing the full Clip into the Project, but only using what you need from it, where you need it, has no drawbacks. The actual AV file is NOT physically input to the program, in any way. What happens with an Import, in very simple terms, is that PrPro links to that file, where it resides on your system, when you do the Import. There is only a link to that AV file, and that is written into the PRPROJ (the Project file) file in XML language. The file stays where it was, and only a line, or two of code is written. That is why a PRPROJ file is so small, compared to a media file - it's only lines of code, and contains zero media. Even Titles, which ARE included in the PRPROJ file, are but instructions, until one Exports.
    The three methods mentioned above are really quite similar, but just reflect a slightly different workflow. I like the Source Monitor and setting the In & Out Points, then just dragging (I guess I mouse more than use keyboard shortcuts) an Instance of that file, now Trimmed, onto my Timeline. There are a few times, when I do use the Razor, but not that often. I seldom use the Trim Monitor w/ it's keyboard shortcuts, but many could not live without that - personal choices.
    What one sees on the Timeline are representations of the various segments of that original longer Clip. But they are basically for display - to give the editor a visual to work with. Those Clip Instances do not yet really exist, and are only XML instructions. When one goes to Export the Timeline, PrPro reads those instructions, follows the link to that original file, and extracts the data that it is instructed to use, and essentially copies just THAT data to the new file, that PrPro is outputting. It is at that point, that something new exists, created from the chosen data in that original file, processed through the instructions written to the PRPROJ file.
    Now, there ARE some times, where one would want to create Sub-Clips, or even Export the Trimmed Clips as separate, discrete files, but from what I gather, you do not have a need for that, so you can save yourself a couple of steps.
    One possible use would be if one is hardpressed for HDD space, and they wished to actually cut up the long file, Export to individual files, and then Delete that original file. However, and even there, one could use the above techniques to edit the long file, and Export that edited version as a separate file, then Deleting that original longer file. Caveat - if one does that, then that Project is basically "done," as the Imported media file, the original long one, would no longer exist, as it has been Deleted.
    Good luck, and hope this helps,
    Hunt

  • Error message when opening FF: can't create mcafee plug-in object: TypeError: Components.classes[cid] is undefined

    I can click ok and firefox will open, but it's still odd... I get the same message when opening any kind of pop-up window.

    This issue is most likely caused by a McAfee extension that isn't working properly and you will have to disable the extension that causes it.
    You can also check if there is an update available from McAfee that fixes this problem.

Maybe you are looking for

  • JDBC- XI- File Scenario

    Hi , I have this scenario where i need to pick the records from an Oracle staging table and i should insert the same header and item records in to a Flatfile which will be used to create records in SAP. The records in the oracle table would be of hea

  • Adding a video from vimeo

    Is there anyway of adding or embedding a vimeo video in an email?

  • Crystal Report failed because a free license could not be obtained

    My question is about Crystal Report Standard (v. 10) and Crystal Report Professional (v.10) Trying to print labels on from my application using Crystal Report Standard Edition (v. 10) and I am getting the follow error.  And it doesnu2019t print any m

  • Not all mov files accepted by i-tunes

    Movies from my G1X camera are not all converted to i-pad by i-tunes.Why??? Can't see no difference in MOV-files!

  • Lost Iphotos/unexpected quit

    Imported photos & film from trip last night. Saw them download.  Chose to delete from camera when offered the option at end of download. THEN Iphoto quit unexpectedly & all images lost.   Is there way to resurrect this last unsucessful download (shor