Only a type can be imported. package.Class resolves to a package

Hi,
I made a class for database connection named ConnectionClass.class.
The JSPs in public_html directory working fine with import and session variables.
but JSPs under public_html/subdirectory are unable to import this Class and also unable to access session variables.
I have deploy this class under public_html/WEB-INF/classes/ directory.
and also in a jar file vidyabharti.jar under public_html/WEB-INF/lib directory
I am importing it in JSPs like
<%@ page import="vidyabharti.ConnectionClass, java.sql.*" %>
but i am getting following error
An error occurred at line: 6 in the generated java file
Only a type can be imported. vidyabharti.ConnectionClass resolves to a package
An error occurred at line: 110 in the jsp file: /welcome.jsp
ConnectionClass cannot be resolved to a type
109: <%
110: ConnectionClass cs=null;
An error occurred at line: 115 in the jsp file: /welcome.jsp
ConnectionClass cannot be resolved to a type
cs=new ConnectionClass();
i am using Tomcat 5.5.28.
please help me.

Hello,
It's a possible issue whith the JDT compiler version of your tomcat distribution.
You know that jasper is the engine that transform jsp to classes and to achive this goal uses a jdt compiler or the ant task javac compiler.
First check that the JDT compiler class is present in the trace of the exception you have.
If this is the case follow the steps of the tomcat documentation in order to use the ant compiler.
http://tomcat.apache.org/tomcat-5.5-doc/jasper-howto.html
Apache Ant, which was used in previous Tomcat releases, can be used instead instead of the new compiler by simply removing the common/lib/jasper-compiler-jdt.jar file, and placing the ant.jar file from the latest Ant distribution in the common/lib folder. If you do this, you also need to use the "javac" argument to catalina.sh.
If you check the code of the tomcat compilation context seems that you can do the same, without removing any file, by setting the compile parameter of the JspServlet to an arbitrary value diferent from null.
Try this other alternative by editing the file %TOMCAT_HOME%\conf\web.xml
and set the compiler attribute as follow
    <servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>fork</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>compiler</param-name>
            <param-value>Ant</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet>If this works for your problem we can check the jdt code and perhaps make a patch.
Best reggards,

Similar Messages

  • Help in JSP : Only a type can be imported x.y resolves to a package

    I have a strange problem,
    I have two domains
    http://client.spry-forms.com (login using demo/demo)
    http://spry-forms.com/ClientAdmin (login using demo/demo)
    The server is setup with only tomcat 6.0.18.0
    Both the above domains are mapped to tomcat/webapps/ClientAdmin.
    When some one logs in from the second url, the link CREATE NEW FORM at page http://www.spry-forms.com/ClientAdmin/forms.jsp works fine but
    when some one logs in from the first url (client.spry-forms.com) the link 'CREATE NEW FORM' at page http://client.spry-forms.com/forms.jsp produces this error
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 7 in the generated java file
    Only a type can be imported. view.DemoConnection resolves to a package
    An error occurred at line: 12 in the jsp file: /formeditor.jsp
    DemoConnection cannot be resolved to a type
    9: response.sendRedirect("../Authenticate.do?status=logoff");
    10: return;
    11: }
    12: DemoConnection con = (DemoConnection) request.getSession().getAttribute("dbconnection");
    13: String formid = request.getParameter("formid");
    14: String grpid[] = (String[]) request.getAttribute("groupArray");
    15: //String groupArry [] = (String[])request.getAttribute("groupArr");
    Can anyone give me a hint as to what is happening??

    evnafets wrote:
    http://spry-forms.com/ClientAdminThe "/ClientAdmin" bit is not part of a domain. Are you sure it is what you think it is?
    So do you import this class DemoConnection?
    What is the layout of your web application?
    How do you do the multiple domain config -> web application?Thank you for your reply and
    Sorry for my late response
    Ok the /ClientAdmin is not a domain, but it is a directory in the spry-forms.com
    I import the DemoConnection.java like this
    <%@ page import="java.sql.*,view.DemoConnection,java.util.*"%>I did not do the domain config, as I am not the administrator, The admin wants me to resolve this.
    I think the problem is caused because tomcat cannot find the DemoConnection.class.
    By layout I think you are asking about the direcotry tree structure
    It is like this
    Tomcat
        webapps
            ClientAdmin
                jsp files
                WEB_INF
                    web.xml
                    lib
                    classes
                        poolman.xml
                        folders
                        view
                            DemoConnection.class
                            some more classesDo you think the problem is with the domain configuration....?
    Edited by: Sonu611 on Feb 26, 2009 9:53 PM

  • Only a type can be imported. x.y.z.Utility resolves to a package.. HELP!!!

    anyone help me.. pls..
    the class exists properly in the package folder.
    No error found as I compiled it.
    Tomcat5.5 + JDK-1.5.0_06 + JBoss-4.0.2...with a Struts framework.
    the error is really special for me. I tried all opinions to sort it out.
    I changed import file to the other at 1 line. the same error occurred, though.
    ex) <@ page import="x.y.z.Test" %> or <@ page import="x.y.z.AnyClass" %> --> ERROR: Only a type ~~~
    if delete that line, 404 error is showed. stuck~~~~~
    other jsp pages are good. Only the type's page below causes the error. weird~
    what's problem? Had anyone had a same problem?
    aa.jsp---------------------------------------------------------
    <@ page import="x.y.z.Utility" %>
    <jsp:forward page="/servlet/MypageManager">
    <jsp:param name="ACT" value="main">
    </jsp:forward>
    2009. 5. 6 ¿ÀÈÄ 2:03:59 org.apache.catalina.core.StandardWrapperValve invoke
    ½É°¢: Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    Only a type can be imported. x.y.z.Utility resolves to a package
         at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
         at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:833)
         at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:639)
         at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1285)
         at java.lang.Thread.run(Thread.java:595)

    aaa.jsp
    <%@ page contentType="text/html; charset=euc-kr" import = "kr.co.gen128.common.Utility" %>
    <jsp:forward page="/servlet/MypageManager">
        <jsp:param name="ACT_TP" value="MYPAGE_MAIN" />
        <jsp:param name="TOP_MENU" value="MYPAGE" />
        <jsp:param name="CENTER_TITLE" value="MYPAGE_MAIN" />
    </jsp:forward>aaa_jsp.java
    package org.apache.jsp.mypage;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    import kr.co.gen128.common.Utility;         
    public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
        implements org.apache.jasper.runtime.JspSourceDependent {
      private static java.util.List _jspx_dependants;
      public Object getDependants() {
        return _jspx_dependants;
      public void _jspService(HttpServletRequest request, HttpServletResponse response)
            throws java.io.IOException, ServletException {
        JspFactory _jspxFactory = null;
        PageContext pageContext = null;
        HttpSession session = null;
        ServletContext application = null;
        ServletConfig config = null;
        JspWriter out = null;
        Object page = this;
        JspWriter _jspx_out = null;
        PageContext _jspx_page_context = null;
        try {
          _jspxFactory = JspFactory.getDefaultFactory();
          response.setContentType("text/html; charset=euc-kr");
          pageContext = _jspxFactory.getPageContext(this, request, response,
                         null, true, 8192, true);
          _jspx_page_context = pageContext;
          application = pageContext.getServletContext();
          config = pageContext.getServletConfig();
          session = pageContext.getSession();
          out = pageContext.getOut();
          _jspx_out = out;
          out.write('\r');
          out.write('\r');
          out.write('\n');
          if (true) {
            _jspx_page_context.forward("/servlet/MypageManager" + (("/servlet/MypageManager").indexOf('?')>0? '&': '?') + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode("ACT_TP", request.getCharacterEncoding())+ "=" + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode("MYPAGE_MAIN", request.getCharacterEncoding()) + "&" + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode("TOP_MENU", request.getCharacterEncoding())+ "=" + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode("MYPAGE", request.getCharacterEncoding()) + "&" + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode("CENTER_TITLE", request.getCharacterEncoding())+ "=" + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode("MYPAGE_MAIN", request.getCharacterEncoding()));
            return;
        } catch (Throwable t) {
          if (!(t instanceof SkipPageException)){
            out = _jspx_out;
            if (out != null && out.getBufferSize() != 0)
              out.clearBuffer();
            if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        } finally {
          if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }Two types of error occurred randomly.
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    Only a type can be imported. kr.co.gen128.common.Utility resolves to a package
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    Only a type can be imported. kr.co.gen128.common.Utility resolves to a package
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to load class for JSP
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    org.apache.jasper.JasperException: Unable to load class for JSP
         org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:598)
         org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:147)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.ClassNotFoundException: org.apache.jsp.mypage.index_jsp
         java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         java.security.AccessController.doPrivileged(Native Method)
         java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:133)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:65)
         org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:596)
         org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:147)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.Thanks a lot.
    Any other you need to see?

  • Only a type can be imported. MyClass.anyclass resolves to a package error

    I know there's been many posts with this problem, however, I haven't been able to fix mine.
    I have an app that uses JSP's, java libraries with Tomcat and MySQL. The app works fine, however, since I migrate to a new server, I start getting this error.
    The funny thing here is that JSP's that are located in the root directory (public_html) works fine, while all the other JSP's throw this exception:
    "Only a type can be imported. MyClass.anyclass resolves to a package error"
    If I move any JSP from "public_html/any_directory" to "public_html", then that very same JSP works fine.
    The java libraries are located in a jar file, in WEB-INF/lib, and it's classpath is perfectly written.
    Altough, I know there's nothing wrong with the code of the JSP's, here it is, in case that helps. I'm sure that this error is caused by some Tomcat's configuration, however, I haven't been able to find it.
    <%@ page import="Solutio.AdminRH.Entity.ICatalogosAdminDB" %>
    <%!
         private ICatalogosAdminDB theObj = null;
         public void jspInit() {
              try {
                   theObj = new ICatalogosAdminDB();
              } catch (Exception ex) {
                   System.out.println(ex);
         public void jspDestroy() {
              theObj = null;
    %>
    <html>
    Any help will be really appreciated.
    Thank you.

    I haven't solved this problem yet. Here's some extra information about the same problem:
    1 - As you know, Tomcat compiles JSP's the first time they're executed, so I checked the java code generated for:
    /public_html/my_JSP.jsp
    and
    /public_html/any_folder/my_JSP.jsp
    both codes are exactly the same, however, as I mentioned before, only the one located in /public_html/ works.
    It seems to be a problem with Tomcat's classpath, but I haven't been able to fix it yet.
    2 - In the Tomcat's conf file "server.xml", I found this, and it looks just fine, in the older server, I had exactly the same conf and it used to work.
    <Host name="axtl.com" appBase="/home/axtlccom/public_html">
    <Alias>www.axtl.com</Alias>
    <Context path="" reloadable="true" docBase="/home/axtlccom/public_html" debug="1"/>
    <Context path="/manager" debug="0" privileged="true"
    docBase="/usr/local/jakarta/tomcat/server/webapps/manager">
    </Context>
    </Host>
    have anyone experieced something like this, PLEASE HELP !!!

  • Getting error message "Only a type can be imported-" when trying to execute jsp page

    I get the error: "Only a type can be imported. com.adobe.cq.TestServiceImpl resolves to a package in adobe day cq5
    I have created one bundle and installed in felix console. The status of the bundle is also Active. And also it is available in both service and component console.
    Here is my TestServiceImpl class in com.adobe.cq bundle
    package com.adobe.cq;
    import org.apache.felix.scr.annotations.Component;
    import org.apache.felix.scr.annotations.Service;
    import org.osgi.framework.BundleContext;
    import org.osgi.service.component.ComponentContext;
    import javax.jcr.RepositoryException;
    import org.apache.felix.scr.annotations.Property;
    import org.apache.felix.scr.annotations.Properties;
    //src.component
    //declares the class component. This will provide a wrapped ManagedService component in the OSGI container.
    //src.service interface="SampleService"
    //declares the service we are offering. Actually, the interface attribute is superflous, as by default, all implemented Interfaces are used.
    @scr.component
    @scr.service interface="testService"
    @Component(immediate = true, metatype = true)
    @Service
    @Properties( {
    @Property(name = "service.description", value = "abcd"),
    @Property(name = "label", value = "myLabel") })
    public class TestServiceImpl implements TestService {
    public String sayHello() {
         return "Hello World!";
    Here is my jsp code
    <%@include file="/libs/foundation/global.jsp"%><%
    %><%@include file="/apps/mine/includes/functions.jsp"%><%
    %><%@ page import="com.adobe.cq.TestServiceImpl,
    org.apache.sling.api.SlingHttpServletRequest,
                    java.util.List"%><%
    %><%
    SlingHttpServletRequest r = (SlingHttpServletRequest)request;   
                    TestServiceImpl testService = sling.getService(TestServiceImpl.class);
                    out.println("testService:::"+testService);
    %>
    <div id="te-nav" style="display:block !important;">
    </div>
    Is it because of am using annotation in TestServiceImpl class?
    Could you please tell me how to fix it?
    Regards,
    Anderson

    Hi Pawan,
    Thanks for your information. It was problem with my pom.xml It started to work after changing my POM.xml
    I am not able to get sling service for TestServiceImpl. But I am only able to create TestService which is my interface. I need to get reference for TestServiceImpl class not for TestService interface. Please help me to make it.
    i have created TestServiceImpl and TestService class for testing whether my bubdle is crating all the folder structure or not.
    But my requirement is like assume class A has some methods like getMenuLink, setMenuLink.. And In class B i am calling some methods in class A and doing some manipulation in createLink method.
    Here class B does not have any interface. Not implementing  any interface. But I need to get class B refererence via sling.getService.
    I know that if we are using maven SCR plugin..we need to have @component, @service. And All java classes are not services. Will it work if I add activate, deactivate method in class B?
    Could you please tell me how to proceed next?
    Thanks,
    Anderson

  • Is 4/4 time the only time signiture available and what audio file type can will import using the media browser?

    Is 4/4 time the only time signiture available and what audio file type can will import using the media browser?

    latela33 wrote:
    Is 4/4 time the only time signiture available
    so far, yes, if you want more, be sure to let Apple know:
    http://www.bulletsandbones.com/GB/GBFAQ.html#sendfeedback
    (Let the page FULLY load. The link to your answer is at the top of your screen)
    latela33 wrote:
    what audio file type can will import using the media browser?
    44.1k/16-bit AIFF, WAV, or Caf files

  • How to import a class not in the package from a package

    how to import a class not in the package from a package?

    http://java.sun.com/docs/books/tutorial/java/interpack/usepkgs.html

  • Importing a .class file into my package?

    Hi. I'm making a java program but I need to use an external .class file to get variables and use methods from. Is it possible to "import" a class file into my package to be able to do so?
    Thanks

    Basically, for our last project we created a class
    that held the information about a year: how many days
    were in a month, how many months were in a year, etc.
    etc. For this project, we'll be having to use that
    same class to make a GUI calendar. Our teacher
    provided a class which he compiled for us to use in
    our projects incase our previous class had some flaws
    in it, which mine did. Unfortunately, it's in .class
    format and I don't know how to use it in my package!That's going to be a problem then. I would assume that it is going to have an API like your old one did. Same name and same methods etc. So do you know what the name and method signatures of your class were supposed to be?

  • How can we call a class file of one package for class file of another

    How can we call a class file of one package from class file of another package and both packages exist in a same folder

    How can we call a class file of one package from
    class file of another package and both packages exist
    in a same folder
    Luckily they don't so it's really not a problem after all.

  • How can I import a class in my program?

    In my program I want to use a class named "WordExtractor" that resides in a jar file named "poi-3.0.1-FINAL-20070705.jar".
    This jar file is stored on my computer under:
    D:\java_projects\Word Reader\poi-bin-3.0.1-FINAL-20070705\poi-3.0.1-FINAL\poi-3.0.1-FINAL-20070705.jar
    How can I import this class WordExtractor into my program?
    import ????????? ;

    In my program I want to use a class named
    "WordExtractor" that resides in a jar file named
    "poi-3.0.1-FINAL-20070705.jar".
    This jar file is stored on my computer under:
    D:\java_projects\Word
    Reader\poi-bin-3.0.1-FINAL-20070705\poi-3.0.1-FINAL\po
    i-3.0.1-FINAL-20070705.jar
    How can I import this class WordExtractor into my
    program?
    import ????????? ;After you add this jar file to the lib , you can use a tools(rar extracter tools) to extract "poi-3.0.1-FINAL-20070705.jar" file and find the position of that class "WordExtractor" .
    write "import XXXX.WordExtractor"into your program,"XXXX" is the position that you have found.

  • When try to import a packaged class it alway complain package does not exis

    when try to import a packaged class it alway complain package does not exisist??
    pls help

    when try to import a packaged class it alway complain
    package does not exisist??Even with the bootstrap classes? "import java.lang.Double;" gives you the same error?
    If not, please check your classpath.

  • How to import a class that have no package

    I have .class archive that i need to use in a web aplication on Tomcat. I put the class in the directory: <webapp>/WEB-INF/classes/.
    The class doesn�t have a package, so when i tried to import (..page Import=".....") it, tomcat gave me an error because is looking for a package instead of the class.
    then i try to use it without the import and tomcat gave another error because it can�t find the class.
    Any ideas??
    by the way.. I don�t have the source code, I just have the .class archive..
    thank you....

    Also, I already found that the class had no package. Then you are out of luck.
    As of java 1.4 you can no longer import classes that are not in a package. [url http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=c85f07c1ce8f344d787b7a5146d68:WuuT?bug_id=4361575 ] Full details here
    The only solutions I can think of
    1 - get the people who originally gave you the class to package it properly.
    2 - Decompile it to java code, Change the java code to put it in a package and recompile it. Depending on the complexity of the class this may or may not be a trivial operation.
    Good luck,
    evnafets

  • Can't import custom class!

    I have no idea why as3 is so stupid but it is and I have to
    deal with it. Basically, I creatd a Server.as file with the Server
    class but I can't import it into my .fla! Both are in the same
    folder and when I change properties to use AS2 it works! But when
    I'm doing it in as3 it doesn't work...

    you don't need to use a directory structure for your files'
    location, but you need to use the package designation in your class
    definitions.
    for example, if your Server class file is in the same
    directory with your fla, you can use:

  • Custom DSC can't find exception class, error about export-packages

    I've got a DSC which has a method that can throw two custom exceptions. It all works, and the exceptions show up available for handling in a process in Workbench, but the issue here is that the server.log has this error:
    2013-05-13 16:59:35,353 WARN  [com.adobe.workflow.AWS] An exception has been thrown for which the class information has not been exported in the service's export-packages, it is essential for the clients of the service to have the class information via export-packages to handle the exception.
    Yet I have added the exceptions' package to the export packages. And I also made a DataTypes entry for each of the two exceptions as well.
    Does anyone have an idea how I can get rid of this warning?
    Thanks,
    Jack

    You continue to use slash instead of dot.
    You did not follow any of my suggestions and still awarded me dukes,
    so I feel I have to make a last attempt.
    Here is what I have:
    D:\try>dir /s
    Volume in drive D is New Volume
    Volume Serial Number is 3ECC-CB52
    Directory of D:\try
    11/05/2007  12:18 PM    <DIR>          .
    11/05/2007  12:18 PM    <DIR>          ..
    11/05/2007  12:19 PM    <DIR>          a
                   0 File(s)              0 bytes
    Directory of D:\try\a
    11/05/2007  12:19 PM    <DIR>          .
    11/05/2007  12:19 PM    <DIR>          ..
    11/05/2007  12:19 PM    <DIR>          b
    11/05/2007  12:17 PM               808 MyClass.class
                   1 File(s)            808 bytes
    Directory of D:\try\a\b
    11/05/2007  12:19 PM    <DIR>          .
    11/05/2007  12:19 PM    <DIR>          ..
    11/02/2007  01:56 PM                11 Messages.properties
                   1 File(s)             11 bytes
         Total Files Listed:
                   2 File(s)            819 bytes
                   8 Dir(s)  70,889,848,832 bytes free
    D:\try>java a.MyClass
    value
    D:\try>Here is the code for MyClass:
    package a;
    import java.util.*;
    public class MyClass
      public static void main( String[] args ) throws Exception
        ResourceBundle rb = ResourceBundle.getBundle( "a.b.Messages" );
        System.out.println( rb.getString( "key") );
    }Here is the contents of Messages.properties:
    key = value

  • Compiling java package class referring a default package class.

    I am trying to compile a java class having a package defination referring a java class with a default package.
    The code for the default package class is .
    public class Test{.
    public static void main(String[] args){
    System.out.println("Hello World!");
    This class compiles fine.
    I have another class called PackJava, whose code is :
    package test;
    import Test;
    public class PackJava{
    public static void main(String[] args){
    Test test = new Test();
    System.out.println("Hello World!");
    I have Test file in the windows path
    D:\development\packagetest\example
    and the PackJava java file in the path
    D:\development\packagetest\example\test
    I have set the CLASSPATH environment varibale as
    D:\development\packagetest\example;.
    When I try to compile the PackJava from the
    D:\development\packagetest\example path giving the command as
    javac -classpath . test\PackJava.java
    or
    javac -classpath %CLASSPATH% test\PackJava.java
    it gives me error,
    Do any of you have an idea of the parameter i should pass
    to the -classpath option
    Thanks

    There is a way around all this. The classes in the default packages need to implement an interface with the methods require. The interface can be in any package you want ie. com.work.around.interf.MyInterface1. Next, make this interface available in a Singleton. - The only catch here is that, the main method must reside in default package as well. And o, on start of main, instantiate the class you want and put it in the singleton. There after, you may refer to it from the singleton.
    Enjoy.

Maybe you are looking for

  • .gif slide show?

    How to create a .gif slide show? I've currently animated a slide show as a quicktime movie (with hidden controller, autoplay & looped) which works pretty well. But I guess a .gif would be quicker and more universal? What software makes a .gif? Thanks

  • Can i purchase more than one subscription and use ...

    Hi, I have bought a 60min/month subscription and realised that it is too little. I finish 60 minutes before the month is up and have nothing left. I am paying for it in 3-month cycles.  Can i buy another same subscription on top of this one so that i

  • How to Create a PDF file from database package/procedure in 10g?

    Hi, Is there a way to create a pdf file in 10g Application Server using PL/SQL package/procedure in 10g database? Thanks in advance. Regards Vishnu Nekkanti

  • Problem XI -- R/3 System

    Hi, when I'm sending  an idoc-message from XI to R/3,  in the transaction "sxmb_moni" all seemed to work fine, but no idoc-message is receiving in the R/3-System. The RFC-Destination works fine and also the port and the local system is created. Can a

  • GSView doesn't work for me

    Hello everyone, I try to get Geany-latex with gsview working because I don't like xdvi. I made a very simple latex file, only containing "Hello World" \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \title{Auswertung des Fluglabors