Java EE SDK :: Detect Presence / Absence Of A Module With CDI

Feb 28, 2013

My project builds a war. In the war there is a jar A which provides the implementation I1 of interface I. I1 is injected in a JSF controller. There is an optional jar B which provides another implementation I2 of interface I. I2 has an higher priority than I1. Is there a possibilty to achieve when jar B is present in the war I2 is injected. I tried it with @Alternative on I2 with an entry in beans.xml as alternative in jar B without success. I1 is injected. Something like a priority would be necessary. Or probably I am on a wrong way and there's another one that fits for my use case?

View Replies


ADVERTISEMENT

How To Detect Current Memory Free And Used In Java Program

Aug 29, 2014

I would like to know how much of memory is free and used my java program.I have used Runtime.totalMemory and freeMemory() functions. However, how come used memory is so different than java.exe process show in windows task manager?

View Replies View Related

Add Module To Keel Software

Dec 27, 2014

Who has worked with keel software (open source)? KEEL is an open source (GPLv3) Java software tool to assess evolutionary algorithms for Data Mining problems including regression, classification, clustering, pattern mining and so on.

source code of keel software: [URL] ....

I want that add a algorithm to it. The algorithm is attachment. who sent it, said " In order to run this algorithm, you need to download KEEL software and copy the .jar files for the preprocessing approaches, i.e. SMOTE.jar, into an "exe" folder." but I don't know.

View Replies View Related

Servlets :: Module For Multiple Users

Nov 3, 2014

I have to design/develop a module in java eg. Login. This module can be accessed by multiple concurrent users say 200, 500, 800 etc.

How such type of modules can be designed in such a way that it can perform successfully.

What are the main concepts at code level / Infrastructure level which we should take care while designing such modules.

View Replies View Related

EJB / EE :: Enterprise Application Web Module Error

Jul 5, 2014

I have created one new enterprise aplication project called July2014. While creating I have added one new EJB module called July2014EJB for business logic and one new web module Called July2014Web for the UI(I see connector module and application client module what are the uses of them and when should i select them).I have addded one index.jsp with below sample code

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert gp title here</title>
</head>
<body>
<h1>test gp senterprise project web module through parent ear</h1>

[code]...

I did multiple times clean, build, publish, restarting the server.I have not done refreshing EAR, EJB and web project. how Refresh is useful and different from clean and build.

View Replies View Related

Enterprise JavaBeans :: How To Use Log4j In Module

Apr 22, 2014

I have included the log4j.jar in libraries; added log4j.xml in the sources folder; but I am getting an error: 
 
<Apr 22, 2014 11:07:50 AM PKT> <Warning> <EJB> <BEA-010065> <MessageDrivenBean threw an Exception in onMessage().

The exception is:

java.lang.NoClassDefFoundError: org/apache/log4j/Logger.
java.lang.NoClassDefFoundError: org/apache/log4j/Logger
    at test.MyMessageBean.onMessage(MyMessageBean.java:39)
    at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:575)
    at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:477)
    at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:375)
    at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4855)
    Truncated. see log file for complete stacktrace
 
how to resolve this???

View Replies View Related

Enterprise JavaBeans :: Unable To Load Module - DeploymentContext Does Not Contain Any EJB

Apr 1, 2013

I'm writing an enterprise application to familiarize myself with Glassfish 3.1.2 and EJB 3.1. I've created several local, stateless beans, and injected one into a JSF managed bean. The ejb and web modules compile fine, but when I launch the application with Glassfish I get the following startup error and the application does not deploy.

SEVERE: Exception while invoking class org.glassfish.ejb.startup.EjbDeployer prepare method
SEVERE: Exception while invoking class org.glassfish.javaee.full.deployment.EarDeployer prepare method
SEVERE: Exception while preparing the app
SEVERE: Unable to load the EJB module. DeploymentContext does not contain any EJB.

org.glassfish.deployment.common.DeploymentException: Unable to load the EJB module. DeploymentContext does not contain any EJB.

Check the archive to ensure correct packaging for D:DocumentsNetBeansProjectsTestdistgfdeployTestTest-war_war.

If you use EJB component annotations to define the EJB, and an ejb or web deployment descriptor is also used, please make sure that the deployment descriptor references a Java EE 5 or higher version schema, and that the metadata-complete attribute is not set to true, so the component annotations can be processed as expected :

     at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:166)
     at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:871)
     at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:410)
     at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
     at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)

[Code] ......

View Replies View Related

How To Detect When Program Is Ending

Feb 24, 2014

I have java program that I am debugging with NetBeans. In it I open a serial com port. It seems that if I exit the program the serial port is not closed so I cannot get the port the next time I start the program.

Is there a way I can detect that either the user clicked the "X" in the upper ight of the GUI or I clicked the "Stop Button" in NetBeans?

View Replies View Related

Program To Detect Number 7 And Its Multiples

Apr 25, 2015

I just started learning Java, I was asked to write a simple program that prints a message if it encounters the number 7 or its multiple.

This should be achievable using simple loops and simple operations...

Here is my attempt:

Java Code:

Scanner scan = new Scanner(System.in);
int i, j, temp;
i = scan.nextInt(); // Awaiting user input
j = scan.nextInt(); // Awaiting user input
if (i > j){ // i = 10 j = 0
temp = i; // temp = 10

[Code]...

Now it works fine for numbers that are less than 70...

Example for output with i = 15, and j = 25:

Java Code:

15
16
!!!
18
19
20
!!!
22
23
24
25 mh_sh_highlight_all('java');

I am not sure what to do in case if for example 'i' and 'j' are very big numbers

I mean, I need it to detect the 7s even if it in the thousands place, actually - no matter how big is the number... So far I only made it to work for numbers that are less than 70...

View Replies View Related

Try / Catch Into ActionListener - Detect Characters Other Than Alpha

Dec 8, 2014

I'm trying to place a try/catch into a Actionlistener that will detect other characters other than alpha.

private class printbuttonHandler implements ActionListener {
public void actionPerformed(ActionEvent e) {
//Object src = namesinput;
//String message = "Insert Message Here";
  notesinput.setText("");
JOptionPane.showMessageDialog(null, notesinput, "Receipt",
JOptionPane.PLAIN_MESSAGE);
}

I'm not even sure if I'm trying to place it in the correct area in the code. However I like to perform this prior to the receipt being displayed so if there a issue the user can correct this before the final receipt has been sent .......

View Replies View Related

Servlets :: Detect Keystroke In JSP Textarea And Keylistener

May 22, 2014

i can use this current code to change it so that it use TextArea in jsp and the keylistener code in servlet. i know i have to take out the JFrame,JTextfield and ContentPane but still i could not do it.

Servlet:

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.io.IOException;

[code]....

View Replies View Related

Creating Application Which Detect Image And Process It?

Oct 24, 2013

i want to create an application which detect an image which took from camera and to process it so that it can be verified ..for example number plate of the vehicle ..if i need to extract the numbers from the image ..

View Replies View Related

Create Application Which Detect Image Taken From Camera

Apr 7, 2015

I am new to java and i want to create an application which detect an image which took from camera and to process it so that it can be verified ..for example number plate of the vehicle ..if i need to extract the numbers from the image ..

View Replies View Related

I/O / Streams :: How To Detect USB Drives And Search For Images

Sep 29, 2014

I am working on a project, how I can detect an usb drive and search and extract images from the drive.

I know there is loads of API out for detecting usb in java application. But, I cannot seems to find out how do you run the API. [URL]...

View Replies View Related

Grading System Where In Can Detect If Notepad Has This Input

Sep 25, 2014

on my note pad the 00 means that it is an excused absent while 0 is the unexcused:this one is the readfile saved on .txt

Bruce Wayne
9 9 00 19 49
10 0 10 9 9
90
50
87 87
some of the code:

if (inFile.next() == 00){
System.out.print("student has an excused absent how would you like to proceed");

}else{
grade = inFile.nextDouble();
qsum += grade;

View Replies View Related

Swing/AWT/SWT :: Event To Detect Jframe Change

Aug 13, 2014

I would like to detect when the user change de JFrame. I make:

public class UI implements ActionListener, ComponentListener, DocumentListener, MouseListener{

private JFrame ventana;
private JTable table;
private JPanel panel;
private JScrollPane tableScrollPane;

[Code] ....

I put componentResized but when I change JFrame I cant see the string that I put in the method.

View Replies View Related

JavaFX 2.0 :: Detect Mouse Click In TreeView?

Jun 12, 2014

I want to create mouse click event. I tested this code but I cannot make it work:
 
treeView.setCellFactory(new Callback<TreeView<DynamicTreeNodeModel>, TreeCell<DynamicTreeNodeModel>>()
{
@Override

[Code].....

View Replies View Related

JSP :: How To Detect If Any Exe Application Is Installed On Client Machine Through Browser

Aug 20, 2014

I am working on SpringMVC web application. Is there any way to detect from browser(jsp page) that any (exe) application is installed or not on client machine? And if not installed then show user the Popup to download that Application or Software . And if the user rejects to download that application then not allow him/her to login ....

View Replies View Related

Swing/AWT/SWT :: How To Detect That User Has Typed A Character In JTable Column

May 3, 2015

I have a JTable with 5 columns, named: "ID", "Name", "UnitPrice", "Qty", and "Total". Only the columns UnitPrice and Qty are editable by the user. When, for example, for a row in the JTable, the user types 5000 in the UnitPrice column, and types 15 in the Qty column, I would want that when he types the first character in the Qty column (i.e. the character 1) in the Qty column, the Total column displays 5000*1, in other terms 5000.

And when the user types the second character in the Qty column, i.e the character 5, after having typed 1, the Total column should display 5000*15, in other terms 75000. So, to say it concisely, I would want that the Total column refreshes accordingly each time the user types a character in the Qty column. I have tried to use the MouseClicked event of the JTable, but noticed that that does not solve my problem. is there an event I should use to refresh my Total column? Or should I proceed in another fashion?

View Replies View Related

Unable To Detect Collision Between Moving And Stationary Jbuttons Using Rectangle Intersection

Apr 5, 2014

I am trying to detect the collision between a moving Jbutton and stationary Jbuttons using Rectangle Intersection.

When I run the program I am getting a NullPointerException on line 'msg1.setBounds(new Rectangle(320,50,400,50));'.

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class gamePanel01 extends JPanel implements KeyListener {
character ch1 = new character("Hero");
//Global Variables
JButton blocker01;
JButton blocker02;

[Code]...

View Replies View Related

Applets :: Accessing Java Application Without Adding Site To Java Security

Sep 12, 2014

I have tried running the java application without adding the site to site list in java security tab. But I get a sand box message as APPLICATION BLOCKED BY SECURITY SETTINGS. How to run the java application without adding the site to site list in java security tab.

View Replies View Related

Can Use Java Code From OpenScript Or APIs In Separate Java Program?

Oct 24, 2014

I want to develop a Java program that uses OpenScript APIs to test my applications. The OpenScript framework automatically creates the Java Code so I was thinking of either using this code or create my own using the APIs.
 
I tried both options using NetBeans but I'm getting errors everywhere starting with the library import. I'm pretty new to Java so I'm sure I'm missing a lot of things here. I pasted the code below from the OpenScript framework that want to use in a stand-alone file for your reference.,
 
import oracle.oats.scripting.modules.basic.api.*;
import oracle.oats.scripting.modules.browser.api.*;
import oracle.oats.scripting.modules.functionalTest.api.*;
import oracle.oats.scripting.modules.utilities.api.*;
import oracle.oats.scripting.modules.utilities.api.sql.*;

[Code] ....

View Replies View Related

Java Application With Several Classes All In Same Java File

Apr 9, 2015

I've written a java application with several classes all in the same .java file. It works just fine. Now, I've broken it up so that each class has its own .java file. Still works fine. My next step is to put those classes into a package, but I'm not about to get the program to run.The .java source files are all in /home/user/src

I've set the CLASSPATH to /home/user/src..All of the source files have "package com.myfirm.program" on the first line.I compiled the application with:

javac -d . File1.java File2.java File3.java (etc...)

the compiler created the directory: /home/user/src/com/myfirm/program and put all of the .class files in there.So how do I get the program to run? if I run from /home/usr/src

java File1

I get: Exception in thread "main" java.lang.NoClassDefFoundError: File1 (wrong name: com/myfirm/program/Program)

View Replies View Related

How To Call Java Methods From Different Java File

Apr 14, 2015

I create 2 files:

CircleCalculationMethod.javaMain.java 

In Main.java, How can i call method in CircleCalculationMethod.java ?

Should I put everything in same folder ??Should i do something like "import CircleCalculationMethod.java"Should i do something like create a package ...

I use Eclipse software

View Replies View Related

What Is Difference Between Java SE And Java EE

Sep 19, 2014

The title of Question might seem old and previously asked.But I have a Question that what is difference between javaSE and Java EE.Although I knew what comes under JavaSE and What is under JavaEE.But My question is that.

What happens when we add PATH in our Environment Variable How does Eclipse or Other IDE use it?

Second Question is.

For Java SE we declare a Path Variable but for Java EE we do not add any library?(I know we add some jar file like for Servlet(Servlet-api.jar) and for EJB(Ejb.jar),But What is actaul difference?

View Replies View Related

Odd Even Zero Java

Oct 23, 2014

creating a program that will output something like this:

Enter an Integer: 1405302(user inputted)

Your integer contains 2 even digit(s), 3 odd digit(s), and 2 zero(s).

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved