Cannot static import in JSP (WebLogic 10.3)

I am facing a problem with the use of 'static import' in JSP. This is on WebLogic 10.3. Please help/advise.
Running weblogic.jspc results in the following error:+
$ java weblogic.jspc -verboseJspc -keepgenerated -d /tmp/jsp WEB-INF/jspf/fragment.jspf
\[jspc\] Overriding descriptor option 'keepgenerated' with value specified on command-line 'true'
\[jspc\] Compiling /WEB-INF/jspf/fragment.jspf
jspc failed with errors :weblogic.servlet.jsp.CompilationException: fragment.jspf:6:17: Syntax error on token "static", Identifier expected after this token
<%@page import="static java.util.Collections.EMPTY_LIST" %>
^-------------------------------------^
fragment.jspf:6:17: The import java.util.Collections.EMPTY_LIST cannot be resolved
<%@page import="static java.util.Collections.EMPTY_LIST" %>
^-------------------------------------^
The generated Java file is not correct; the static import is split into multiple imports+
$ head /tmp/jsp/jsp_servlet/_web_45_inf/_jspf/__fragment_jspf.java
package jsp_servlet._web_45_inf._jspf;
import java.lang.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import static;
import java.util.Collections.EMPTY_LIST;
public final class __fragment_jspf extends weblogic.servlet.jsp.JspBase implements weblogic.servlet.jsp.StaleIndicator {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

I'm not sure that JSPC supports static imports, I would open a support case to get clarification.

Similar Messages

  • Impli?it import in JSP

    Hi,
              Could anybody clear the following question? Which way does jsp compiler make
              import of packages on weblogic 6.0? I looked through JSP examples and did
              not find any import declaration in some of them, but there were some classes
              that do not belong to the default import list:
              java.lang.*,
              javax.servlet.*,
              javax.servlet.jsp.* and javax.servlet.http.*,
              for example java.util.Enumeration, java.util.Date.
              Andrey
              

    Mettu Kumar <[email protected]> wrote:
              >>>Exactly. The fact that WebLogic JSP compiler imports java.util.* by default caused some
              > minor portability problems (on the other hand I believe that scriptlet tag should be
              > deprecated ;-)).
              > What portability problems did BEA importing java.util.* into generated java files caused
              > you?
              It is not a bug of anything like that - the problem was that JSP developers got used to the
              fact that java.util.* is always imported by the WebLogic JSP compiler and this created some
              very minor portability issues.
              > BTW who told you java.util.* package is imported for every jsp file unless you looked at
              > the generated java file? No one expects to you write your jsp files looking at generated
              > java code and making assumptions that are not part of JSP spec.
              > I do Agree with you completely regarding print bug.
              > Kumar.
              > Dimitri Rakitine wrote:
              >> Mettu Kumar <[email protected]> wrote:
              >> > Dimitri,
              >>
              >> > As mentioned by you as per spec they are only default packages imported. By
              >> > that spec doesn't mean jsp container can only import those packages. Every JSP
              >> > Container imports several other packages.
              >>
              >> > The only caution developers need to take is that they can assume only these
              >> > four packages are available to them.
              >>
              >> Exactly. The fact that WebLogic JSP compiler imports java.util.* by default caused
              >> some minor portability problems (on the other hand I believe that scriptlet tag
              >> should be deprecated ;-)).
              >>
              >> Minor things like this are definitely an issue when portability is important. Here is
              >> another minor example that I remember - WebLogic violates JspWriter contract
              >>
              >> ----------
              >> public abstract void print(java.lang.Object obj) throws java.io.IOException
              >> Print an object. The string produced by the String.valueOf(Object) method is translated
              >> into bytes according to the platform's default character encoding, and these bytes are
              >> written in exactly the manner of the Writer.write(int) method.
              >>
              >> public static String valueOf(Object obj)
              >> Returns the string representation of the Object argument.
              >> Parameters:
              >> obj - an Object.
              >> Returns:
              >> if the argument is null, then a string equal to "null"; otherwise, the value of
              >> obj.toString() is returned.
              >> ------------
              >>
              >> just a little: if the argument is null, in WebLogic the jsp page will display "" and
              >> "null" in all other containers.
              >>
              >> > Can you imagine how containers can provide JSP features without even import
              >> > java.io.* ?
              >>
              >> Yes - they generate java code automatically, so convinience is not important for
              >> them - they can always use fully qualified names.
              >>
              >> > Kumar.
              >>
              >> > Dimitri Rakitine wrote:
              >>
              >> >> WebLogic imports java.util.* by default - this is convinient, but
              >> >> will not work on other JSP engines (according to the spec the default imports
              >> >> are: java.lang.*, javax.servlet.*, javax.servlet.jsp.*, javax.servlet.http.*)
              >> >>
              >> >> Andrey Leskovoy <[email protected]> wrote:
              >> >> > Hi,
              >> >> > Could anybody clear the following question? Which way does jsp compiler make
              >> >> > import of packages on weblogic 6.0? I looked through JSP examples and did
              >> >> > not find any import declaration in some of them, but there were some classes
              >> >> > that do not belong to the default import list:
              >> >> > java.lang.*,
              >> >> > javax.servlet.*,
              >> >> > javax.servlet.jsp.* and javax.servlet.http.*,
              >> >>
              >> >> > for example java.util.Enumeration, java.util.Date.
              >> >>
              >> >> > Andrey
              >> >>
              >> >> --
              >> >> Dimitri
              >>
              >> --
              >> Dimitri
              Dimitri
              

  • Static import of member of class in same unnamed package fails

    I think I found a bug in the JDK 1.5 (Tiger) javac compiler. It involves static import and unnamed packages.
    Consider the following compilation unit:
    import static D.x;
    class C {
        int foo() { return x; }
    class D {
        static final int x = 1;
    }Running javac from the Tiger beta 2 SDK generates the following output:
    Test.java:1: cannot find symbol
    symbol: class D
    import static D.x;
                  ^
    Test.java:1: static import only from classes and interfaces
    import static D.x;
    ^
    Test.java:4: cannot find symbol
    symbol  : variable x
    location: class C
        int foo() { return x; }
                           ^
    3 errorsIn my opinion, this is a bug. This compilation unit should compile without errors.
    Note that the following compilation unit compiles without errors with Tiger beta 2:
    package p;
    import static p.D.x;
    class C {
        int foo() { return x; }
    class D {
        static final int x = 1;
    }Note that this issue is distinct from the issue of importing a class from an unnamed package into a named package. I totally agree that the latter is not allowed. However, the current issue is a different matter, since here I am importing members from the same package (which happens to be an unnamed package).

    The unnamed package feature is deprecated. Even if this is a bug (which I sort of doubt), this may never be fixed.

  • Using static import

    I just downloaded the 2.2ea. I tried using the static import feature. When I try to import my own classes f.ex.
    import static test1.test2.TestInferface;
    i get the error
    cannot find symbol
    symbol : class test2
    location: package test1
    import static test1.test2.TestInferface;
    ^
    if I try the static import from the example
    import static java.lang.Math.*; // import static
    it compiles fine. What have I got wrong here?

    Doh, you were right :). Importing test1.test2.TestInterface.*; is what is needed. Works now. Thanks.
    Thought I had already tried that but I guess I was wrong. I guess I was too stuck in the old way of thinking of importing classes and interfaces as a whole, I guess the static import imports class and interface members then.. Am I right?

  • Static import bug?

    Hey just discovered something new...does this sound like a bug to you guys?
    I have a class with a static method called, say, omgMethod()
    and I have another class with a method (not static) with the same name (omgMethod) but different signature.
    now when I try to use import static classA.omgMethod in the second class, it generates a compiler error:
    cannot find symbol method omgMethod( etc...)
    any thoughts? i'm thinking about adding it to the bug report.
    -Cuppo

    I'm not so sure about that. I have never used static import so I checked out Sun's tutorial which is here:
    http://java.sun.com/j2se/1.5.0/docs/guide/language/static-import.html
    It talks about importing "members" and says you can import "members" individually. And (I had to look this up too in the JLS), "members" means classes, interfaces, fields, and methods.
    So that says to me that you can indeed import a static method from another class, and then use it without qualification. Yeah, I'm surprised too. But you're just importing the method's name, not its signature. So if that name conflicts with a name of a method in your class, then I don't know what is supposed to happen. I looked through the JLS a bit and section 6.5.7.1 says
    "The Identifier must name at least one visible (�6.3.1) method that is in scope at the point where the Identifier appear or a method imported by a single-static-import declaration (�7.5.3) or static-import-on-demand declaration (�7.5.4) within the compilation unit within which the Identifier appears.
    See �15.12 for further discussion of the interpretation of simple method names in method invocation expressions."
    Possibly section 15.12 discusses conflict resolution in this case. But I will let you carry on from there.

  • Static import in J2se5

    Hi All,
    I m using jdk1.5. in which we hav a new feature - "static import".
    I want to know, whether this is possible in JSP......?????
    If anybody knows... please give me the ans with the syntax.
    Thanks,
    Chandrakanth.

    I'm usin tomcat 5.0, configured with jdk1.5.
    In servlets i m usin static import n it works fine......
    I dont know... how put the static import statement in JSP file....
    Can v put static import using page directive....s????????

  • "Photos in the Camera Roll of "(your) iPhone" cannot be imported because the device is locked with a passcode.  You must unlock the device to import them."  My iPhone 5 running the latest iOS 7.1 and I'm using iPhoto '11 v 9.4.3

    "Photos in the Camera Roll of "(your) iPhone" cannot be imported because the device is locked with a passcode.  You must unlock the device to import them."  That's the new error message when I plug in my iPhone 5 running the latest iOS 7.1 into the MacBook Pro running iPhoto '11 v.9.4.3.  My Mac OSX is still 10.8.5.
    So, I unlock the iPhone by entering the "passcode" before I plug it into the MBP and still iPhoto does nothing.  At least it doesn't issue the error message above.
    I've checked both iPhoto preferences and those for Photos and Camera in the Settings on the iPhone.  There doesn't seem to be anything to change this lack of connectivity.
    What next please?

    An hour-long phone discussion with Apple Support yesterday solved this question and sorted a couple of others.
    As for this one, do not ignore any messages which pop up when you plug in your iPhone and ask "Trust this computer?".  The correct reply is "Yes", not "Cancel".
    OK, you cancelled like I did, thinking "What on earth is this for?".  Mistake.  You can force the issue by having iTunes open when you next plug in your iPhone.  Tell the iPhone that it can trust its old friend, your computer and voila!  Your photos can download into iPhoto again.
    Thank you, Jay with Apple Sydney, Australia!

  • I cannot find imported mail boxes. if i try to setup a new mailbox, it shows the existence of the mailboxes that i am looking for in the location drop down menu. where would they be located?

    i cannot find imported mailboxes. if i try to setup a new mailbox, it shows the existence of the mailboxes under location/on my mac. they do not show up in the mailbox list. where would they be located so that i can retrieve them?

    Did you quite Mail and relaunch?
    Your imported mail is stored in a new mailbox called “Import.” To reorganize imported messages, create new mailboxes and drag folders and messages from the Import mailbox to other mailboxes. When you’re done, you can delete the Import mailbox.
    If you don’t see your mailboxes in Mail, choose View > Show Mailbox List; empty mailboxes aren’t imported.

  • This workflow cannot be imported because it was created in SharePoint Designer for a different Site

    Hello everyone.  I am getting this error when attempting to move minor workflow changes from mirror SharePoint development / production environments and hoping someone can help me.
    "This workflow cannot be imported because it was created in SharePoint Designer for a different site, or the original workflow has been moved or deleted.  To move a workflow between sites, use Save as Template (.wsp file) instead of a Visio workflow
    drawing."
    So basically I have taken an image of our single SharePoint server, Domain Controller, and a client and restored them to an OFFLINE development environment for the testing of workflow changes prior to production.  I've put quite a bit of time into one
    particularly and would like to export/import rather than re-created from scratch.
    I've successfully created the form template and imported.  This created the necessary list items nicely and the form appears to work as expected.  However, when attempting to import the .VWI file exported from dev SharePoint, I am getting the above
    error.  If I change the .VWI to .zip and remove the "workflow.xoml.wfconfig.xml" file, then re-zip and change the file extension back to .VWI I get a dialog that allows me to import, but I have to choose a new name and much of the related content
    is lost.  I need to be able to overwrite/merge the existing workflow with the import.  Any suggestions?
    One strange thing I ran into was during a test of an export/import from and to the exact same environment. If I simply export to .VWI, then import from .VWI with no changes, SAME everything I still get this error. Very weird. Hoping someone can shed some
    light on the subject. Thank you.
    Adam Tyler

    Hi Adam,
    Here is a blog talk about the same issue would be helpful:
    http://techiescode.blogspot.com/2014/09/copymove-sharepoint-2010-designer.html
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Photos in the camera roll of "iPhone cannot be imported because the device is locked with a passcode.  Tried just about everything - suggestions?

    Photos in the camera roll of "iPhone cannot be imported because the device is locked with a passcode.  Tried just about everything - suggestions?

    Because your computer sees your phone, as it would see any digital camera, as long as you have photos in your camera role. Since you state you don't sync with this computer & have a passcode on your phone, that's why you get that message. The only way to prevent that message is either start syncing with this computer; remove the photos from your camera roll prior to connecting; or first turn off your passcode before you connect. Either that, or you live with it.
    You shouldn't be storing photos in your camera roll anyway. iPhone camera roll is not designed for photo storage. You should be regularly importing them.

  • Assistance with Error - virtualmachinemanager.psd1 module cannot be imported, one or more members are not valid.

    Hello,
    We use Orchestrator, System Center 2012 version 7.1.3022.0.  I have an orchestrator script that reads through a txt file to find unresponsive virtual machines (Windows 2000 VM's cannot have the SCOM agent installed on them) so we can restart any
    machines that are not responding. 
    The step to Get Computer/IP Status runs successfully in that it reports which VM's are running and which are not running.  The next step then is to run a Powershell script that restart the VM's that are down.  Here is my Powershell Script:
    $ErrorActionPreference = "Stop"
    try
    Import-Module 'C:\Program Files\Microsoft System Center 2012\Virtual Machine Manager\bin\psmodules\virtualmachinemanager'
    Get-VMMServer -ComputerName mlivsmsscvmm
    # get vm object
    $vm = get-SCVirtualMachine | where { $_.ComputerName -eq "\`d.T.~Ed/{A255D4D8-BD4D-4FF4-9A51-B1ABA82720B9}.Computer-name\`d.T.~Ed/" }
    # save data to publish for future activities
    $OrigVMMStatus = $vm.StatusString;
    $AlertAdded = "\`d.T.~Ed/{A4B4EC8A-E4F8-40AB-9897-6906EAE139AE}.TimeAdded\`d.T.~Ed/";
    $VMName = $vm.Name;
    # we are at this point because the VM is not responding.
    # Start VM - if VM status is "Running" then Stop the VM first
    if($vm.StatusString -eq "Running")
    { Stop-SCVirtualMachine -vm $vm -force };
    Start-Sleep -s 20;
    if($vm.StatusString -eq "Stopped")
    { Start-SCVirtualMachine -vm $vm
    $VMrestart = "Yes"
    catch
    Throw $_.Exception
    Upon running the Powershell script I receive the following error in Orchestrator Log histry:
    The 'C:\Program Files\Microsoft System Center 2012\Virtual Machine Manager\bin\psmodules\virtualmachinemanager\virtualmachinemanager.psd1' module cannot be
    imported because its manifest contains one or more members that are not valid.
    This script used to run without errors and nothing has been upgraded in our environment with regards to Orchestrator, VMM, SCOM.  How would I find the 'one or more members' that is causing my issue?
    Thank you.

    Hi,
    the thing is that PowerhShell in the "Run .Net Activity" is version 2.0 (http://www.sc-orchestrator.eu/index.php/scoblog/102-running-powershell-30-with-the-run-net-script-activity)
    So, try your script embedded in PowerShell {}
    Regards,
    Stefan
    www.sc-orchestrator.eu ,
    Blog sc-orchestrator.eu

  • How to disable the message that pops up every time i connect my iphone "photos in the camera roll of iphone cannot be imported because the device is locked with a passcode"?

    Wrongly posted in iPhoto forum, should probably be posted here instead.
    I want to remove the message that pops up every time i connect my IPhone that says: "Photos in the Camera Roll of "Name" cannot be imported because the device is locked with a passcode.".
    This computer is not one that I want to import photos to (or sync with the iPhone), so this message is just very annoying, and it pops up all the time. I cannot find a way to disable this message. It is constantly appearing. No application is launching, I have turned off the iPhoto launch in the Image Capture app as well as in iPhoto. Thanks in advance if anyone has any information about this.

    Because your computer sees your phone, as it would see any digital camera, as long as you have photos in your camera role. Since you state you don't sync with this computer & have a passcode on your phone, that's why you get that message. The only way to prevent that message is either start syncing with this computer; remove the photos from your camera roll prior to connecting; or first turn off your passcode before you connect. Either that, or you live with it.
    You shouldn't be storing photos in your camera roll anyway. iPhone camera roll is not designed for photo storage. You should be regularly importing them.

  • Prores files not recognized... most of the time [message -- file '[file name].mov' cannot be imported – this 'MooV' file is damaged or unsupported.]

    Running AE CC 13.2 on iMac with Yosemite 10.10.2
    I just started getting an error message when trying to import any number of ProRes 422 (HQ) files.
    file ‘[file name].mov’ cannot be imported – this ‘MooV’ file is damaged or unsupported.
    This happens approximately 90% of the time. There have been occasions where I can open and view files of this type.
    I have gone through the various troubleshooting options here:
    http://blogs.adobe.com/aftereffects/2013/08/solutions-for-problems-with-quicktime-files-in -after-effects-cc-12-0-because-of-conflict-with-dvcprohdvideoout-quicktime-component.html
    I reinstalled ProApps to no avail.
    Permissions are fine.
    Creative Cloud recently updated AE over the past few days. Perhaps this incremental update fouled something up? Last weekend, things worked perfectly fine.
    I have also noticed that it takes a lot longer to load AE (since using last weekend). I have used Time Machine to roll the application back to last week's version to see if that helps.
    Any insight is appreciated.

    The update last week was just to Adobe Camera RAW and not really AE. It would be unlikely to cause the issues you describe. Have you tried turning your Mac all the way off and then back on again?

  • Imported Error -   The file cannot be imported. Unknown error occured (-50)

    I have the 30G Ipod. It has been freezing several times. I have reset and master reset several times. I used the updater program and restored the software (several times).
    I also reinstalled itunes & ipod software from the cd and updated to the latest version of itunes.
    Now I go to itunes, I see my ipod listed and as before I choose to import the file from my music directory which containes all my mp3 files. After choosing file, import, the error msg comes up saying the file cannot be imported. An unknown error occured (-50).

    OK I'll do a basic explaination on what were about to do. When you use the "Restore" option in the updater, it does a quick format, basicly tagging everything on the drive inside the ipod saying "You can write over me". This is the same as a "Quick FOrmat" in windows.
    Now theres a complete format called a low level or "Deep" format you can do in windows. THis goes thru and writes the whole harddrive in zeros AND maps off bad sectors on the drive or fixes them. this is what you have when the ipod clicks and freezes.
    The steps you do are not that long, BUT the actual format can take hours. Some report gettin done in a hour others it takes 5 hours, so make sure you got the time before going ahead. You can do the steps before bedtime and let it format while you sleep. Make sure the PC is not set to goto sleep or shut off, if on a laptop leave it opened and plugged to its AC adaptor.
    WITHOUT the ipod connected to the PC, hit ctrlaltdel keys to open the task manager. Select the "Process" tab, look for "iPodservice.exe". Highlight it and hit "End Process".
    Now connect the iPod, it should flash the "Do not disconnect" sign and you will see it in windows under "My Computer". Rightclick the ipod in "My Computer" and hit format. UNCHECK quick format and hit start. Now this is the long part, you can stop the process half way thru, but I usually recommend to people to let it completely format to make sure it gets any bad sectors. Again its a long process so just be calm.
    Once its done, reboot the PC so the "iPod service" is started again. When windows is back up YOU MUST run the ipod updater and restore it so the ipod is formatted into the format it needs. Only after this should you let iTunes get ahold of it and start loading it up

  • Jsp:useBean vs page import in JSP

    Hi,
    What is the difference between jsp:useBean vs page import in JSP?
    By using page import also I can call the method of the class, apart from jsp:useBean does have scope associated with it. I don't think there is any change between both the 2. Yes by using jsp:useBean we can set the property and get the property as well.
    Is there any major differences between the 2 and when to use which ? Please clarify.
    Thanks.

    797836 wrote:
    Hi,
    What is the difference between jsp:useBean vs page import in JSP?
    By using page import also I can call the method of the class, apart from jsp:useBean does have scope associated with it. I don't think there is any change between both the 2. Yes by using jsp:useBean we can set the property and get the property as well.
    Is there any major differences between the 2 and when to use which ? Please clarify.
    Thanks.Yes there is a difference.
    If you use import, then you have to create/use the reference object to use the class methods. And you can't define the scopes like session, page .. etc. Apart from this you will be using scriptlets <% %>.
    if you are using jsp:useBean , then you can skip the above activities. useBean takes care of it.
    or you can say jsp has provided a utility to access the beans without creating its object or using scriptlets.

Maybe you are looking for

  • Error while creating a system in portal

    Hi, Iam trying to create a technical system(SAP System with Load Balancing) in the portal.When i try to test the connections im getting the following error: The WAS ping service (http://hostname:portnumber/sap/bc/ping) was not pinged successfully. If

  • How to make a vertical Power Spectrum graph?

    I need help to rotate a graph 90 degrees. My input is Scaled Data which goes into an Index Array to split the channels. The graph is okay for the selected channel but is in landscape mode and I want it to be relatively thin and vertical i.e. exchange

  • CF8. ODBC Vs JDBC Oracle Date. Time portion not returned

    Hi. Just upgraded one of our servers to CF8. We are connecting to a Oracle 10g R2 database and we have also started using Oracles JDBC drivers. If I do the following query under ODBC and dump the result. Query : Select CALL_DATE From CALLS WHERE CALL

  • Basic PBE questions and clarifications

    I have some basic questions about PBE and java. My first question is how do I determine the size of the derived key that will actually be used? Do we have any control over that? I guess that the password strength is probably more important than size

  • What is too much?

    I am living in China right now, and if you have ever worked or lived in china you know that dvds are cheap and you watch them a lot. I dont own a tv right now or a dvd player so i use my computer a lot. I am very scared that i am going to over use my