Header business data does not apply to item
I have a document that i want to delete but the system won't allow me to do any changes due to error message we are receiving when entering this order "Header business data does not apply to item". Please help me reject the this order. By the way, the document is Debit Memo Request.
Hope to hear from you guys. Thanks in advance.
Hi Riyaj,
To answer your questions:
1. There were no preceding docs existed.
2. I already put reason for rejection, however, there is a warning message that it cannot be deleted.
3. I am creating a Debit Memo Request. I want to do some changes to this particular document but Information Message "Header business data does not apply to item" keeps on appearing.
Similar Messages
-
Hi
I have a " AirPort Time Capsule " (firmware 7.7.3) When I try to open the data folder in "finder". Then I got the message " The operation can not be completed because the original item for " data" does not exist". I have a lot of data and I can understand why I get this message?
Anyone who can help? Thanks..
Br. BoGet a USB drive of 2TB or more.. assuming your TC is 2TB. Either preformatted Mac or plug into your Mac and format it standard Mac OS Extended Journaled in disk utility.
Do a full archive of the TC. You do this using airport utility. Do not click the erase disk.. I marked in green.. just the archive.. that is to backup the internal disk to the USB disk. It is not fast.. take it that the process will go at around 40-50GB/hr.
Once you complete the archive .. it is a direct image of the data on your TC.. you can then plug it into your computer directly.. and then try and open the files you lost.. if you cannot open them.. open disk utility and fix the permissions.
http://osxdaily.com/2015/01/13/repair-disk-permissions-mac-os-x/
Or try the methods apple recommends..
OS X Yosemite: Set permissions for items on your Mac
It is possible to fix things on the USB drive because it is locally mounted.. but you cannot fix it on TC which is network drive. -
New Secondary and Higher education Cess does not apply to all business!?
Hi,
I know that for New Secondary and Higher education Cess we need to apply OSS Note (1032554 - Secondary and Higher Education Cess on Income Tax) as per the new legal change in India, an additional surcharge has been introduced for purposes of the Union, to be called the #Secondary and Higher Education Cess on income-tax#, calculated at the rate of one per cent.
I think this new cess is applicable across all industries.But, got feed back from client (project) that it does not apply to their business (Import and Trading) and this new cess can be rejected during passing the budget as bill.
Could you let me know reasonable justification to implement this oss notes?
Thanks in advance
S.Hi,
Please go thru the following link specially the clause 129. May be helpful. It speaks of imports.
http://indiabudget.nic.in/ub2007-08/fb/bill6.pdf
Regards
A -
Err while confrm Business partner does not exist (Notification E R1 201)
I am for the first time into CRM serv implementation.I have 2 issues. Please provide your valuable suggestions at the earliest.
I raised a serv order, released items, confirmed it and changed the status to complete. now when i try to raise an invoice, in billing due list, serv order num is showin up but not confirmation number. Billing relevance in item category for
service item in Serv order ---> Order related billing acc to order quantity
confirmation item category--> Transaction related billing after completion.
The reason i expect is that i have used a crm employee as employee responsible as HR is not yet in place. At the time of confirmation and data transfer to r/3 system is throwing a message that BP doesnot exist. Long text is as follows
"Business partner does not exist (Notification E R1 201)"
I am unable to trace out which BP is it unable to find. The Sold to i am using is on the other hand available in R/3.
1) Is service confirmation incomplete and hence is not appearing in Billing due list or is there any other reason?
2) How can i analyse which BP number is not avilable. i.e.. how can i check the contents of bdoc system is sending and because of which value of BP is the transfer getting stopped
Regards,
KiranHi
The link is not working.
The contents of the message is as follows
follow all the following steps
Setting up Transfer of Employee (HR Master) from R/3 to CRM
1. Logical system XXX assigned to R/3 client XXX. Logical system YYY assigned to CRM client YYY view through SCC4
2. Create RFC Destination YYY for CRM client YYY in R/3 and
Server ID with user details and client YYY.
3. Transaction code SALE : Application Link Enabling (ALE)  Modelling and Implementing Business Processes  Maintain Distribution Model and Distribute Views. (Direct transaction code : BD64)
Go to change mode and select Create Model view.
You get a popup. Fill in the details Technical name, short text and validity
Select Add message type from the application tool bar.
Fill in the following details
Model view : HRCRM
Sender logical system : XXX
Receiver logical system : YYY
Message type : HRMD_ABA
Note : Only this message type works for employee transfer.
4.Save the model. From the same screen select the distribution model and from the menu Environment  Generate partner profiles
Dont change anything in the next screen. Simply Execute.
4.Distribute the distribution model HRCRM
Select the distribution model. From the menu bar, Edit  Model View  Distribute
You get a dialog showing the receiver logical system. Execute.
You get a log Model view HRCRM has been created in target system YYY
5.Go to the CRM system and check up whether this model has been created.
Transaction code BD64
The model has got copied. No changes can be made in CRM
6. Generate partner profiles for the distribution model in CRM by selecting
Environment  Generate partner profiles.
In the next screen, do not make any changes and Execute.
Partner profiles can be seen in transaction WE20
Delta Download Settings
7. So far, the above settings will ensure the initial download. However for any changes / new employees to be transferred, i.e delta changes, changes pointers need to be activated.
In R/3, Transaction code SALE, Application Link Enabling (ALE)  Modelling and Implementing Business Processes  Master Data Distribution  Replication of Modified Data  Activate Change Pointers Generally (BD61)
This activates change pointers globally for all message types.
8. In R/3, Transaction code SALE, Application Link Enabling (ALE)  Modelling and Implementing Business Processes  Master Data Distribution  Replication of Modified Data  Activate Change Pointers for Message Types
Activate change pointer for message type HRMD_ABA
9. CRM : Number Assignments. Generally, there are 3 types of number assignments (also called switches) when business partners are created.
1 The system uses the number from the general internal interval of the number
range object BU_PARTNER
2 The system uses the number from a specific internal interval of the object
3 The number is transferred from HR and a prefix is added. In this case, a specific external interval, which must be defined as XX00000000 (upto
XX99999999), is used (where XX denotes any two letters).
The number range object for all switch positions is BU_PARTNER, with the interval depending on the switch value.
For switch value 1, the system uses the internal standard interval, otherwise for switch values 2 and 3 you must also create a grouping (transaction BUC2) for these intervals. For the system to be able to connect the grouping and the number range interval, the name of the grouping must be exactly the same as the name of the corresponding number range interval (the name of the grouping is contained in the first column of the table). If you select 3 (HRALX/PNUMB = 3) for the number assignment of busienss partners of the employee role, create HRALX/PSUBG switch manually in table T77S0.
In table T77S0, HRALX/ONUMB is used to set the number assignment for organizational units and HRALX/PNUMB is used to set the number assignment for employees.
Create a number range ZZ
Transaction code BUC2. Create a grouping of the same ID as that of the number range. Eg. Number range ID : ZZ and grouping ID should also be ZZ
In table T77S0, maintain the following combinations
HRALX-PNUMB = 2
HRALX-PSUBG = ZZ
10. Make the following customizing changes in CRM
Transaction code SM30 : Table T77S0
Group Sem Abbr Value Abbr
HRALX HRAC X Activate HR Integration with CRM
HRALX OBPON ON Activate integration between Business partners and Org Units
HRALX PBPON ON Integration between business partners and employees
HRALX OPROL BUP004 Role definition for org unit Business partner
HRALX PPROL BUP003 Role definition for Employee Business partner
HRALX ONUMB 1 Number range assignment for org units
HRALX PNUMB 2 Number range assignment for Employees
HRALX PSUBG ZZ Number range grouping only if PNUMB is not 1.
11. Create Employee Master in R/3. Employee master consists of Infotypes. The mandatory infotypes are Actions, Address, Personal data and Organizational Assignment. You can ignore the remaining. Click on next and dont save the other infotypes.
Transaction code : PA30
12. In R/3 Initial Download : SE38 RHALEINI
Plan version : 01
Object type : P Person (always)
Object ID : Employee ID eg. 1
Receiver Partner no. : YYY
Select further details
You get all the data transfer details
13. In CRM, transaction code PP01 View HR Master objects
You see that the employee 1 has got transferred. To see the corresponding business partner go to the infotype Relationships (the first row)
Screen 2 gives you the business partner ID in CRM
Regards
Rekha Dadwal -
FINSTA Bankstatement does not clear Open Items
Dear SAP guru,
I am experiencing an issue where FINSTA bankstatement generated in IHC module does not clear Open items in reciving company code. I would like to get the system to search for the document based on the original FI document number and clear it. The situation is
The bank statement successfully processed has an original document number and processed.
In IMG for EBS, I configure as algorism used is 20 - Document number search and Bank Posting type 4: Clear Debit GL account
Clearing account - and have the posting with relevant document number matched with the bankstatement.
It seems that the system does not find the matching at all.
Could any of you shed some light on what I am missing???
Kind regards
TaroCreating or even using something like a data migration account is the best way.
Are you saying that you have a GL account with say 100 line items and you want them all cleared. If that is the case you wont need a LSMW, make sure you know the amount, and then create a journal posting to your new GL account, and select all items in the GL account you want to clear.
If there are various GL accounts, again no real problem, in F-03 which is what you would be using, you can enter more than GL account so that should not be an issue. -
Need help in formatting the Date - Date does not
Need help in formatting the Date - Date does not formats and give Not a valid month error in the below scenario.
select oc.ST_PGM_MGR, r.ag_dnum, get_major_work_type(r.perf_eval_rtng_id) "v_work_code", r.ag_dnum_supp "supp", r.intfinal, to_char(r.formdate,'MM/DD/YYYY') "formdate", to_char(r.servfrom,'MM/DD/YYYY') "srv_from", to_char(r.servto,'MM/DD/YYYY') "srv_to", descript, add_months(to_char
--- Bellow line of Code on trying to format it to mm/dd/yyyy gives the error
(r.formdate, 'DD-MON-YYYY'),12) "formdate2"
from table REdited by: Lucy Discover on Jul 7, 2011 11:34 AM
Edited by: Lucy Discover on Jul 7, 2011 1:05 PMYour syntax is wrong - look at the post above where this syntax is given:
to_char (add_months(r.formdate,12), 'MM/DD/YYYY') "formdate2"Look at the formula from a logical perspective - "inside out" to read what is happening -
take formdate, add 12 months
add_months(r.formdate, 12)then apply the to_char format mask - basic syntax
to_char(date, 'MM/DD/YYYY')Compare to your syntax:
to_char(add_months(r.formdate, 'MM/DD/YYYY'),12) "formdate2"You will see your format string inside the call to add_months, and your 12 inside the call to to_char.
Good luck! -
EJB 3.0 - JSF APPLICATION: DATA DOES NOT PERSIST TO THE DATABASE
Hi,
I am developing a JSF - EJB application and the data that I send from JSP Page through JSF Managed Bean --> Session Bean --> Java Persistence does not persist in database.
Here is my scenario ( Iam using JDeveloper IDE to create this application) -
SCENARIO START
The scenario consists of two web pages, one enlisting all the users stored in the database, the other contains a form for adding a user
1.) INDEX.JSP
2.) ADDUSER.JSP
Step 1: Create the USERS Table in database
CREATE TABLE users
user_id serial,
username varchar(255) NOT NULL,
first_name varchar(255),
last_name varchar(255),
password char(64) NOT NULL,
CONSTRAINT pk_users PRIMARY KEY (user_id)
Step 2: Add Database Connection To JDeveloper
Go to Database Connection Navigator and create a New Database Connection using the Wizard
Step 3: Create a New Application in JDeveloper and select JSF, EJB from Application Template
Step 4: ENTITY BEAN - In the EJB Node Right Click and Select EJB à New Entites from Table (JPA/EJB3.0)
Use The Wizard and create Entity Bean from Users Table which creates an Entity Bea POJO file as follows –
User.java -
package lux.domain;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@Entity
@NamedQuery(name = "User.findAll", query = "select o from User o")
@Table(name = "USERS")
public class User implements Serializable {
@Column(name="FIRST_NAME")
private String firstName;
@Column(name="LAST_NAME")
private String lastName;
@Column(nullable = false)
private String password;
@Column(nullable = false)
private String username;
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="users_seq_generator")
@SequenceGenerator(name="users_seq_generator", sequenceName="users_user_id_seq")
@Column(name="USER_ID", nullable = false)
private Long userId;
public User() {
public String getFirstName() {
return firstName;
public void setFirstName(String firstName) {
this.firstName = firstName;
public String getLastName() {
return lastName;
public void setLastName(String lastName) {
this.lastName = lastName;
public String getPassword() {
return password;
public void setPassword(String password) {
this.password = password;
public String getUsername() {
return username;
public void setUsername(String username) {
this.username = username;
public Long getUserId() {
return userId;
public void setUserId(Long userId) {
this.userId = userId;
Step 5: STATELESS SESSION BEAN - In the EJB Node Right Click and Select EJB à New Entites from Table (JPA/EJB3.0)
Again Right Click on Model and create Session Bean from Wizard which creates two files –
UserDAOBean.java – Stateless Session Bean
UserDAO.java – Local Interface
package lux.facade;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import lux.domain.User;
@Stateless(name="UserDAO")
public class UserDAOBean implements UserDAO {
@PersistenceContext(unitName="Model")
private EntityManager em;
public UserDAOBean() {
public User getUser(int UserId) {
User u = new User();
u = em.find(User.class, UserId);
return u;
public List<User> getAllUsers() {
Query q = em.createQuery("SELECT u FROM User u");
List<User> users = q.getResultList();
return users;
public void createUser(User u) {
String hashedPw = hashPassword(u.getPassword());
u.setPassword(hashedPw);
em.persist(u);
public void updateUser(User u) {
String hashedPw = hashPassword(u.getPassword());
u.setPassword(hashedPw);
em.merge(u);
public void deleteUser(User u) {
em.remove(u);
private String hashPassword(String password) {
StringBuilder sb = new StringBuilder();
try {
MessageDigest messageDigest = MessageDigest.getInstance("SHA");
byte[] bs;
bs = messageDigest.digest(password.getBytes());
for (int i = 0; i < bs.length; i++) {
String hexVal = Integer.toHexString(0xFF & bs);
if (hexVal.length() == 1) {
sb.append("0");
sb.append(hexVal);
} catch (NoSuchAlgorithmException ex) {
Logger.getLogger(UserDAOBean.class.getName()).log(Level.SEVERE, null, ex);
return sb.toString();
Step 6: Create a Deployment file in the Model and Deploy this to a JAR file
Step 7: Now Right Click on View/Controller Node and create a Java File –
UserController.java -
package lux.controllers;
import javax.ejb.EJB;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;
import lux.domain.User;
import lux.facade.UserDAO;
public class UserController {
@EJB UserDAO userDao;
private User user;
private DataModel model;
public String createUser() {
this.user = new User();
return "create_new_user";
public String saveUser() {
String r = "success";
try {
userDao.createUser(user);
} catch (Exception e) {
e.printStackTrace();
r = "failed";
return r;
public DataModel getUsers() {
model = new ListDataModel(userDao.getAllUsers());
return model;
public User getUser() {
return user;
public void setUser(User user) {
this.user = user;
Step 8: Configure page flow in faces-config.xml
1. Create the JSP file adduser.jsp by right-clicking View-Controller
node and selecting New > JSP. Use the wizard to create JSF – JSP Page, fill in
File Name adduser.jsp, click Finish. -
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!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=UTF-8">
<title>New user</title>
</head>
<body>
<f:view>
<h:form>
<h:messages/>
<h:panelGrid columns="2">
<h:outputText value="Username"/>
<h:inputText
id="Username"
value="#{user.user.username}"
required="true"/>
<h:outputText value="First name"/>
<h:inputText
id="FirstName"
value="#{user.user.firstName}" />
<h:outputText value="Last name"/>
<h:inputText
id="LastName"
value="#{user.user.lastName}" />
<h:outputText value="Password" />
<h:inputSecret
id="Password"
value="#{user.user.password}"
required="true" />
<h:panelGroup/>
<h:commandButton
action="#{user.saveUser}"
value="Save"/>
</h:panelGrid>
</h:form>
</f:view>
</body>
</html>
2. Repeat the previous step for another JSP file failed.jsp.
3. On failed.jsp add the string
Save failed
Next we configure the page flow.
1. Open faces-config.xml.
2. Create index.jsp -
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!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=UTF-8">
<title>User Listing</title>
</head>
<body>
<f:view>
<h:form>
<h:outputText value="User Listing"/>
<h:commandLink action="#{user.createUser}" value="Create a user"/>
<h:dataTable value="#{user.user}"
var="dataTableItem" border="1" cellpadding="2" cellspacing="2">
<h:column>
<f:facet name="header">
<h:outputText value="Username"/>
</f:facet>
<h:outputText value="#{dataTableItem.username}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="First name"/>
</f:facet>
<h:outputText value="#{dataTableItem.firstName}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Last name"/>
</f:facet>
<h:outputText value="#{dataTableItem.lastName}" />
</h:column>
</h:dataTable>
</h:form>
</f:view>
</body>
</html>
3. Drag an arrow from index.jsp to adduser.jsp and replace the arrow’s label to create_new_user.
4. Repeat the previous step for failed, by dragging and arrow from adduser.jsp to failed.jsp renaming the label to f
ailed
5. Finally repeat the step for adduser.jsp, by dragging from adduser.jsp to index.jsp renaming the label to success.
This creates the following faces-config.xml file –
<?xml version='1.0' encoding='UTF-8'?>
<faces-config>
<managed-bean>
<managed-bean-name>user</managed-bean-name>
<managed-bean-class>lux.controllers.UserController</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>username</property-name>
<value>#{username}</value>
</managed-property>
<managed-property>
<property-name>firstName</property-name>
<value>#{firstName}</value>
</managed-property>
<managed-property>
<property-name>lastName</property-name>
<value>#{lastName}</value>
</managed-property>
<managed-property>
<property-name>password</property-name>
<value>#{password}</value>
</managed-property>
</managed-bean>
<navigation-rule>
<from-view-id>/index.jsp</from-view-id>
<navigation-case>
<from-outcome>create_new_user</from-outcome>
<to-view-id>/adduser.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/adduser.jsp</from-view-id>
<navigation-case>
<from-outcome>failed</from-outcome>
<to-view-id>/failed.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/index.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
Step 9: Create a Deployment file in the View-Controller and Deploy this to a WAR file
Step 10: Create a Deployment file in the View-Controller and create an EAR file and add Model’s JAR and View-Controller’s
WAR files to it.
Step 11: Run the JSP Files
SCENARIO END
Now, When I execute Index.jsp, it does not list values from database and when I click on Create User link, it takes me to adduser.jsp page. When I fill values in this page and click Save button, it takes me to Save Failed page and data does not persist to the database.
WHAT IS WRONG OUT HERE ???If you set a breakpoint in your createUser method - does this code get executed?
We have a couple of tutorials that might show you how to do this.
EJB/JSF with ADF-binding tutorial:
http://www.oracle.com/technology/obe/obe1013jdev/10131/ejb_and_jpa/master-detail_pagewith_ejb.htm
EJB/JSF without ADF binding:
http://www.oracle.com/technology/obe/JavaEE_tutorial_10131/index.htm -
JSF - EJB 3.0 Application - Data does not persist to the database
Hi,
I am developing a JSF - EJB application and the data that I send from JSP Page through JSF Managed Bean --> Session Bean --> Java Persistence does not persist in database.
Here is my scenario ( Iam using JDeveloper IDE to create this application) -
------------------------------------------------------- SCENARIO START
The scenario consists of two web pages, one enlisting all the users stored in the database, the other contains a form for adding a user
1.) INDEX.JSP
2.) ADDUSER.JSP
Step 1: Create the USERS Table in database
CREATE TABLE users
user_id serial,
username varchar(255) NOT NULL,
first_name varchar(255),
last_name varchar(255),
password char(64) NOT NULL,
CONSTRAINT pk_users PRIMARY KEY (user_id)
Step 2: Add Database Connection To JDeveloper
Go to Database Connection Navigator and create a New Database Connection using the Wizard
Step 3: Create a New Application in JDeveloper and select JSF, EJB from Application Template
Step 4: ENTITY BEAN - In the EJB Node Right Click and Select EJB � New Entites from Table (JPA/EJB3.0)
Use The Wizard and create Entity Bean from Users Table which creates an Entity Bea POJO file as follows �
User.java -
package lux.domain;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@Entity
@NamedQuery(name = "User.findAll", query = "select o from User o")
@Table(name = "USERS")
public class User implements Serializable {
@Column(name="FIRST_NAME")
private String firstName;
@Column(name="LAST_NAME")
private String lastName;
@Column(nullable = false)
private String password;
@Column(nullable = false)
private String username;
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="users_seq_generator")
@SequenceGenerator(name="users_seq_generator", sequenceName="users_user_id_seq")
@Column(name="USER_ID", nullable = false)
private Long userId;
public User() {
public String getFirstName() {
return firstName;
public void setFirstName(String firstName) {
this.firstName = firstName;
public String getLastName() {
return lastName;
public void setLastName(String lastName) {
this.lastName = lastName;
public String getPassword() {
return password;
public void setPassword(String password) {
this.password = password;
public String getUsername() {
return username;
public void setUsername(String username) {
this.username = username;
public Long getUserId() {
return userId;
public void setUserId(Long userId) {
this.userId = userId;
Step 5: STATELESS SESSION BEAN - In the EJB Node Right Click and Select EJB � New Entites from Table (JPA/EJB3.0)
Again Right Click on Model and create Session Bean from Wizard which creates two files �
UserDAOBean.java � Stateless Session Bean
UserDAO.java � Local Interface
package lux.facade;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import lux.domain.User;
@Stateless(name="UserDAO")
public class UserDAOBean implements UserDAO {
@PersistenceContext(unitName="Model")
private EntityManager em;
public UserDAOBean() {
public User getUser(int UserId) {
User u = new User();
u = em.find(User.class, UserId);
return u;
public List<User> getAllUsers() {
Query q = em.createQuery("SELECT u FROM User u");
List<User> users = q.getResultList();
return users;
public void createUser(User u) {
String hashedPw = hashPassword(u.getPassword());
u.setPassword(hashedPw);
em.persist(u);
public void updateUser(User u) {
String hashedPw = hashPassword(u.getPassword());
u.setPassword(hashedPw);
em.merge(u);
public void deleteUser(User u) {
em.remove(u);
private String hashPassword(String password) {
StringBuilder sb = new StringBuilder();
try {
MessageDigest messageDigest = MessageDigest.getInstance("SHA");
byte[] bs;
bs = messageDigest.digest(password.getBytes());
for (int i = 0; i < bs.length; i++) {
String hexVal = Integer.toHexString(0xFF & bs);
if (hexVal.length() == 1) {
sb.append("0");
sb.append(hexVal);
} catch (NoSuchAlgorithmException ex) {
Logger.getLogger(UserDAOBean.class.getName()).log(Level.SEVERE, null, ex);
return sb.toString();
Step 6: Create a Deployment file in the Model and Deploy this to a JAR file
Step 7: Now Right Click on View/Controller Node and create a Java File �
UserController.java -
package lux.controllers;
import javax.ejb.EJB;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;
import lux.domain.User;
import lux.facade.UserDAO;
public class UserController {
@EJB UserDAO userDao;
private User user;
private DataModel model;
public String createUser() {
this.user = new User();
return "create_new_user";
public String saveUser() {
String r = "success";
try {
userDao.createUser(user);
} catch (Exception e) {
e.printStackTrace();
r = "failed";
return r;
public DataModel getUsers() {
model = new ListDataModel(userDao.getAllUsers());
return model;
public User getUser() {
return user;
public void setUser(User user) {
this.user = user;
Step 8: Configure page flow in faces-config.xml
1. Create the JSP file adduser.jsp by right-clicking View-Controller
node and selecting New > JSP. Use the wizard to create JSF � JSP Page, fill in
File Name adduser.jsp, click Finish. -
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!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=UTF-8">
<title>New user</title>
</head>
<body>
<f:view>
<h:form>
<h:messages/>
<h:panelGrid columns="2">
<h:outputText value="Username"/>
<h:inputText
id="Username"
value="#{user.user.username}"
required="true"/>
<h:outputText value="First name"/>
<h:inputText
id="FirstName"
value="#{user.user.firstName}" />
<h:outputText value="Last name"/>
<h:inputText
id="LastName"
value="#{user.user.lastName}" />
<h:outputText value="Password" />
<h:inputSecret
id="Password"
value="#{user.user.password}"
required="true" />
<h:panelGroup/>
<h:commandButton
action="#{user.saveUser}"
value="Save"/>
</h:panelGrid>
</h:form>
</f:view>
</body>
</html>
2. Repeat the previous step for another JSP file failed.jsp.
3. On failed.jsp add the string <h2>Save failed</h2>.
Next we configure the page flow.
1. Open faces-config.xml.
2. Create index.jsp -
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!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=UTF-8">
<title>User Listing</title>
</head>
<body>
<f:view>
<h:form>
<h1><h:outputText value="User Listing"/></h1>
<p><h:commandLink action="#{user.createUser}" value="Create a user"/></p>
<h:dataTable value="#{user.user}"
var="dataTableItem" border="1" cellpadding="2" cellspacing="2">
<h:column>
<f:facet name="header">
<h:outputText value="Username"/>
</f:facet>
<h:outputText value="#{dataTableItem.username}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="First name"/>
</f:facet>
<h:outputText value="#{dataTableItem.firstName}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Last name"/>
</f:facet>
<h:outputText value="#{dataTableItem.lastName}" />
</h:column>
</h:dataTable>
</h:form>
</f:view>
</body>
</html>
3. Drag an arrow from index.jsp to adduser.jsp and replace the arrow�s label to create_new_user.
4. Repeat the previous step for failed, by dragging and arrow from adduser.jsp to failed.jsp renaming the label to f
ailed
5. Finally repeat the step for adduser.jsp, by dragging from adduser.jsp to index.jsp renaming the label to success.
This creates the following faces-config.xml file �
<?xml version='1.0' encoding='UTF-8'?>
<faces-config>
<managed-bean>
<managed-bean-name>user</managed-bean-name>
<managed-bean-class>lux.controllers.UserController</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>username</property-name>
<value>#{username}</value>
</managed-property>
<managed-property>
<property-name>firstName</property-name>
<value>#{firstName}</value>
</managed-property>
<managed-property>
<property-name>lastName</property-name>
<value>#{lastName}</value>
</managed-property>
<managed-property>
<property-name>password</property-name>
<value>#{password}</value>
</managed-property>
</managed-bean>
<navigation-rule>
<from-view-id>/index.jsp</from-view-id>
<navigation-case>
<from-outcome>create_new_user</from-outcome>
<to-view-id>/adduser.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/adduser.jsp</from-view-id>
<navigation-case>
<from-outcome>failed</from-outcome>
<to-view-id>/failed.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/index.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
Step 9: Create a Deployment file in the View-Controller and Deploy this to a WAR file
Step 10: Create a Deployment file in the View-Controller and create an EAR file and add Model�s JAR and View-Controller�s
WAR files to it.
Step 11: Run the JSP Files
------------------------------------------------------- SCENARIO END
Now, When I execute Index.jsp, it does not list values from database and when I click on Create User link, it takes me to adduser.jsp page. When I fill values in this page and click Save button, it takes me to Save Failed page and data does not persist to the database.
WHAT IS WRONG OUT HERE ???PLZZZZZZZZZzzzzzzzzzzz HELP ! ! !
-
'Document does not contain any items' error while posting GR from BAPI
Hello Friends,
I am trying to post GR from BAPI 'BAPI_GOODSMVT_CREATE' but some time it post successful and some time it does not post..gives error 'Document does not contain any items'....i have search all option but did not get any solution why this error is coming....kindly help me if you have any information regarding that.
The strange thing is i have alrady posted GR with some test data and later on again am trying to post GR with same test data but it is giving error as above.
For your information...i am using enhancement spot in standard program for GR posting...could it give any problem.
Regards,
Rajkishor.Solved by my self...problem was i were using enhancement spot in standard program because of this it was creating problem have search new enhancement spot and put my code out there now it is working fine.
Thanku very much all of you for your reply. -
Windows Server 2012 R2 - ALL HF's Failing to install as "Does Not Apply to this computer"
Hi,
A general question about hot fix installs.
I have multiple servers that are all Windows 2012 R2. They do not have internet connections, so I have to install the Hotfixes manually. I download the HF's from the ISO download page (https://support.microsoft.com/en-us/kb/913086) every month. I collect them and install in a bulk install during a release cycle ( a couple times a year). I just realized that NO HF's have installed since JUNE 2014. Every HF that shows up in WindowsServer2012R2 directory fail to install with a message of "The update is not applicable to your computer". Which is fine if that was true, but.... I get this message for every HF from the ISO's since June 2014. NOT one HF thinks it is applicable to my computer. Could that be the case? No HF's apply to my Server 2012 systems since June of 2014?
This is my system info, and below that is the results from attempting to install 95 HF's.
C:\TEMP>systeminfo
Host Name: MYHOST
OS Name: Microsoft Windows Server 2012 R2 Datacenter
OS Version: 6.3.9600 N/A Build 9600
OS Manufacturer: Microsoft Corporation
OS Configuration: Member Server
OS Build Type: Multiprocessor Free
Registered Owner: Windows User
Registered Organization:
Product ID: 00252-80025-36226-AA727
Original Install Date: 6/13/2014, 8:04:39 AM
System Boot Time: 3/16/2015, 2:34:45 PM
System Manufacturer: Dell Inc.
System Model: PowerEdge R720
System Type: x64-based PC
Processor(s): 2 Processor(s) Installed.
[01]: Intel64 Family 6 Model 62 Stepping 4 GenuineInt
el ~2500 Mhz
[02]: Intel64 Family 6 Model 62 Stepping 4 GenuineInt
el ~2500 Mhz
BIOS Version: Dell Inc. 2.2.2, 1/16/2014
Windows Directory: C:\Windows
System Directory: C:\Windows\system32
Boot Device: \Device\HarddiskVolume1
System Locale: en-us;English (United States)
Input Locale: en-us;English (United States)
Time Zone: (UTC-07:00) Mountain Time (US & Canada)
Total Physical Memory: 262,099 MB
Available Physical Memory: 249,337 MB
Virtual Memory: Max Size: 301,011 MB
Virtual Memory: Available: 288,015 MB
Virtual Memory: In Use: 12,996 MB
Page File Location(s): C:\pagefile.sys
Domain: mydomain.sgn
Logon Server: \\MYHOST
Hotfix(s): 25 Hotfix(s) Installed.
[01]: KB2862152
[02]: KB2868626
[03]: KB2876331
[04]: KB2888505
[05]: KB2892074
[06]: KB2893294
[07]: KB2893984
[08]: KB2898785
[09]: KB2898868
[10]: KB2898871
[11]: KB2900986
[12]: KB2901125
[13]: KB2901128
[14]: KB2909210
[15]: KB2909921
[16]: KB2912390
[17]: KB2916036
[18]: KB2919442
[19]: KB2922229
[20]: KB2923392
[21]: KB2925418
[22]: KB2930275
[23]: KB2931358
[24]: KB2931366
[25]: KB2936068
Network Card(s): 6 NIC(s) Installed.
[01]: Broadcom BCM57800 NetXtreme II 10 GigE (NDIS VB
D Client)
Connection Name: ISCSI
DHCP Enabled: No
IP address(es)
[01]: 192.168.1.30
[02]: fe80::38c9:e59c:5ac2:e0a1
[02]: Broadcom BCM57800 NetXtreme II 1 GigE (NDIS VBD
Client)
Connection Name: NIC3
Status: Hardware not present
[03]: Broadcom BCM57800 NetXtreme II 1 GigE (NDIS VBD
Client)
Connection Name: MGMT
DHCP Enabled: No
IP address(es)
[01]: 7.48.64.32
[02]: 7.48.64.30
[03]: fe80::f14e:9339:9326:c7fd
[04]: Broadcom BCM57810 NetXtreme II 10 GigE (NDIS VB
D Client)
Connection Name: SLOT 5 Port 1_swport_VMRepwan
DHCP Enabled: Yes
DHCP Server: N/A
IP address(es)
[05]: Broadcom BCM57800 NetXtreme II 10 GigE (NDIS VB
D Client)
Connection Name: NIC2
Status: Hardware not present
[06]: Broadcom BCM57810 NetXtreme II 10 GigE (NDIS VB
D Client)
Connection Name: SLOT 5 Port 2_swport_VMOpswan
DHCP Enabled: Yes
DHCP Server: N/A
IP address(es)
Hyper-V Requirements: A hypervisor has been detected. Features required for
Hyper-V will not be displayed.
I have a script that runs each HF install.. If I run them manually without the tool I get the same results so it is not the script..
Installing 95 patches
for Microsoft Windows Server 2012 R2 Datacenter x64
Repository path: U:\Patch Repository_4_1\2012_R2_HFs\
1. Windows8.1-KB2894852-v2-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
2. Windows8.1-KB2894856-v2-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
3. Windows8.1-KB2920189-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
4. Windows8.1-KB2926765-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
5. Windows8.1-KB2928120-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
6. Windows8.1-KB2931358-x64.msu patch status: ALREADY INSTALLED - SKIPPING
7. Windows8.1-KB2931366-x64.msu patch status: ALREADY INSTALLED - SKIPPING
8. Windows8.1-KB2933826-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
9. Windows8.1-KB2939576-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
10. Windows8.1-KB2953522-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
11. Windows8.1-KB2957151-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
12. Windows8.1-KB2957189-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
13. Windows8.1-KB2957689-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
14. Windows8.1-KB2961072-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
15. Windows8.1-KB2961887-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
16. Windows8.1-KB2962872-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
17. Windows8.1-KB2964718-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
18. Windows8.1-KB2964736-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
19. Windows8.1-KB2965788-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
20. Windows8.1-KB2966072-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
21. Windows8.1-KB2966826-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
22. Windows8.1-KB2966828-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
23. Windows8.1-KB2971850-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
24. Windows8.1-KB2972213-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
25. Windows8.1-KB2972280-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
26. Windows8.1-KB2973114-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
27. Windows8.1-KB2973201-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
28. Windows8.1-KB2973351-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
29. Windows8.1-KB2974008-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
30. Windows8.1-KB2976627-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
31. Windows8.1-KB2976897-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
32. Windows8.1-KB2977292-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
33. Windows8.1-KB2977629-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
34. Windows8.1-KB2978668-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
35. Windows8.1-KB2982794-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
36. Windows8.1-KB2982998-v2-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
37. Windows8.1-KB2987107-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
38. Windows8.1-KB2987114-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
39. Windows8.1-KB2988948-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
40. Windows8.1-KB2992611-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
41. Windows8.1-KB2993651-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
42. Windows8.1-KB2993958-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
43. Windows8.1-KB3000061-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
44. Windows8.1-KB3000483-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
45. Windows8.1-KB3000869-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
46. Windows8.1-KB3001237-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
47. Windows8.1-KB3002657-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
48. Windows8.1-KB3002885-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
49. Windows8.1-KB3003057-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
50. Windows8.1-KB3003381-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
51. Windows8.1-KB3003743-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
52. Windows8.1-KB3004150-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
53. Windows8.1-KB3004361-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
54. Windows8.1-KB3004365-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
55. Windows8.1-KB3005607-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
56. Windows8.1-KB3006226-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
57. Windows8.1-KB3008923-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
58. Windows8.1-KB3008925-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
59. Windows8.1-KB3010788-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
60. Windows8.1-KB3011780-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
61. Windows8.1-KB3013126-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
62. Windows8.1-KB3013455-v2-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
63. Windows8.1-KB3014029-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
64. Windows8.1-KB3018943-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
65. Windows8.1-KB3019215-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
66. Windows8.1-KB3019978-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
67. Windows8.1-KB3020393-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
68. Windows8.1-KB3021674-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
69. Windows8.1-KB3021952-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
70. Windows8.1-KB3023607-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
71. Windows8.1-KB3036197-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
72. Windows8.1-KB3021953-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
73. Windows8.1-KB3022777-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
74. Windows8.1-KB3023266-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
75. Windows8.1-KB3023562-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
76. Windows8.1-KB3024663-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
77. Windows8.1-KB3029944-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
78. Windows8.1-KB3030377-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
79. Windows8.1-KB3031432-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
80. Windows8.1-KB3032323-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
81. Windows8.1-KB3032359-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
82. Windows8.1-KB3040335-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
83. Windows8.1-KB3033408-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
84. Windows8.1-KB3033889-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
85. Windows8.1-KB3034196-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
86. Windows8.1-KB3034344-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
87. Windows8.1-KB3035017-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
88. Windows8.1-KB3035034-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
89. Windows8.1-KB3035126-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
90. Windows8.1-KB3035131-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
91. Windows8.1-KB3035132-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
92. Windows8.1-KB3037634-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
93. Windows8.1-KB3039066-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
94. Windows8.1-KB3044132-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
95. Windows8.1-KB3046049-x64.msu patch status: DOES NOT APPLY TO THIS COMPUTER
Thanks,
Dave
Hi Dave,
Would you please check CBS lg file and other relevant event logs if find more clues? On current situation, please refer to following article and check if can help you.
Update is not applicable to your computer- but it is
Best regards,
Justin Gu
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected] -
EJB-JSF Application : Data does not persist to the database
Hi,
I am developing a JSF - EJB application and the data that I send from JSP Page through JSF Managed Bean --> Session Bean --> Java Persistence does not persist in database.
Here is my scenario ( Iam using JDeveloper IDE to create this application) -
SCENARIO START
The scenario consists of two web pages, one enlisting all the users stored in the database, the other contains a form for adding a user
1.) INDEX.JSP
2.) ADDUSER.JSP
Step 1: Create the USERS Table in database
CREATE TABLE users
user_id serial,
username varchar(255) NOT NULL,
first_name varchar(255),
last_name varchar(255),
password char(64) NOT NULL,
CONSTRAINT pk_users PRIMARY KEY (user_id)
Step 2: Add Database Connection To JDeveloper
Go to Database Connection Navigator and create a New Database Connection using the Wizard
Step 3: Create a New Application in JDeveloper and select JSF, EJB from Application Template
Step 4: ENTITY BEAN - In the EJB Node Right Click and Select EJB � New Entites from Table (JPA/EJB3.0)
Use The Wizard and create Entity Bean from Users Table which creates an Entity Bea POJO file as follows �
User.java -
package lux.domain;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@Entity
@NamedQuery(name = "User.findAll", query = "select o from User o")
@Table(name = "USERS")
public class User implements Serializable {
@Column(name="FIRST_NAME")
private String firstName;
@Column(name="LAST_NAME")
private String lastName;
@Column(nullable = false)
private String password;
@Column(nullable = false)
private String username;
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="users_seq_generator")
@SequenceGenerator(name="users_seq_generator", sequenceName="users_user_id_seq")
@Column(name="USER_ID", nullable = false)
private Long userId;
public User() {
public String getFirstName() {
return firstName;
public void setFirstName(String firstName) {
this.firstName = firstName;
public String getLastName() {
return lastName;
public void setLastName(String lastName) {
this.lastName = lastName;
public String getPassword() {
return password;
public void setPassword(String password) {
this.password = password;
public String getUsername() {
return username;
public void setUsername(String username) {
this.username = username;
public Long getUserId() {
return userId;
public void setUserId(Long userId) {
this.userId = userId;
Step 5: STATELESS SESSION BEAN - In the EJB Node Right Click and Select EJB � New Entites from Table (JPA/EJB3.0)
Again Right Click on Model and create Session Bean from Wizard which creates two files �
UserDAOBean.java � Stateless Session Bean
UserDAO.java � Local Interface
package lux.facade;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import lux.domain.User;
@Stateless(name="UserDAO")
public class UserDAOBean implements UserDAO {
@PersistenceContext(unitName="Model")
private EntityManager em;
public UserDAOBean() {
public User getUser(int UserId) {
User u = new User();
u = em.find(User.class, UserId);
return u;
public List<User> getAllUsers() {
Query q = em.createQuery("SELECT u FROM User u");
List<User> users = q.getResultList();
return users;
public void createUser(User u) {
String hashedPw = hashPassword(u.getPassword());
u.setPassword(hashedPw);
em.persist(u);
public void updateUser(User u) {
String hashedPw = hashPassword(u.getPassword());
u.setPassword(hashedPw);
em.merge(u);
public void deleteUser(User u) {
em.remove(u);
private String hashPassword(String password) {
StringBuilder sb = new StringBuilder();
try {
MessageDigest messageDigest = MessageDigest.getInstance("SHA");
byte[] bs;
bs = messageDigest.digest(password.getBytes());
for (int i = 0; i < bs.length; i++) {
String hexVal = Integer.toHexString(0xFF & bs);
if (hexVal.length() == 1) {
sb.append("0");
sb.append(hexVal);
} catch (NoSuchAlgorithmException ex) {
Logger.getLogger(UserDAOBean.class.getName()).log(Level.SEVERE, null, ex);
return sb.toString();
Step 6: Create a Deployment file in the Model and Deploy this to a JAR file
Step 7: Now Right Click on View/Controller Node and create a Java File �
UserController.java -
package lux.controllers;
import javax.ejb.EJB;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;
import lux.domain.User;
import lux.facade.UserDAO;
public class UserController {
@EJB UserDAO userDao;
private User user;
private DataModel model;
public String createUser() {
this.user = new User();
return "create_new_user";
public String saveUser() {
String r = "success";
try {
userDao.createUser(user);
} catch (Exception e) {
e.printStackTrace();
r = "failed";
return r;
public DataModel getUsers() {
model = new ListDataModel(userDao.getAllUsers());
return model;
public User getUser() {
return user;
public void setUser(User user) {
this.user = user;
Step 8: Configure page flow in faces-config.xml
1. Create the JSP file adduser.jsp by right-clicking View-Controller
node and selecting New > JSP. Use the wizard to create JSF � JSP Page, fill in
File Name adduser.jsp, click Finish. -
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!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=UTF-8">
<title>New user</title>
</head>
<body>
<f:view>
<h:form>
<h:messages/>
<h:panelGrid columns="2">
<h:outputText value="Username"/>
<h:inputText
id="Username"
value="#{user.user.username}"
required="true"/>
<h:outputText value="First name"/>
<h:inputText
id="FirstName"
value="#{user.user.firstName}" />
<h:outputText value="Last name"/>
<h:inputText
id="LastName"
value="#{user.user.lastName}" />
<h:outputText value="Password" />
<h:inputSecret
id="Password"
value="#{user.user.password}"
required="true" />
<h:panelGroup/>
<h:commandButton
action="#{user.saveUser}"
value="Save"/>
</h:panelGrid>
</h:form>
</f:view>
</body>
</html>
2. Repeat the previous step for another JSP file failed.jsp.
3. On failed.jsp add the string
Save failed
Next we configure the page flow.
1. Open faces-config.xml.
2. Create index.jsp -
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!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=UTF-8">
<title>User Listing</title>
</head>
<body>
<f:view>
<h:form>
<h:outputText value="User Listing"/>
<h:commandLink action="#{user.createUser}" value="Create a user"/>
<h:dataTable value="#{user.user}"
var="dataTableItem" border="1" cellpadding="2" cellspacing="2">
<h:column>
<f:facet name="header">
<h:outputText value="Username"/>
</f:facet>
<h:outputText value="#{dataTableItem.username}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="First name"/>
</f:facet>
<h:outputText value="#{dataTableItem.firstName}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Last name"/>
</f:facet>
<h:outputText value="#{dataTableItem.lastName}" />
</h:column>
</h:dataTable>
</h:form>
</f:view>
</body>
</html>
3. Drag an arrow from index.jsp to adduser.jsp and replace the arrow�s label to create_new_user.
4. Repeat the previous step for failed, by dragging and arrow from adduser.jsp to failed.jsp renaming the label to f
ailed
5. Finally repeat the step for adduser.jsp, by dragging from adduser.jsp to index.jsp renaming the label to success.
This creates the following faces-config.xml file �
<?xml version='1.0' encoding='UTF-8'?>
<faces-config>
<managed-bean>
<managed-bean-name>user</managed-bean-name>
<managed-bean-class>lux.controllers.UserController</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>username</property-name>
<value>#{username}</value>
</managed-property>
<managed-property>
<property-name>firstName</property-name>
<value>#{firstName}</value>
</managed-property>
<managed-property>
<property-name>lastName</property-name>
<value>#{lastName}</value>
</managed-property>
<managed-property>
<property-name>password</property-name>
<value>#{password}</value>
</managed-property>
</managed-bean>
<navigation-rule>
<from-view-id>/index.jsp</from-view-id>
<navigation-case>
<from-outcome>create_new_user</from-outcome>
<to-view-id>/adduser.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/adduser.jsp</from-view-id>
<navigation-case>
<from-outcome>failed</from-outcome>
<to-view-id>/failed.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/index.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
Step 9: Create a Deployment file in the View-Controller and Deploy this to a WAR file
Step 10: Create a Deployment file in the View-Controller and create an EAR file and add Model�s JAR and View-Controller�s
WAR files to it.
Step 11: Run the JSP Files
SCENARIO END
Now, When I execute Index.jsp, it does not list values from database and when I click on Create User link, it takes me to adduser.jsp page. When I fill values in this page and click Save button, it takes me to Save Failed page and data does not persist to the database.
WHAT IS WRONG OUT HERE ???If you set a breakpoint in your createUser method - does this code get executed?
We have a couple of tutorials that might show you how to do this.
EJB/JSF with ADF-binding tutorial:
http://www.oracle.com/technology/obe/obe1013jdev/10131/ejb_and_jpa/master-detail_pagewith_ejb.htm
EJB/JSF without ADF binding:
http://www.oracle.com/technology/obe/JavaEE_tutorial_10131/index.htm -
Sort by date does not stick...
Is there a solution?I've tried re-installing my iTunes software and searched throughout the forums and elsewhere without so far being able to determine how to resolve this difficulty.
In case my original question formulation was not clear, in the past I could click on the header (while viewing my iTunes library in 'Songs' view) and cycle through "Album", "Album by Artist", in either ascending or descending order, and so forth.
Now I'm only able to chose between "Album by Artist", either ascending or descending. There is no "Album" view option available to me, as there has always been in the past.
I'm completely puzzled as to how this happened. Perhaps I inadvertently hit the wrong key combination while using iTunes and it changed something, I just don't know.
I would really appreciate it if any other forum members have suggestions as to how I might fix this! -
BAPI_BUPA_CENTRAL_CHANGE: Business partner does not exist
Hello,
I'm trying to change a business partner, which I created with BAPI_BUPA_CREATE_FROM_DATA.
But I get the error message "Business partner does not exist"
I do following:
1. create the BP with the BAPI_BUPA_CREATE_FROM_DATA
get the BUSINESSPATNER- number
2. fire BAPI_TRANSACTION_COMMIT.
In the SAP-GUI transaction BUP3 I can see my BP, ok
3. I try to change this BP with BAPI_BUPA_CENTRAL_CHANGE
and I get an error "Business partner does not exist"
Why?
I'm using JCO, I used to set BUSINESSPARTNER with and without leading zero - it doesn't work.
Can some one give me an advice?
Thanks,
Sergej BergHi,
The "VALID_DATE" should be set to the date of execution (at least this is what I'm doing in my system).
If you execute it via SE37 you can give it in the format of DDMMYYYY, but if you are testing an IDOC via WE19 you have to give it in the format of YYYYMMDD.
Enjoy,
Ayal. -
Segment Builder: 'Business partner does not exist in target group'
After having built a target group in the segment builder the following error message occurs: 'Business partner does not exist in target group'. What is meant by this error message and what has caused this error?
Hi Mahesh,
Are data sources based in infoset¿? If the are based in infoset u can do simple queries.
I create infoset in t-code 'SQ02', once the infoset has been created u can go to 'Enviroment' --> Queries, and here u can created simple queries based in the infoset. With this tool u can check if this infoset has been created sucessfully.
Hope it helps u.
Regards,
Mon -
Validation "is a valid date" does not pass but Apex proceeding anyway
Hi,
I have a simple date-item which I validate first against "not null", then for "is a valid date", then that the date is not in the future.
In debug mode the first validation passes, the second ( is a valid date ) does not pass, but the validation process proceeds anyway...!? Then the third validation "date not in the future" produces ad DB-Error because it is not a valid date.
Why does the validation proceed even if the validation does not pass...?
Version 2.2.0
JuergenJuergen,
"In debug mode the first validation passes, the second ( is a valid date ) does not pass, but the validation process proceeds anyway...!?"
Do you mean that the third validation is firing even though the second is failing? This behaviour is correct. All validations fire (regardless of any having already failed) unless they have specific conditions set on them to make them act differently.
If you don't want the third validation to fire if the second has failed then you will need to put a condition on the 3rd validation to prevent this. Alternatively you could bundle all you validations into one of type "PL/SQL returning Error Text" then have some IF...THEN...ELSE logic in your PL/SQL to return the relevant validatoin text depending on what the problem is (i.e. Date is null, date is invalid or date is in the future).
Andy
Maybe you are looking for
-
I can't even purchase them again...which I'd be willing to do if I could because I've had to do that in the past. But I can't even do that now. I'd like either a credit on my account or a way to get these songs!
-
Calling a dos shell with a servlet
I am using the code below to call a dos shell using a servlet. will you please tell what is wrong with my code. thank you. public class ResponseServlet extends HttpServlet { public void doGet (HttpServletRequest request, HttpServletResponse response)
-
OpenSSO wiht security-costraints : PROBLEM!!!
HI, i'm developing a simple web application. I use openSSO for authentication and i need to use a security costraint for blocking page to any groups of users. The problem is: I log in with an authorizated user and i obtain a 403 forbidden error when
-
Have an image as title and form underneath?
Hi, I'm trying to put an image on the top of my Midlet. Currently it has a form as a 'init' with a few items in it. The problem is I want an image as title intstead of String title. Can i remove the title in form and kind of move it down so that i ca
-
Hello! I'd like to change the default jdk to a newer version (JDK 1.6u13) but I got the following message when the web server propagate the change to all instances and restart: [25/Mar/2009:18:00:22] info (25020): CORE5076: Using [Java HotSpot(TM) 64