Problem compiling ejb
I am trying to compile an ejb class and I get the error: javax.ejb package doesn't exist. I am using j2eesdk1.4. Can some one help?
Thanks in advance,
Ber
which jar file are you using ?
it should be something like - ejb2.0.jar.
Whatever jar you are using, just explode it and see if that package is in it or not.
regards
Similar Messages
-
Error compiling EJB.jar + cannot resolve symbol+while deploying
I am getting following
Error compiling EJB.jar , cannot resolve symbol ,Syntax error in source, am getting around 17 errors while deploying EAR generated using Jdev905 into standalone oc4jContainers(10g).
Can anyone please help me out where is the problem.
Regards,
Anupcannot resolve symbol ,Syntax error in source
indicates some jar file is not in the Classpath. Is j2ee.jar in the Classpath? -
I am having a problem compiling Servlets and EJB'S java files. I tried following the instructions in the "Writing Enterprise Applications" tutorial. I have my path variables setup in Windows. I just cant get the file to compile. Im getting errors and cant generate class files. Someone please help me.
C:\j2sdkee1.3.1\Beans>javac -classpath %CPATH% Calc.java CalcHome.java CalcBean.
java
Calc.java:3: package javax.ejb does not exist
import javax.ejb.EJBObject;
^
Calc.java:6: cannot resolve symbol
symbol : class EJBObject
location: interface Beans.Calc
public interface Calc extends EJBObject {
^
CalcHome.java:4: package javax.ejb does not exist
import javax.ejb.CreateException;
^
CalcHome.java:5: package javax.ejb does not exist
import javax.ejb.EJBHome;
^
CalcHome.java:7: cannot resolve symbol
symbol : class EJBHome
location: interface Beans.CalcHome
public interface CalcHome extends EJBHome {
^
CalcHome.java:8: cannot resolve symbol
symbol : class CreateException
location: interface Beans.CalcHome
Calc create() throws CreateException,
^
CalcBean.java:4: package javax.ejb does not exist
import javax.ejb.SessionBean;
^
CalcBean.java:5: package javax.ejb does not exist
import javax.ejb.SessionContext;
^
CalcBean.java:7: cannot resolve symbol
symbol : class SessionBean
location: class Beans.CalcBean
public class CalcBean implements SessionBean {
^
CalcBean.java:17: cannot resolve symbol
symbol : class SessionContext
location: class Beans.CalcBean
SessionContext ctx) { }
^
10 errors.
These are the compiler errors Im getting now. I have all my class variables setup. Why Iam I getting these errors when Im trying to compile these files? -
Problem compiling Abstract class
Hi
I have writting an abstract class Sort.java and another class BubbleSort.java. I am having problems compiling BubbleSort.java class.
The following is the error message
BubbleSort.java:8: missing method body, or declare abstract
public int doSorting(int[] array);
^
BubbleSort.java:11: return outside method
return num;
^
The following is the code
public abstract class Sort
public abstract int doSorting(int[] array);
}// End of class
public class BubbleSort extends Sort
private int num = 2;
public int doSorting(int[] array);
num = num + 2;
return num;
} // end of classRemove the semi-colon.
public int doSorting(int[] array); // <------- there -
Problem with EJB skeleton classloader
Hi
We have been migrating an enterprise application from Weblogic 7 to 9.2 and experienced strange problem with EJBs. Our EAR contains (beside the other elements) an EJB module with EJBs and some common POJO classes inside. At the deploy and run phase everything seems working fine, but when the remote client invokes a method which receives one of the common classes as a parameter we get ClassNotFoundException on the server side (talking precisely, the exception is thrown from the EJB skeleton, trying to unmarshall the parameter).
It seems that our EJB's skeletons do not see the classes from EAR. We have tried moving the common classes to the APP-INF/lib directory or placing them at the root of EAR archive and adding reference in Manifest file of EJB module and it won't help.
The only workaround we've found is to add the missing classes to the server classpath but this is unacceptable (however, it works).
We are not using any custom classloader hierarchy.
The other JARs have no problem loading the content of our EJB module (including the common classes, which cause the problem).
So, why is the RMI classloader ommiting our application contents?The problem was fixed by upgrading to version 9.2.1
-
I've been trying to do the tutorials in a book titled Apache Jakarta-Tomcat as part of my introduction to JSP. I'm new to Java but do know the basics. I have on my machine Java 1.3, Java 1.4, Java FrameWorks 2.1 and Jython 2.1 on Win2000 Pro. So enough about my configuration. I have never worked with packages also.
I downloaded the files from the books site due to the fact I make a lot of typos when hand coding Java (I've become a pretty good debugger of my own code). But everytime I go to compile the *.java I get error messages. So below you will find HelloTag.java and beneath that the error messages that are thrown when I try and compile it. I tested other bits of *.java and have had no problem compiling them. Is there a JSP module I'm missing?
Am I doing something wrong or am I missing something from my configuration.
Marijan Madunic
package chapter2;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.tagext.TagSupport;
public class HelloTag extends TagSupport
public void HelloTag() {
// Method called when the closing hello tag is encountered
public int doEndTag() throws JspException {
try {
// We use the pageContext to get a Writer
// We then print the text string Hello
pageContext.getOut().print("Hello");
catch (Exception e) {
throw new JspTagException(e.getMessage());
// We want to return SKIP_BODY because this Tag does not support
// a Tag Body
return SKIP_BODY;
public void release() {
// Call the parent's release to release any resources
// used by the parent tag.
// This is just good practice for when you start creating
// hierarchies of tags.
super.release();
D:\Java\JDK 1.3\bin>javac HelloTag.java
HelloTag.java:3: cannot resolve symbol
symbol : class JspException
location: package jsp
import javax.servlet.jsp.JspException;
^
HelloTag.java:4: cannot resolve symbol
symbol : class JspTagException
location: package jsp
import javax.servlet.jsp.JspTagException;
^
HelloTag.java:5: cannot resolve symbol
symbol : class TagSupport
location: package tagext
import javax.servlet.jsp.tagext.TagSupport;
^
HelloTag.java:7: cannot resolve symbol
symbol : class TagSupport
location: class chapter2.HelloTag
public class HelloTag extends TagSupport
^
HelloTag.java:14: cannot resolve symbol
symbol : class JspException
location: class chapter2.HelloTag
public int doEndTag() throws JspException {
^
HelloTag.java:20: cannot resolve symbol
symbol : variable pageContext
location: class chapter2.HelloTag
pageContext.getOut().print("Hello");
^
HelloTag.java:24: cannot resolve symbol
symbol : class JspTagException
location: class chapter2.HelloTag
throw new JspTagException(e.getMessage());
^
HelloTag.java:28: cannot resolve symbol
symbol : variable SKIP_BODY
location: class chapter2.HelloTag
return SKIP_BODY;
^
HelloTag.java:37: cannot resolve symbol
symbol : variable super
location: class chapter2.HelloTag
super.release();
^
9 errorsWell, it looks like you've not got the servlet development kit JAR on your classpath. I think it'll probably be called servlet.jar on your system. Add that to the classpath if it's not already there.
Incidentally, you've bumped into one of the areas Java's slightly lenient - declaring a method that looks like a constructor:
public HelloTag() { }
public void HelloTag() { }The first is a constructor, the second is a normal method. I'm assuming you intended to have the former instead of the latter.
Anyway, hope this helps. -
Problems compiling Zaptel package [SOLVED-ISH]
Hey guys, I'm on an Arch64 system and I'm having problems compiling Zaptel (a dependancy for Asterisk).
Here's the pastebin of the errors I get from the Zaptel makefile: http://pastebin.com/776475
Here's my analysis so far:
There's a line in the Makefile for the zaptel driver that goes like this:
make -C /lib/modules/2.6.17-ARCH/build/ SUBDIRS=/home/woogie/zaptel/src/zaptel-1.2.8 modules
This line activates the kernel's makefile in order to build modules, but specifies that the source directory for zaptel should be included in the make process.
Then things go down the proverbial drain - linux/err_kernel_only.h gets included in the build process, which is designed to do one thing only - stop the build process. So I'm not entirely too sure what's going on here. Is there something misconfigured on my system, or is the Zaptel build system flawed somehow, such that I need to compensate for it?Further information:
I've manually run the problematic make command from /lib/modules/2.6.17-ARCH/build on my own. After reading the kernel makefile documentation, I've learned of the V=1 flag to show me exactly what's going on. The failing command is this one:
gcc -Wp,-MD,/home/cestus/zaptel/src/zaptel-1.2.8/.zaptel.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-unknown-linux-gnu/4.1.1/include -D__
KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O2
-fomit-frame-pointer -m64 -mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks -Wno-sign-compare -fno-asynchronous-unwind-tables -fun
it-at-a-time -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wdeclaration-after-statement -Wno-pointer-sign -I. -Iinclude -O4 -g -Wall -DBUILDING_T
ONEZONE -m64 -DSTANDALONE_ZAPATA -DZAPTEL_CONFIG="/etc/zaptel.conf" -DHOTPLUG_FIRMWARE -I/home/cestus/zaptel/src/zaptel-1.2.8//include
-I/home/cestus/zaptel/src/zaptel-1.2.8//include/oct6100api -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(zaptel)" -D"KBUIL
D_MODNAME=KBUILD_STR(zaptel)" -c -o /home/cestus/zaptel/src/zaptel-1.2.8/zaptel.o /home/cestus/zaptel/src/zaptel-1.2.8/zaptel.c
I've figured out that the bit which causes the failure is "-include include/linux/autoconf.h", because autoconf.h just includes the "err_kernel_only" header automatically, which then slays the build process. And I've also discovered that the Zaptel devs are uber-leet. They've found the magical -O4 level in gcc. You know, the one above 3, where the supported optimization levels in gcc are -O, -Os, -O2 and -O3 -
i'm new to java, just went through the tutorial just now..
tried compilling my program the first time on XP, but the system doesn't recognise the command JAVAC,
i've installed the java compiler (j2re-1_4_1_01-windows-i586.exe)
but it still isn't working.. any help?
thanks!then again.. i'm still having problems compiling..
i managed to install the right sdk, but.. i have to run the command javac from the bin directory.. else the command prompt won't recognise it..
anyway to get around this?
also.. because of this.. i can't compile my program.. :( -
Having problems compiling script
I am rather new to java an started a couple of days ago and I ran into a problem compiling this script in the command line
class VariableDemo {
public static void main (String args[]) {
int num = 1000;
System.out.println (num + " is the value of num") ;
At first I forgot to capitolize the 'S' in System (which is why I was getting errors) but after I had corrected it , I still could not get it to compile in a command prompt
even after I corrected my mistakes, I still get this error:
error: cannot read: VariableDemo.java
1 error
When I ran it through JCreator it compiled it just fine and found no errors. SO I just want to know if it is some thing that has to do with the command line or is there an error I am not seeing?
I am running Windows XP Pro with service pack 2 and using JCreator 3.50.010Sorry, I am new to this I just called it script out of ignorance, but, yes it is in the same directory. I even Pathed it out again to be sure.
-
Compiling EJB files and Deployment Discriptor
Hi,
Could any body tell me step by step process of compiling EJB files and building deployment descriptor. I want to learn from scrap. I search on web but not found material that I need.
Actually I've made a simple EJB example now I want to compile and want to write a deployment descriptor for that using ant or javac.
You can also refer me tutorial describing the process form scrap.
Looking forward,
Regards,
AbbasiAlthough you could deploy each bean in a different .jar file , deploying them
together in an jar file produces a classloader arrangement that allows one ejb
class to refer to another ejb class. Packaging ejb jar files in a ear file produces
a common classloader for the ejb jar files.
"Gary Gu" <[email protected]> wrote:
>
Hi,
To build ejb jar files, we can include all beans (including bean class,
home,
inteface, and other java classes) of the application into one jar file.
Or we
can make ONE jar file for EACH bean (including only bean class, home
and interface.
NOT other dependent classes that will sit in weblogic server classpath).
I would like to know any disadvantage for second method in terms of memory,
class
loading, etc. Or any advantage for the second method
Thanks -
How to compile .ejb files
Hi,
I want to compile .ejb files generated through weblogic workshop 8.1, jar it and need to deploy it through Ant scripts(all three tasks). Can anyone help me in doing that?
Thanks,
Adwitiya Nigam...Compile with javac task.
<javac classpath="" destdir="" includes="" srcdir=""/>
Create a jar file with the jar task.
<jar basedir="${build}" includes="" jarfile="ejb.jar"/>
Copy jar file to the deploy directoy applications.
<copy file="${dist}/ejb.jar" todir="${weblogic.deploy.dir}"/> -
hello.
this is james mcfadden. i'm having problems compiling the Demo.java program. the Demo.java program is shown below along with the MediaPanel.java and MediaTest.java programs. when i compile the Demo.java program i get the following errors. i really need help in getting rid of these errors.
----jGRASP exec: javac -g X:\CP4B Project\Demo.java
Demo.java:297: cannot find symbol
symbol : class Media
location: class Demo
MediaTest media=new Media();
^
Demo.java:301: cannot find symbol
symbol : class Media
location: class Demo
MediaTest media=new Media();
^
Demo.java:305: cannot find symbol
symbol : class Media
location: class Demo
MediaTest media=new Media();
^
3 errors
----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.
//Written by:Seamus McFadden
//Class:CP4B
//Program Number:1
//Program Name:Demo.java
//Description:
//Supervisor:Gerard McCloskey
import java.awt.*;//Contains all of the classes for creating user interfaces and for painting graphics and images
import java.awt.event.*;//Provides interfaces and classes for dealing with different types of events fired by AWT components
import javax.swing.*;//Provides a set of lightweight components that, to the maximum degree possible, work the same on all platforms
public class Demo extends JFrame{
public static void main(String[] args){
int choice=-1;//a variable of type int that is set to -1
choice=getChoice();//invokes the method getChoice()
if(choice!=0){
getSelected(choice);//invokes the method getSelected(choice)
}//end if
}//end main
public static int getChoice(){
String choice;//a variable of type string
int ch;//a variable of type int
choice=JOptionPane.showInputDialog(null,
"1. Product Menu\n" +
"2. Member Menu\n" +
"3. Rental Menu\n" +
"4. Media Menu\n" +
"5. Log Off\n\n" +
"Enter your choice");//asks the user for some input
ch=Integer.parseInt(choice);//a class that wraps a value of the primitive type int in an object
return ch;//a method that returns an integer value
}//end getChoice
public static void getSelected(int choice){
if(choice == 1) {
product();
}//end if
if(choice==2){
member();
}//end if
if(choice==3){
rental();
}//end if
if(choice==4){
media();
}//end if
if(choice==5){
LogOff logoff=new LogOff();
}//end if
else{
ErrorMessage error=new ErrorMessage();
}//end getSelected
public static void product(){
int productChoice=-1;//a variable of type int that is set to -1
productChoice=getProductChoice();//invokes the method getChoice()
if(productChoice!=0){
getProductSelected(productChoice);//invokes the method getSelected(choice)
}//end if
getChoice();
public static void member(){
int memberChoice=-1;//a variable of type int that is set to -1
memberChoice=getMemberChoice();//invokes the method getChoice()
if(memberChoice!=0){
getMemberSelected(memberChoice);//invokes the method getSelected(choice)
}//end if
getChoice();
public static void rental(){
int rentalChoice=-1;//a variable of type int that is set to -1
rentalChoice=getRentalChoice();//invokes the method getChoice()
if(rentalChoice!=0){
getRentalSelected(rentalChoice);//invokes the method getSelected(choice)
}//end if
getChoice();
public static void media(){
int mediaChoice=-1;//a variable of type int that is set to -1
mediaChoice=getMediaChoice();//invokes the method getChoice()
if(mediaChoice!=0){
getMediaSelected(mediaChoice);//invokes the method getSelected(choice)
}//end if
getChoice();
public static int getProductChoice(){
String productChoice;//a variable of type string
int pch;//a variable of type int
productChoice=JOptionPane.showInputDialog(null,
"1. Add product details\n" +
"2. View product details\n" +
"3. Edit product details\n" +
"4. Delete product details\n" +
"5. Return to main menu\n\n" +
"Enter your choice");//asks the user for some input
pch=Integer.parseInt(productChoice);//a class that wraps a value of the primitive type int in an object
return pch;//a method that returns an integer value
}//end getProductChoice
public static int getMemberChoice(){
String memberChoice;//a variable of type string
int mch;//a variable of type int
memberChoice=JOptionPane.showInputDialog(null,
"1. Add member details\n" +
"2. View member details\n" +
"3. Edit member details\n" +
"4. Delete member details\n" +
"5. Return to main menu\n\n" +
"Enter your choice");//asks the user for some input
mch=Integer.parseInt(memberChoice);//a class that wraps a value of the primitive type int in an object
return mch;//a method that returns an integer value
}//end getMemberChoice
public static int getRentalChoice(){
String rentalChoice;//a variable of type string
int rch;//a variable of type int
rentalChoice=JOptionPane.showInputDialog(null,
"1. Add rental details\n" +
"2. View rental details\n" +
"3. Edit rental details\n" +
"4. Delete rental details\n" +
"5. Return to main menu\n\n" +
"Enter your choice");//asks the user for some input
rch=Integer.parseInt(rentalChoice);//a class that wraps a value of the primitive type int in an object
return rch;//a method that returns an integer value
}//end getRentalChoice
public static int getMediaChoice(){
String mediaChoice;//a variable of type string
int mtch;//a variable of type int
mediaChoice=JOptionPane.showInputDialog(null,
"1. Listen to songs\n" +
"2. View movie previews\n" +
"3. View game previews\n" +
"4. Return to main menu\n\n" +
"Enter your choice");//asks the user for some input
mtch=Integer.parseInt(mediaChoice);//a class that wraps a value of the primitive type int in an object
return mtch;//a method that returns an integer value
}//end getMediaChoice
public static void getProductSelected(int productChoice){
if(productChoice==1){
addProducts();
}//end if
if(productChoice==2){
viewProducts();
}//end if
if(productChoice==3){
editProducts();
}//end if
if(productChoice==4){
deleteProducts();
}//end if
else{
ErrorMessage error=new ErrorMessage();
}//end getProductSelected
public static void getMemberSelected(int memberChoice){
if(memberChoice==1){
addMembers();
}//end if
if(memberChoice==2){
viewMembers();
}//end if
if(memberChoice==3){
editMembers();
}//end if
if(memberChoice==4){
deleteMembers();
}//end if
else{
ErrorMessage error=new ErrorMessage();
}//end getMemberSelected
public static void getRentalSelected(int rentalChoice){
if(rentalChoice==1){
addRentals();
}//end if
if(rentalChoice==2){
viewRentals();
}//end if
if(rentalChoice==3){
editRentals();
}//end if
if(rentalChoice==4){
deleteRentals();
}//end if
else{
ErrorMessage error=new ErrorMessage();
}//end getRentalSelected
public static void getMediaSelected(int mediaChoice){
if(mediaChoice==1){
hearSongs();
}//end if
if(mediaChoice==2){
viewMovies();
}//end if
if(mediaChoice==3){
viewGames();
}//end if
else{
ErrorMessage error=new ErrorMessage();
}//end getMediaSelected
public static void addProducts(){
ProductForm product=new ProductForm();
product.getInput();
product.setVisible(true);
public static void viewProducts(){
DatabaseTest tt=new DatabaseTest();
tt.setVisible(true);
public static void editProducts(){
ProductForm product=new ProductForm();
product.getInput();
product.setVisible(true);
public static void deleteProducts(){
ProductForm product=new ProductForm();
product.setVisible(true);
public static void addMembers(){
MemberForm member=new MemberForm();
member.getInput();
member.setVisible(true);
public static void viewMembers(){
DatabaseTest tt=new DatabaseTest();
tt.setVisible(true);
public static void editMembers(){
MemberForm member=new MemberForm();
member.getInput();
member.setVisible(true);
public static void deleteMembers(){
MemberForm member=new MemberForm();
member.setVisible(true);
public static void addRentals(){
RentalForm rental=new RentalForm();
rental.getInput();
rental.setVisible(true);
public static void viewRentals(){
DatabaseTest tt=new DatabaseTest();
tt.setVisible(true);
public static void editRentals(){
RentalForm rental=new RentalForm();
rental.getInput();
rental.setVisible(true);
public static void deleteRentals(){
RentalForm rental=new RentalForm();
rental.setVisible(true);
public static void hearSongs(){
MediaTest media=new Media();
public static void viewMovies(){
MediaTest media=new Media();
public static void viewGames(){
MediaTest media=new Media();
}//end class Demo
import java.awt.BorderLayout;
import java.awt.Component;
import java.io.IOException;
import java.net.URL;
import javax.media.CannotRealizeException;
import javax.media.Manager;
import javax.media.NoPlayerException;
import javax.media.Player;
import javax.swing.JPanel;
public class MediaPanel extends JPanel{
public MediaPanel(URL mediaURL){
setLayout(new BorderLayout());//use a BorderLayout
//Use lightweight components for Swing compatibility
Manager.setHint(Manager.LIGHTWEIGHT_RENDERER,true);
try{
//create a player to play the media specified in the URL
Player mediaPlayer=Manager.createRealizedPlayer(mediaURL);
//get the components for the video and the playback controls
Component video=mediaPlayer.getVisualComponent();
Component controls=mediaPlayer.getControlPanelComponent();
if(video!=null)
add(video,BorderLayout.CENTER);//add video component
if(controls!=null)
add(controls,BorderLayout.SOUTH);//add controls
mediaPlayer.start();//start playing the media clip
}//end try
catch(NoPlayerException noPlayerException){
System.err.println("No media player found");
}//end catch
catch(CannotRealizeException cannotRealizeException){
System.err.println("Could not realize media player");
}//end catch
catch(IOException iOException){
System.err.println("Error reading from the source");
}//end catch
}//end MediaPanel constructor
}//end class MediaPanel
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
public class MediaTest{
//launch the application
public static void main(String args[]){
//create a file chooser
JFileChooser fileChooser=new JFileChooser();
//show open file dialog
int result=fileChooser.showOpenDialog(null);
if(result==JFileChooser.APPROVE_OPTION){//user chose a file
URL mediaURL=null;
try{
//get the file as URL
mediaURL=fileChooser.getSelectedFile().toURL();
}//end try
catch(MalformedURLException malformedURLException){
System.err.println("Could not create URL for the file");
}//end catch
if(mediaURL!=null) {//only display if there is a valid URL
JFrame mediaTest=new JFrame("Media Tester");
mediaTest.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
MediaPanel mediaPanel=new MediaPanel(mediaURL);
mediaTest.add(mediaPanel);
mediaTest.setSize(300,300);
mediaTest.setVisible(true);
}//end inner if
}//end outer if
}//end main
}//end class MediaTesthello.
this is james mcfadden. thanks for the reply. i did what you told me to do, but i am still having trouble trying to use the 2 JMF programs (MediaPanel.java and MediaTest.java) with the Demo.java program. the Demo.java program compiles and runs ok, but when i press 1 (for listening to songs) in the media menu i get a JOptionPane (An Error Message) displayed on screen. how can i fix this problem?
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Demo extends JFrame{
public static void main(String[] args){
int choice=-1;//a variable of type int that is set to -1
choice=getChoice();//invokes the method getChoice()
if(choice!=0){
getSelected(choice);//invokes the method getSelected(choice)
}//end if
}//end main
public static int getChoice(){
String choice;//a variable of type string
int ch;//a variable of type int
choice=JOptionPane.showInputDialog(null,
"1. Product Menu\n" +
"2. Member Menu\n" +
"3. Rental Menu\n" +
"4. Media Menu\n" +
"5. Log Off\n\n" +
"Enter your choice");//asks the user for some input
ch=Integer.parseInt(choice);//a class that wraps a value of the primitive type int in an object
return ch;//a method that returns an integer value
}//end getChoice
public static void getSelected(int choice){
if(choice == 1) {
product();
}//end if
if(choice==2){
member();
}//end if
if(choice==3){
rental();
}//end if
if(choice==4){
media();
}//end if
if(choice==5){
LogOff logoff=new LogOff();
}//end if
else{
JOptionPane.showMessageDialog(null,"Error\n\nInvalid options\nPlease choose 1, 2, 3, 4 or 5 on the main menu\nPlease choose 1, 2, 3, 4 or 5 on the product menu\nPlease choose 1, 2, 3, 4 or 5 on the member menu\nPlease choose 1, 2, 3, 4 or 5 on the rental menu\nPlease choose 1, 2, 3 or 4 on the media menu");
System.exit(0);
}//end getSelected
public static void product(){
int productChoice=-1;//a variable of type int that is set to -1
productChoice=getProductChoice();//invokes the method getChoice()
if(productChoice!=0){
getProductSelected(productChoice);//invokes the method getSelected(choice)
}//end if
getChoice();
public static void member(){
int memberChoice=-1;//a variable of type int that is set to -1
memberChoice=getMemberChoice();//invokes the method getChoice()
if(memberChoice!=0){
getMemberSelected(memberChoice);//invokes the method getSelected(choice)
}//end if
getChoice();
public static void rental(){
int rentalChoice=-1;//a variable of type int that is set to -1
rentalChoice=getRentalChoice();//invokes the method getChoice()
if(rentalChoice!=0){
getRentalSelected(rentalChoice);//invokes the method getSelected(choice)
}//end if
getChoice();
public static void media(){
int mediaChoice=-1;//a variable of type int that is set to -1
mediaChoice=getMediaChoice();//invokes the method getChoice()
if(mediaChoice!=0){
getMediaSelected(mediaChoice);//invokes the method getSelected(choice)
}//end if
getChoice();
public static int getProductChoice(){
String productChoice;//a variable of type string
int pch;//a variable of type int
productChoice=JOptionPane.showInputDialog(null,
"1. Add product details\n" +
"2. View product details\n" +
"3. Edit product details\n" +
"4. Delete product details\n" +
"5. Return to main menu\n\n" +
"Enter your choice");//asks the user for some input
pch=Integer.parseInt(productChoice);//a class that wraps a value of the primitive type int in an object
return pch;//a method that returns an integer value
}//end getProductChoice
public static int getMemberChoice(){
String memberChoice;//a variable of type string
int mch;//a variable of type int
memberChoice=JOptionPane.showInputDialog(null,
"1. Add member details\n" +
"2. View member details\n" +
"3. Edit member details\n" +
"4. Delete member details\n" +
"5. Return to main menu\n\n" +
"Enter your choice");//asks the user for some input
mch=Integer.parseInt(memberChoice);//a class that wraps a value of the primitive type int in an object
return mch;//a method that returns an integer value
}//end getMemberChoice
public static int getRentalChoice(){
String rentalChoice;//a variable of type string
int rch;//a variable of type int
rentalChoice=JOptionPane.showInputDialog(null,
"1. Add rental details\n" +
"2. View rental details\n" +
"3. Edit rental details\n" +
"4. Delete rental details\n" +
"5. Return to main menu\n\n" +
"Enter your choice");//asks the user for some input
rch=Integer.parseInt(rentalChoice);//a class that wraps a value of the primitive type int in an object
return rch;//a method that returns an integer value
}//end getRentalChoice
public static int getMediaChoice(){
String mediaChoice;//a variable of type string
int mtch;//a variable of type int
mediaChoice=JOptionPane.showInputDialog(null,
"1. Listen to songs\n" +
"2. View movie previews\n" +
"3. View game previews\n" +
"4. Return to main menu\n\n" +
"Enter your choice");//asks the user for some input
mtch=Integer.parseInt(mediaChoice);//a class that wraps a value of the primitive type int in an object
return mtch;//a method that returns an integer value
}//end getMediaChoice
public static void getProductSelected(int productChoice){
if(productChoice==1){
addProducts();
}//end if
if(productChoice==2){
viewProducts();
}//end if
if(productChoice==3){
editProducts();
}//end if
if(productChoice==4){
deleteProducts();
}//end if
else{
JOptionPane.showMessageDialog(null,"Error\n\nInvalid options\nPlease choose 1, 2, 3, 4 or 5 on the main menu\nPlease choose 1, 2, 3, 4 or 5 on the product menu\nPlease choose 1, 2, 3, 4 or 5 on the member menu\nPlease choose 1, 2, 3, 4 or 5 on the rental menu\nPlease choose 1, 2, 3 or 4 on the media menu");
System.exit(0);
}//end getProductSelected
public static void getMemberSelected(int memberChoice){
if(memberChoice==1){
addMembers();
}//end if
if(memberChoice==2){
viewMembers();
}//end if
if(memberChoice==3){
editMembers();
}//end if
if(memberChoice==4){
deleteMembers();
}//end if
else{
JOptionPane.showMessageDialog(null,"Error\n\nInvalid options\nPlease choose 1, 2, 3, 4 or 5 on the main menu\nPlease choose 1, 2, 3, 4 or 5 on the product menu\nPlease choose 1, 2, 3, 4 or 5 on the member menu\nPlease choose 1, 2, 3, 4 or 5 on the rental menu\nPlease choose 1, 2, 3 or 4 on the media menu");
System.exit(0);
}//end getMemberSelected
public static void getRentalSelected(int rentalChoice){
if(rentalChoice==1){
addRentals();
}//end if
if(rentalChoice==2){
viewRentals();
}//end if
if(rentalChoice==3){
editRentals();
}//end if
if(rentalChoice==4){
deleteRentals();
}//end if
else{
JOptionPane.showMessageDialog(null,"Error\n\nInvalid options\nPlease choose 1, 2, 3, 4 or 5 on the main menu\nPlease choose 1, 2, 3, 4 or 5 on the product menu\nPlease choose 1, 2, 3, 4 or 5 on the member menu\nPlease choose 1, 2, 3, 4 or 5 on the rental menu\nPlease choose 1, 2, 3 or 4 on the media menu");
System.exit(0);
}//end getRentalSelected
public static void getMediaSelected(int mediaChoice){
if(mediaChoice==1){
hearSongs();
}//end if
if(mediaChoice==2){
viewMovies();
}//end if
if(mediaChoice==3){
viewGames();
}//end if
else{
JOptionPane.showMessageDialog(null,"Error\n\nInvalid options\nPlease choose 1, 2, 3, 4 or 5 on the main menu\nPlease choose 1, 2, 3, 4 or 5 on the product menu\nPlease choose 1, 2, 3, 4 or 5 on the member menu\nPlease choose 1, 2, 3, 4 or 5 on the rental menu\nPlease choose 1, 2, 3 or 4 on the media menu");
System.exit(0);
}//end getMediaSelected
public static void addProducts(){
ProductForm product=new ProductForm();
product.getInput();
product.setVisible(true);
public static void viewProducts(){
DatabaseTest tt=new DatabaseTest();
tt.setVisible(true);
public static void editProducts(){
ProductForm product=new ProductForm();
product.getInput();
product.setVisible(true);
public static void deleteProducts(){
ProductForm product=new ProductForm();
product.setVisible(true);
public static void addMembers(){
MemberForm member=new MemberForm();
member.getInput();
member.setVisible(true);
public static void viewMembers(){
DatabaseTest tt=new DatabaseTest();
tt.setVisible(true);
public static void editMembers(){
MemberForm member=new MemberForm();
member.getInput();
member.setVisible(true);
public static void deleteMembers(){
MemberForm member=new MemberForm();
member.setVisible(true);
public static void addRentals(){
RentalForm rental=new RentalForm();
rental.getInput();
rental.setVisible(true);
public static void viewRentals(){
DatabaseTest tt=new DatabaseTest();
tt.setVisible(true);
public static void editRentals(){
RentalForm rental=new RentalForm();
rental.getInput();
rental.setVisible(true);
public static void deleteRentals(){
RentalForm rental=new RentalForm();
rental.setVisible(true);
public static void hearSongs(){
MediaTest media=new MediaTest();
public static void viewMovies(){
MediaTest media=new MediaTest();
public static void viewGames(){
MediaTest media=new MediaTest();
}//end class Demo
import java.awt.BorderLayout;
import java.awt.Component;
import java.io.IOException;
import java.net.URL;
import javax.media.CannotRealizeException;
import javax.media.Manager;
import javax.media.NoPlayerException;
import javax.media.Player;
import javax.swing.JPanel;
public class MediaPanel extends JPanel{
public MediaPanel(URL mediaURL){
setLayout(new BorderLayout());//use a BorderLayout
//Use lightweight components for Swing compatibility
Manager.setHint(Manager.LIGHTWEIGHT_RENDERER,true);
try{
//create a player to play the media specified in the URL
Player mediaPlayer=Manager.createRealizedPlayer(mediaURL);
//get the components for the video and the playback controls
Component video=mediaPlayer.getVisualComponent();
Component controls=mediaPlayer.getControlPanelComponent();
if(video!=null)
add(video,BorderLayout.CENTER);//add video component
if(controls!=null)
add(controls,BorderLayout.SOUTH);//add controls
mediaPlayer.start();//start playing the media clip
}//end try
catch(NoPlayerException noPlayerException){
System.err.println("No media player found");
}//end catch
catch(CannotRealizeException cannotRealizeException){
System.err.println("Could not realize media player");
}//end catch
catch(IOException iOException){
System.err.println("Error reading from the source");
}//end catch
}//end MediaPanel constructor
}//end class MediaPanel
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
public class MediaTest{
//launch the application
public static void main(String args[]){
//create a file chooser
JFileChooser fileChooser=new JFileChooser();
//show open file dialog
int result=fileChooser.showOpenDialog(null);
if(result==JFileChooser.APPROVE_OPTION){//user chose a file
URL mediaURL=null;
try{
//get the file as URL
mediaURL=fileChooser.getSelectedFile().toURL();
}//end try
catch(MalformedURLException malformedURLException){
System.err.println("Could not create URL for the file");
}//end catch
if(mediaURL!=null) {//only display if there is a valid URL
JFrame mediaTest=new JFrame("Media Tester");
mediaTest.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
MediaPanel mediaPanel=new MediaPanel(mediaURL);
mediaTest.add(mediaPanel);
mediaTest.setSize(300,300);
mediaTest.setVisible(true);
}//end inner if
}//end outer if
}//end main
}//end class MediaTest -
Problems compiling at91 driver for samutils-0.2.1
Hello All!
I'm having problems compiling the usb driver for sam7 tools. I am receiving the following errors:
make -C /lib/modules/2.6.39-ARCH/build SUBDIRS=/home/bailey/Source/sam7utils-0.2.1/driver modules
make[1]: Entering directory `/usr/src/linux-2.6.39-ARCH'
CC [M] /home/bailey/Source/sam7utils-0.2.1/driver/at91.o
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c: In function âat91_write_bulk_callbackâ:
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c:154:2: error: implicit declaration of function âusb_buffer_freeâ [-Werror=implicit-function-declaration]
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c:140:19: warning: variable âdevâ set but not used [-Wunused-but-set-variable]
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c: In function âat91_writeâ:
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c:178:2: error: implicit declaration of function âusb_buffer_allocâ [-Werror=implicit-function-declaration]
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c:178:6: warning: assignment makes pointer from integer without a cast [enabled by default]
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c:192:6: warning: passing argument 6 of âusb_fill_bulk_urbâ from incompatible pointer type [enabled by default]
include/linux/usb.h:1266:20: note: expected âusb_complete_tâ but argument is of type âvoid (*)(struct urb *, struct pt_regs *)â
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c: In function âat91_probeâ:
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c:305:2: error: implicit declaration of function âinfoâ [-Werror=implicit-function-declaration]
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c: In function âat91_disconnectâ:
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c:320:2: error: implicit declaration of function âlock_kernelâ [-Werror=implicit-function-declaration]
/home/bailey/Source/sam7utils-0.2.1/driver/at91.c:328:2: error: implicit declaration of function âunlock_kernelâ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [/home/bailey/Source/sam7utils-0.2.1/driver/at91.o] Error 1
make[1]: *** [_module_/home/bailey/Source/sam7utils-0.2.1/driver] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.39-ARCH'
make: *** [default] Error 2
output of uname -a
2.6.39-ARCH #1 SMP PREEMPT Mon Jun 27 22:01:13 CEST 2011 i686 Intel(R) Pentium(R) 4 CPU 1.50GHz GenuineIntel GNU/Linux
I am running gcc 4.6.1-1 and have installed kernel26headers. If there is any info I'm missing plz let me know.
Thanks for your help in advanceThank you for the reply, I noticed that the post below (its for Ubuntu) shows the gcc version to be 4.0.3
[link]http://www.makingthings.com/documentati … -sam7utils[/link]
I poked around the Makefile in /usr/src/linux-2.6.39 and got rid of "-Wall" and "-Wno-implicit-function-declaration"
it compiled with the following warnings:
make[1]: Entering directory `/usr/src/linux-2.6.39-ARCH'
Building modules, stage 2.
MODPOST 1 modules
WARNING: "info" [/home/bailey/Source/sam7utils-0.2.1/driver/at91.ko] undefined!
WARNING: "unlock_kernel" [/home/bailey/Source/sam7utils-0.2.1/driver/at91.ko] undefined!
WARNING: "lock_kernel" [/home/bailey/Source/sam7utils-0.2.1/driver/at91.ko] undefined!
WARNING: "usb_buffer_alloc" [/home/bailey/Source/sam7utils-0.2.1/driver/at91.ko] undefined!
WARNING: "usb_buffer_free" [/home/bailey/Source/sam7utils-0.2.1/driver/at91.ko] undefined!
CC /home/bailey/Source/sam7utils-0.2.1/driver/at91.mod.o
LD [M] /home/bailey/Source/sam7utils-0.2.1/driver/at91.ko
make[1]: Leaving directory `/usr/src/linux-2.6.39-ARCH'
but when I tried to install, the output was
insmod: error inserting 'at91.ko': -1 Unknown symbol in module
Unfortunately, I tried grabbing the package from the AUR, but I ran into the same issues. Seems the only common factor in this process is gcc.
Thanks for the help -
Problems compiling with packages
Hi,
I wonder if anyone could help me.
I have had problems compiling using a package. I have altered the classpath in autoexec.bat with:
SET CLASSPATH=%classpath%;C:\jdk1.3.1_02\classes;.
the package class files are stored in C:\jdk1.3.1_02\classes\helliker\id3
and I have imported the class with:
import helliker.id3.*;
I am getting the following error:
C:\My Documents\Uni work\mp3 project\test\Driver.java:1: package helliker.id3 does not exist
import helliker.id3.*;
^
Can anybody help?
Thanks,
DavePerhaps the version of Windows you are using does not use autoexec.bat. For example, in NT and XP, you set Classpath using ControlPanel/System/Advanced/Environment Variables.
Perhaps there is a typo in your Classpath, for example an extra space.
On a command line, try this:
javac -classpath C:\jdk1.3.1_02\classes C:\My Documents\Uni work\mp3 project\test\Driver.java
If that works, then definitely Classpath is not set as you think it is. -
Error compiling EJB-QL statement
I run jboss 3.2.2 with Tomcat.
When I deploy a CMP EJB I get the
error below. Do you have any idea of
what could be the reason of the message?
Thanks.
U.
2003-12-03 15:28:21,437 ERROR [org.jboss.ejb.EntityContainer] Starting failed
org.jboss.deployment.DeploymentException:
Error compiling EJB-QL statement '
select object(o) from myobject o where o.mypro BETWEEN ?1 and ?2
'; - nested throwable:
(org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "BETWEEN" at line 1, column 62.
Was expecting one of:
"=" ...
"<>" ...Well it looks like the word "BETWEEN" is causing the compiler to choke. Instead of "X between 1? and 2?" try "(X > ?1 AND X < ?2) OR (X > ?2 AND X < ?1)"
Maybe you are looking for
-
Can't able to buy itunes store with several problems
As I mentioned before, , it appears that of your devices was linked to possible unauthorized activity on the iTunes Store. Because of this, I strongly recommend using a different device or computer to use the iTunes Store. Additionally, it appears th
-
Three out of four of my accounts have the exclamation mark next to them. I can send mail intermittently but cannot receive anything. I've tried every password I'v e ever used repeatedly, to no avail. When I change a password with the ISP, Mail never
-
MS Access - Oraclec 8i: Spaces in Table Names and Columns
I have an access database that i have split into two parts. 1. Access data tables 2. Access application The application has the data tables linked in for its use. With your workbench utility i have migrated my access data tables over but there is a b
-
Hi. I have a newbie question regarding the appearance of figures in Illustrator. When I make objects such as lines and rectangles with black color, they appear grey and diffuse (especially for thin lines). I'm able to change the line color, but it's
-
Horizontal trackpad scrolling not working
Just got a new MacBook (white, 2.1GHz, OS 10.5.6) and am getting used to it. But I have discovered that the horizontal two-finger scrolling on the trackpad does not work. (I know how this is supposed to work, 'cause it worked fine on my old 1.83GHz M