Classes without packages not accepted by ejbc compilation ?

Hey guys ...
I noticed something which I found unusual...I mite be missing something out here
When ejbc generates the Bean IMPL class , it does not put any import statements
in the generated java file but references all the classes in the Bean with their
absolute path ...
Now ..I have a 3rd-party jar which does not have certain classes in packages...and
I reference these classes within my Session Bean...the session bean compiles properly
..but when ejbc happens and the Impl class gets generated with the absolute path
and no imports...the compiler expects to find all these 3rd-party classes without
packages within the current session bean package itself which it will not..and
hence throws all sorts of "cannot resolve symbol" errors...
Does this mean that within my EJB beans I can never reference classes without
packages or is there something I am missing..?
Thanx,
Krish

Rob ,
I agree with u that giving classes without package is not a good practise..but
Itz got a history which believe it or not stems from another weblogic problem(related
to webservices..)
anywayz..that is another issue alltogether...
I don't think this bug is fixed...coz I checked a WLS70 Impl and it is still generating
the IMPL without the imports...
But can u clarify..what u wud mean by "fixing the bug" ..does it mean that the
Impl would start putting the imports..?
Thanx,
Krish
Rob Woollen <[email protected]> wrote:
I recall this bug being reported before. You might try the latest
service pack and see if it's been fixed already. Otherwise, you'll have
to contact [email protected]
FWIW, it's quite disturbing that a 3rd party would give you a jar
without a package.
-- Rob
Krishnan Venkataraman wrote:
Hey guys ...
I noticed something which I found unusual...I mite be missing
something out here
When ejbc generates the Bean IMPL class , it does not put any import
statements
in the generated java file but references all the classes in the Bean
with their
absolute path ...
Now ..I have a 3rd-party jar which does not have certain classes in
packages...and
I reference these classes within my Session Bean...the session bean
compiles properly
..but when ejbc happens and the Impl class gets generated with the
absolute path
and no imports...the compiler expects to find all these 3rd-party
classes without
packages within the current session bean package itself which it will
not..and
hence throws all sorts of "cannot resolve symbol" errors...
Does this mean that within my EJB beans I can never reference classes
without
packages or is there something I am missing..?
Thanx,
Krish

Similar Messages

  • Import class without package

    hellow, i have a web aplication named test , and i have a class named conexion
    when i import a package "pack" with the class conexion, not problem (test/WEB-INF/classes/pack/conexion.class) <% import="pack.* " %> but when i have only the class conexion WITHOUT package (test/WEB-INF/classes/conexion.class) and i import <%import ="conexion" %> i have problem ("The import conexion cannot be resolved") and when i not import the class i have problem (conexion cannot be resolved to a type) , my question is:
    how to i import a class without package in JSP , and if the test/WEB-INF/classes is in the classpath when compile the servlet , why the tomcat not found the class conexion?
    (tomcat 5.5.20 , jdk 1.5.09 , vim)
    thank
    (Sorry my english , i'm from Chile)

    Hi I am hosting my JSP application with Resin 2.17 which uses classes directly in JSP code (not packages). To make this work I had to specify the classpath in Resin.conf and it worked.
    My problem is getting this to work with TomCat or any other application server that will allow me to debug my project in Eclipse or NetBeans IDE. (I have yet to find an IDE that Supports debugging JSP/Java code running on Resin - so I want to switch my application server but I am not sure how to configure my classpath for the application servers to look for java classes in the specified directory just like I did with Resin.

  • Not allowed to import classes without package names?

    Hi,
    I have a few questions on Packages and importing?
    1. Is the following true that it is illegal to import classes in the same package as the current class, will this cause a comilation error? If this is the case where in the Java Language specification is this actually written as I could not find it?
    2. This has probably been answered by question 1 but if I have 2 classes in the same package and if I import 1 of the classes into the other class, is it illegal to import it by just using the class name and not the package name as well, ie
    if the package name is ie.tcd
    and the 2 class names are exp1.class and exp2.class, can I do this in class 2
    package ie.tcd;
    import exp1;
    public class exp2 {
    3. Is it illegal to import classes that are not explicitly part of any package or must a class be part of a package to be imported. I read somewhere that while this was always illegal it is only after jdk 1.4.2 that this is being enforced? If this is the case where in the Java Language specification is this actually written as I could not find it either?
    Thanks very much for any help,
    John

    Was just also wondering, 1 other thing, I am looking
    at someone elses code they have 2 classes (Class A
    and Class B) in the same package (pkg). The person
    imports class A into B:
    package pkg;
    import A;
    public class B {
    Is this legal code (or was it ever)?Not if A is really in pkg.A. If there is an A in the unnamed package it was legal, or at least it was understood by the compiler, and now it isn't (to both).
    Can you import or is there a point in importing a class in the same
    package?Only by naming the package in the import statement. If the current and the import statement are in the same package the import is redundant.
    If there is a point would you import just be
    using the class name (this would be illegal after jdk
    1.4) or should you use the whole package name even
    though it is in the package anyways?As I understand it you must always use the whole package name in imports.

  • Referencing classes outside package definition

    Hi,
    I have a strange problem, and I dont know if its a limitation of Java or my IDE (Intellij IDEA using java 1.4.1).
    Basically I have a package structure
    /classes/com/foo/MyClass.java
    now from MyClass, I want to access another class file AnotherClass.java that has no package structure (and I can't change this). So I copied it to the /classes directory.
    However, when I try to compile I get a "cannot resolve symbol" error. The IDE wont let me put "import AnotherClass" in the import section.
    I'm confused! can anyone help? All I'm trying to do is reference a class "backwards" from the current package
    cheers

    The proprietry dll I have has already been compiled,
    and has a reference to a Java class that performs the
    appropriate JNI call. Thsi jva class has no package
    structure.Well, then yes I'd suppose you are painted into a corner. Looks to me the no-package class should have been put into a package in the first place, as now you cannot reference that class from other classes that are in packages. Back to what I said earlier, writing classes without packages is a "bad" practice.

  • How to import a class, which is not in a package?

    Hi all,
    I have the following problem:
    A class A is not in a package. In another class B, which is in a package (let's say package X) I want to use the class A. Without importing the class A, I get the error "Cannot resolve symbol".
    Using the import statement import A; gives the error ". expected".
    How can I import that class?
    Best wishes to all ...
    Heiko

    > I have the following problem:
    A class A is not in a package. In another class B,
    which is in a package (let's say package X) I want to
    use the class A. Without importing the class A, I get
    the error "Cannot resolve symbol".
    I think not putting a class in a package is a bad practice. Avoid that.

  • Compile class in package that imports other package

    hi,
    i prepared two packages asume with name x_pck and y_pck.
    a class in x_pck imports a class in y_pck. when i try to compile the class in x_package javac gives error such it can not find y_pck. so where do i have to put my packages to make javac see them?
    thanks...

    ok i found the solution.
    i use javac with parameter "-classpath" such like:
    javac -classpath path_of_y_pck path_of_class_in_x_pck

  • Import a class directly in classpath,without package.

    In jdk1.3, I can
    --------------------------- import MyClass;
    MyClass is in my classpath.
    But in jdk1.4,
    --------------------------- import MyClass;
    cannot been compiled success.
    exception: "." expected.
    Why?

    That's right. Importing a class that wasn't in a
    package was always pointless, and in 1.4 it's actually
    illegal.I am not as certain that I believe in the 'pointless' part.
    As it stands now, a class that does not have a package can not be used in a class that has a package. Not that that is a great loss, but the result certainly surprised me.

  • Inner class not found error when compiling project

    I tried to use 9iDS (JDeveloper 9.0.2.822) to generate applet that has textbox and button.
    I inserted UI components trough UI editor and added actionlistener there.
    Now when trying to compile (and run) project I get always "Class MyClass$1 not found in class MyPackage.MyClass"
    This only happens if both package and class are same named. If not it works... Is this feature of java, jdeveloper or something other? (Well, actually this is not a problem because rarely packages and classes are named as same.)

    Also, it's probably a good idea to name your packages different than your classesMoreover, common naming conventions dictate you should never even use capitals in your package names if I'm not mistaken. Whereas class names should always at least begin with a capital.
    This will help prevent a lot of confusion, both for the developer and the IDE. ;-)

  • Hi  - I recently purchased a new iMac. I have a registered cs5 design premium package which is an upgrade - I have no disc for cs4 but have the qualifying serial number for it. I have installed cs5 via download onto my iMac but it is not accepting the ser

    Hi  - I recently purchased a new iMac. I have a registered cs5 design premium package which is an upgrade - I have no disc for cs4 but have the qualifying serial number for it. I have installed cs5 via download onto my iMac but it is not accepting the serial number. Can anybody help. Does anybody else think that Adobe will loose a lot of customers by not providing any chat or call support for cs5 users??

    You can support serial number and activation support.
    Mylenium

  • [svn:fx-trunk] 16929: Add a [Mixin] class that will register the required class aliases in the event the mxml compiler generation   [RemoteClass(alias="")] code is not called because an application does not use the Flex UI framework .

    Revision: 16929
    Revision: 16929
    Author:   [email protected]
    Date:     2010-07-15 07:38:44 -0700 (Thu, 15 Jul 2010)
    Log Message:
    Add a class that will register the required class aliases in the event the mxml compiler generation  [RemoteClass(alias="")] code is not called because an application does not use the Flex UI framework.
    Add a reference to this class in the RPCClasses file so it always gets loaded.
    QE notes: Need a remoting and messaging regression test that doesn't use Flex UI.
    Bugs: Watson bug 2638788
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/rpc/src/RPCClasses.as
    Added Paths:
        flex/sdk/trunk/frameworks/projects/rpc/src/mx/utils/RpcClassAliasInitializer.as

    Great exercise to document the problem like this.  It got me thinking about how an app with modules would be different from an app that does not use modules.  Solution: I moved the dummy reference of PersonPhotoView out to the main application file (as opposed to being inside the module) and it worked.  I've probably been lucky not to have experienced this problem earlier, because for most other entities I have an instance attached to my model which is linked / compiled with the main application.

  • Trying to install Adobe Flash Player my Adobe ID and Password is not accepted. I changed it several times, without success. What's the problem?

    Trying to install Adobe Flash Player my Adobe ID and Password is not accepted. I changed it several times, without success. What's the problem?

    You don't need an Adobe ID or password to install Flash Player, but you may need to provide your system's Administrator password during the installation.

  • HT1414 itunes is requesting for a password to restore backup but it is not accepting any of my iphone passwords. what password does it require? If i cannot remember this then how do i continue backup without the password request?

    I am using iphone 4 and just updated the software on my mac but wanted to restore my calender/contacts/messages after backup. itunes is requesting for a password to restore backup but it is not accepting any of my iphone passwords. what password does it require? If i cannot remember this then how do i continue backup without the password request?

    If you have a corporate Exchange account set up on the phone, the administrators can require encrypted backups. Try using your Exchange password.

  • I lost the CD from package Adobe Illustrator CS5 Win UPG D 001 the download Illustrator_15_LS1 (2).7z do not accepts the SERIAL NUMBER

    I lost the CD from package Adobe Illustrator CS5 Win UPG D 001 the download Illustrator_15_LS1 (2).7z do not accepts the SERIAL NUMBER

    Hi,
    Please go through this link:  Error "The serial number is not valid for this product" | Creative Suite
    Thank You
    Arjun

  • My iPad 4 tried to open application but repeatedly iCloud asked for login with apple id password. I put my apple id password correct,even i reset it again but still it does not accept in iPad .i am bored with this 3rd class application.please help

    My iPad 4 tried to open application but repeatedly iCloud asked for login with apple id password. I put my apple id password correctly,even i reset it again but still it does not accepted in iPad .i am bored with this  class application.please help.After every 1 second icloud logoin asked.

    Find Apple ID
    https://iforgot.apple.com/applied
    iPad: Unable to update or restore
    http://support.apple.com/kb/ht4097
    iTunes: Specific update-and-restore error messages and advanced troubleshooting
    http://support.apple.com/kb/TS3694
    If you can’t update or restore your iOS device
    http://support.apple.com/kb/ht1808
     Cheers, Tom

  • Application loader wants a 'hosted content package', but does not accept a package created by PackageMaker?  What exactly does App Loader want?

    Am attempting to create an in-app purchase with a few files embedded.  It appears that the hosted content selection would be what I need, yet Application loader is not accepting a .pkg (or .mpkg) that PackageMaker has created after I loaded the files into PM.  What am I missing?

    I have the same problem. Apparently PackageManager is for creating bundles for the Mac and not for in-app purchases.
    Im just about to quit on host the in-app purchase on apple and just creating my own server for that. Its very frustrating because there´s no documentation on how to create a iOS in app package. In the application Loader documentation is assumed that the package is already created.

Maybe you are looking for

  • Dbms_xmlsave Error line 65

    We are passing a clob to dbms_xmlsave.insertxml successfully for all XML clobs under .5 megs but once we go over that size the Error line 65 "Invalid arguments encountered processing ROW ELEMENT 0 show up. Is this a size limitation for dbms_xmlsave?

  • 5512 all in one not printing black ink

    My Photosmart 5512 isn't printing black ink. It also won't align which is odd.  It doesn't "see" the alignment page when I try to scan it.   I have done all the things that the HP troubleshoot site said (test pages, cleaning printheads, quality repor

  • MS fonts, hickups with Greek

    Hello. I've being looking in to fonts on 10.7, trying to find my perfect font, when I hit a really odd bug! So the preview of the story is that I need a font what can display Latin, Greek and Cyrillic letter. And the problematic one has always been G

  • Excise Value to Upload in Material Cost.

    Hi Guru's Our requirement is to add all the excise value to material cost. For that we have created new pricing procedure and it works ok as far as basic and education cess loading into material but this does not work for Higher Education Cess. Apart

  • Application dumps core in 64-bit but runs fine in 32-bit

    Hi, I have a strange problem in a application supposed to be run in 64-bit mode. The application is a batch process run as a daemon. When it is compiled with 32-bit mode, it seems to be working fine, but when it is compiled with 64-bit mode, it dumps