RV082 to SA540 tunnel but no ping - HELP
I'll try my best to explani and give details.
SA540 v.2.1.71 at host
RV082 v4.2.1.02 at remote site.
Trying to setup tunnel between the 2. WHEN this works, I'll have 20 remote sites tunneling into the SA540 host.
SA540:
SA540 says site to site vpn is up and IPsec SA Established.
192.168.1.0
Gateway Policies
Client Policies
Exchange Mode:
Main
Aggressive
ID Type:
Local WAN IP
FQDN
Local WAN ID:
Local WAN IP
local.com
Remote WAN ID:
N/A
remote.com
Encryption Algorithm:
AES-128
AES-128
Authentication Algorithm:
SHA-1
SHA-1
Authentication Method:
Pre-shared Key
Pre-shared Key
Key-Group:
DH-Group 2 (1024 bit)
DH-Group 2 (1024 bit)
Life Time:
8 hours
8 hours
VPN Wizard default values for VPN:
Encryption Algorithm:
AES-128
Authentication Algorithm:
SHA-1
Life Time:
1 hour
PFS Key Group:
DH-Group 2(1024 bit)
NETBIOS:
Enabled (Gateway Policies)
Disabled (Client Policies)
WAN Security Checks
Block Ping to WAN interface
Enable Stealth Mode
Block TCP flood
RV082:
RV082 says gateway to gateway is Connected.
192.168.2.0
same settings w/ Aggressive, Keep Alive and NAT Traversal checked.
Firewall Setting Status
SPI (Stateful Packet Inspection) :
On
DoS (Denial of Service) :
On
Block WAN Request :
Off
Remote Management :
On
FROM RV082 diagnostics on router, I cannot ping 192.168.1.1 router or 192.168.1.70 server inside host.
FROM SA540 host diagnostics, I CAN ping 192.168.2.1 when I check Ping through VPN tunnel, but I canNOT ping an XP computer at 192.168.2.100 which has firewall turned off.
What am I missing?
Goal is to establish full tunneling and computer/server access between sites.
Any help is greatly appreciated.
I have added the permit any any on the outside and vpn interfaces of both ASAs. I also change the source and destination of the nat exempt rule to any any.
Similar Messages
-
RV082 to SA540 vpn but no ping, something wrong
I'll try my best to explani and give details.
SA540 v.2.1.71 at host
RV082 v4.2.1.02 at remote site.
Trying to setup tunnel between the 2. WHEN this works, I'll have 20 remote sites tunneling into the SA540 host.
SA540:
SA540 says site to site vpn is up and IPsec SA Established.
192.168.1.0
Gateway Policies
Client Policies
Exchange Mode:
Main
Aggressive
ID Type:
Local WAN IP
FQDN
Local WAN ID:
Local WAN IP
local.com
Remote WAN ID:
N/A
remote.com
Encryption Algorithm:
AES-128
AES-128
Authentication Algorithm:
SHA-1
SHA-1
Authentication Method:
Pre-shared Key
Pre-shared Key
Key-Group:
DH-Group 2 (1024 bit)
DH-Group 2 (1024 bit)
Life Time:
8 hours
8 hours
VPN Wizard default values for VPN:
Encryption Algorithm:
AES-128
Authentication Algorithm:
SHA-1
Life Time:
1 hour
PFS Key Group:
DH-Group 2(1024 bit)
NETBIOS:
Enabled (Gateway Policies)
Disabled (Client Policies)
WAN Security Checks
Block Ping to WAN interface
Enable Stealth Mode
Block TCP flood
RV082:
RV082 says gateway to gateway is Connected.
192.168.2.0
same settings w/ Aggressive, Keep Alive and NAT Traversal checked.
Firewall Setting Status
SPI (Stateful Packet Inspection) :
On
DoS (Denial of Service) :
On
Block WAN Request :
Off
Remote Management :
On
FROM RV082 diagnostics on router, I cannot ping 192.168.1.1 router or 192.168.1.70 server inside host.
FROM SA540 host diagnostics, I CAN ping 192.168.2.1 when I check Ping through VPN tunnel, but I canNOT ping an XP computer at 192.168.2.100 which has firewall turned off.
What am I missing?
Goal is to establish full tunneling and computer/server access between sites.
Any help is greatly appreciated.I have added the permit any any on the outside and vpn interfaces of both ASAs. I also change the source and destination of the nat exempt rule to any any.
-
RV220W IPsec tunnel connected, but no ping is working
Hello,
I have a problem with my RV220w router and IPsec connections.
The tunnel is connected, but no ping is working. I have not changed any Settings on the Client Site or Router Site. The last succsessful tunnel wit this configuration is a half year ago.
The local and remote network have different ip-address.
I have both firmware versions 1.0.4.17 and 1.0.5.8 tested.
A tunnel over PPTP is working fine. The ping works successful.
Has anyone an idea?
kind regards
Martin Schubert
Configuration:
Client Software:
- Windows 7 64Bit
- ShrewSoft VPNClient 2.2.2
n:version:4
n:network-ike-port:500
n:network-mtu-size:1380
n:client-addr-auto:1
n:network-natt-port:4500
n:network-natt-rate:15
n:network-frag-size:540
n:network-dpd-enable:0
n:client-banner-enable:1
n:network-notify-enable:1
n:client-dns-used:1
n:client-dns-auto:1
n:client-dns-suffix-auto:1
n:client-splitdns-used:1
n:client-splitdns-auto:1
n:client-wins-used:0
n:client-wins-auto:1
n:phase1-dhgroup:5
n:phase1-life-secs:86400
n:phase1-life-kbytes:0
n:vendor-chkpt-enable:0
n:phase2-life-secs:3600
n:phase2-life-kbytes:0
n:policy-nailed:0
n:policy-list-auto:0
n:phase1-keylen:0
n:phase2-keylen:0
s:client-auto-mode:pull
s:client-iface:direct
s:network-natt-mode:enable
s:network-frag-mode:enable
s:auth-method:mutual-psk-xauth
s:ident-client-type:fqdn
s:ident-server-type:fqdn
s:ident-client-data:remote.com
s:ident-server-data:local.com
s:phase1-exchange:aggressive
s:phase1-cipher:aes
s:phase1-hash:sha2-256
s:phase2-transform:esp-aes
s:phase2-hmac:sha2-256
s:ipcomp-transform:disabled
n:phase2-pfsgroup:5
s:policy-level:auto
s:policy-list-include:192.168.1.0
Router:
IpsecIKEPolicy[1]["Direction"] = "1"
IpsecIKEPolicy[1]["EncryptionAlgorithm"] = "5"
IpsecIKEPolicy[1]["LocalIdentifier"] = "local.com"
IpsecIKEPolicy[1]["ExchangeMode"] = "1"
IpsecIKEPolicy[1]["RemoteIdentifier"] = "remote.com"
IpsecIKEPolicy[1]["Presharedkey"] = "is secret"
IpsecIKEPolicy[1]["IKEPolicyName"] = "abc"
IpsecIKEPolicy[1]["LocalIdentifierType"] = "1"
IpsecIKEPolicy[1]["SALifeTime"] = "28800"
IpsecIKEPolicy[1]["DPDDetectionPeriod"] = "10"
IpsecIKEPolicy[1]["ModeConfigStatus"] = "0"
IpsecIKEPolicy[1]["XAUTHType"] = "2"
IpsecIKEPolicy[1]["DPDFailureCount"] = "3"
IpsecIKEPolicy[1]["AuthAlgorithm"] = "3"
IpsecIKEPolicy[1]["AuthType"] = "0"
IpsecIKEPolicy[1]["DHGroup"] = "5"
IpsecIKEPolicy[1]["DPD"] = "0"
IpsecIKEPolicy[1]["_ROWID_"] = "1"
IpsecIKEPolicy[1]["RemoteIdentifierType"] = "1"
IpsecVPNPolicy[1]["EnableKeepAlive"] = "0"
IpsecVPNPolicy[1]["LocalSubnetMask"] = "255.255.255.0"
IpsecVPNPolicy[1]["EncryptionAlgorithm"] = "5"
IpsecVPNPolicy[1]["AuthAlgorithm"] = "3"
IpsecVPNPolicy[1]["RemoteNetworkType"] = "0"
IpsecVPNPolicy[1]["LocalGateway"] = "0"
IpsecVPNPolicy[1]["RVGStatus"] = "0"
IpsecVPNPolicy[1]["VPNPolicyName"] = "abc"
IpsecVPNPolicy[1]["LocalStartAddress"] = "192.168.1.0"
IpsecVPNPolicy[1]["Status"] = "1"
IpsecVPNPolicy[1]["Netbios"] = "0"
IpsecVPNPolicy[1]["AutoPolicyType"] = "1"
IpsecVPNPolicy[1]["KeepAlivePeriod"] = "10"
IpsecVPNPolicy[1]["PFSKeyGroup"] = "5"
IpsecVPNPolicy[1]["SPIOut"] = "0x"
IpsecVPNPolicy[1]["KeepAliveFailureCount"] = "3"
IpsecVPNPolicy[1]["LocalNetworkType"] = "3"
IpsecVPNPolicy[1]["SALifeTime"] = "3600"
IpsecVPNPolicy[1]["IKEPolicyName"] = "abc"
IpsecVPNPolicy[1]["FailbackTime"] = "30"
IpsecVPNPolicy[1]["RemoteEndPoint"] = "remote.com"
IpsecVPNPolicy[1]["NodeId"] = "1"
IpsecVPNPolicy[1]["SALifeTimeType"] = "0"
IpsecVPNPolicy[1]["PolicyType"] = "1"
IpsecVPNPolicy[1]["SPIIn"] = "0x"
IpsecVPNPolicy[1]["RemoteEndPointType"] = "1"
IpsecVPNPolicy[1]["_ROWID_"] = "1"
IpsecVPNPolicy[1]["Rollover"] = "0"At the glance,
First, what are your netmasks for those networks? I suppose they are 255.255.255.0.
Second, check your Remote Security Group and Local Security Group on B and C for their tunnel. Maybe permutation?
Third, check Routing table (Setup->More->Advanced Routing then at the bottom Show Routing Table).
Should be something like - on B:
10.0.0.0
255.255.255.0
GW for B
10
ipsec0
and on C:
10.0.1.0
255.255.255.0
GW for C
10
ipsec0 -
I'm having trouble with my MBA with internet connection to any application. Using the Network utlity it will run a Traceroute, but cannot Ping any address. The Netstat shows it is connected to a foreign address, but nothing gets passed to any of my applications. I've turned off the system firewalland remove other apps that might interfere, to no avail. I just found a Flash virus called Games.exe and am working to get rid of it. Any other ideas what might be causing this problem?
Thanks!How are you connecting to the Internet?
Who is your ISP?
Give this a try. Open Network System Preferences, select your connection method (Ethernet or WiFi), then click on the Advanced button.
Click on the DNS tab.
Note what is listed in the DNS Servers: list. It should be a grayed out address of your router IP address.
If it is not, please post what it says.
If it is just your router address, then click the Add button ( + ) and enter these servers:
208.67.222.222 and 208.67.220.220
Then, try to connect to the internet.
EDIT: sorry, I missed this before posting:
I've connected via a USB dongle directly to the cellular network and via my wireless network at home.
If that is the case, it is very likely that the MacBook Air is not getting the correct DNS servers passed to it from the router. Adding the OpenDNS servers as I described above should help. -
Cant Ping UC320W from 881 but can ping 881 from UC320w
Hi,
Wondering if soembody could help me here. I have a uc320 and router directly connected and I can ping the router from the 320 but cant ping the other way. As a result I only have SIP traffic working outbound but cant get and calls inbound. Im missing something here but cant figure out what
Any ideas ?
Thanks a million
J-PHi,
Thanks for the response. The UC320 has the WAN Interface is statically assigned 192.160.160.2/30 and the gateway is
192.160.160.1 there is no CLI on the 320 so cant provide any config. I can ping the 881 from the 320 no problem but it wont work the other way. Evrything looks like it up and running from show commands etc.
The config of the 881 is below have changed the wan address's etc for obviuos reasons -
version 12.4
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
hostname _Router
boot-start-marker
boot-end-marker
logging message-counter syslog
no aaa new-model
dot11 syslog
ip source-route
ip cef
ip name-server 83.147.160.2
ip name-server 83.147.160.130
no ipv6 cef
multilink bundle-name authenticated
archive
log config
hidekeys
class-map match-any VOIP
match protocol rtp audio
class-map match-any WEB_TRAFFIC
match protocol http
match protocol ftp
match protocol secure-http
match protocol secure-ftp
class-map match-any VIDEO
match protocol rtp video
policy-map QOS_POLICY
class VOIP
priority percent 15
set dscp ef
class WEB_TRAFFIC
bandwidth percent 30
random-detect
set dscp af32
class VIDEO
bandwidth percent 20
set dscp cs4
class class-default
bandwidth percent 30
random-detect
set dscp default
interface FastEthernet0
switchport trunk native vlan 100
switchport mode trunk
interface FastEthernet1
interface FastEthernet2
interface FastEthernet3
switchport mode trunk
interface FastEthernet4
bandwidth 5000
no ip address
speed 100
full-duplex
service-policy output QOS_POLICY
interface FastEthernet4.201
description Voice_VLAN
encapsulation dot1Q 201
ip address 172.18.24.x 255.255.255.252
ip nat outside
ip virtual-reassembly
interface FastEthernet4.202
description DATA_VLAN
encapsulation dot1Q 202
ip address 92.51.19.x 255.255.255.252
ip nat outside
ip virtual-reassembly
interface Vlan1
ip address 192.168.160.1 255.255.255.0
ip nat inside
ip virtual-reassembly
interface Vlan100
ip address 192.160.160.1 255.255.255.0
ip nat inside
ip virtual-reassembly
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 92.51.19.X
ip route 172.18.24.x 255.255.255.255 172.18.24.x
no ip http server
no ip http secure-server
ip nat sip-sbc
ip nat inside source static udp 192.160.160.2 5060 interface FastEthernet4.201 5060
ip nat inside source list 1 interface FastEthernet4.201 overload
ip nat inside source list 2 interface FastEthernet4.202 overload
access-list 1 permit 192.160.160.0 0.0.0.255
access-list 2 permit 192.168.1.0 0.0.0.255
banner login
Thanks again
J-P -
Cannot ping Real IP, but can ping Virtual IP, what is the issue?
Hi
I have load balancing for some servers on CSM, i can ping to VIP but cannot ping to Real IP of servers behind CSM. I need it for some testing and management pupose, Can anyone help to spot the issue? thanx
Topology
MSFC--FWSM--CSM--serversin routed mode, by default, the CSM does not allow client to connect directly to the servers.
To allow this traffic you need to create a vserver for the subnet with a predictor forward serverfarm
ie:
serverfarm route
no nat server
predictor forward
vserver vlanX
vip x.x.x.0 /24 any
serverfarm route
inservice
Gilles. -
Import is not available all other actions are active but not import help?
Import is not available all other actions are active but not import help? I wish to import bookmarks from internet explorer, I am using windows 7
Make sure that you do not run Firefox in permanent Private Browsing mode.
*https://support.mozilla.com/kb/Private+Browsing
*You enter Private Browsing mode if you select: Tools > Options > Privacy > History: Firefox will: "Never Remember History"
*To see all History and Cookie settings, choose: Tools > Options > Privacy, choose the setting <b>Firefox will: Use custom settings for history</b>
* Deselect: [ ] "Permanent Private Browsing mode" -
I recently sync one song to my friends iphone 4 and it erased all the music and only put that one song. I tried backing it up but it didnt help. How do I put all previous music back on the iphone?
Re- sync the phone with the computer it was originally synced with.
-
Warning this is very long code but i need help to see if I am on right trac
I have done all the following code myself and it is the buisiness layer for my application. I have tried to follow recommendations on previous posts and I would like to be told where I can clean up my code and how? This is not complete and it looks very long to me but I need help in order to be better. There are 4 button vlivks and I have not completed them all. The criteria for application is that phonebook will accept new entries if they have names surnames and phone numbers that are not longer than 10 characters for display purposes but can change this. No duplicates are allowed. No editing of a existing entry must lead to a duplicate entry either. No new entry or edit may result in a new contact having no phone numbers.
Many thanks for your time in advance,.....
import javax.swing.JOptionPane;
import java.util.ArrayList;
public class Contact
{// Start of the Contact class
ArrayList<ContactDetails> phoneList = new ArrayList<ContactDetails>(); // To hold all the contacts
ArrayList<ContactDetails> searchList = new ArrayList<ContactDetails>(); // To hold all contacts that return true on search
ArrayList<ContactDetails> list = new ArrayList<ContactDetails>();
String newName; // To hold the new name
String newSurname; // to hold the new surname
String newHome; // To hold the new home number if any
String newWork; // To hold the new work number
String newCell; // To hold the new cell number
final int MAX_LENGTH = 10;
public boolean addToPhoneList; // Sets to false if there is an invalid entry
public boolean addToSearchList; // Sets to false if there is an invlid search
public boolean modifyContact; // Sets to false if there is an invalid modification
// Method to create a new contact
public void createNew()
{// Start of create new()
addToPhoneList = true; // Set boolean to true each time the method is executed
getNewContactsName(); // Get new name
if(addToPhoneList == false)
createNew();
return;
getNewContactsSurname(); //Get new surname
if(addToPhoneList == false)
createNew();
return;
String checkName = newName; //Creates copies to be used in the checkIfDuplicate method
String checkSurname = newSurname;
addToPhoneList = checkIfDuplicate(checkName, checkSurname); //Check if the entries are duplicate
if(addToPhoneList == false)
createNew();
return;
getNewContactsHomeNum(); // Get new home number
if(addToPhoneList == false)
createNew();
return;
getNewContactsWorkNum(); // Get new work number
if(addToPhoneList == false)
createNew();
return;
getNewContactsCellNum(); // Get new cell number
if(addToPhoneList == false)
createNew();
return;
checkAtLeastOneNumEntered(); // Check that at least one phone number was entered
if(addToPhoneList == true)
updateListWithNew();
}// End of createNew()
// Method to search for an existing contact
public void searchExisting()
{// Start of searchExisting()
addToSearchList = true; // Set the boolean true
searchList.clear(); // Clear list from any previous searches
if(phoneList.size() > 0) // Check if any contacts are in the list
getExistingDetailsAndSearch(); // If there are entries then continue to search
else
JOptionPane.showMessageDialog(null,"There are no contacts to search for. Please use this option when you have added a contact to the list.","Error",JOptionPane.ERROR_MESSAGE);
}// End of searchExisting()
// Method to modify an existing contact
public void modifyExisting()
{// Start of modifyExisting()
modifyContact = true; // Set the boolean to true
if(phoneList.size() <= 0) // Check if the phonelist is not empty
JOptionPane.showMessageDialog(null,"There are no contacts to modify. Please use this option when there have been contacts added to the list.","Error",JOptionPane.ERROR_MESSAGE);
else
getExistingDetailsAndModify(); // If phonelist not emty continue to modify method
}// End of modifyExisting()
//Method to delete a contact from the list
public void deleteExisting()
//Method to get new contacts name
public void getNewContactsName()
newName = JOptionPane.showInputDialog("Please enter the new contacts name or press cancel to exit without saving.");
if(newName == null)
finish();
if(newName.trim().length()<=0)
JOptionPane.showMessageDialog(null,"You have not entered a name. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
addToPhoneList = false;
return;
addToPhoneList = checkLengthValid(newName, "name");
//Method to get a new contacts surname
public void getNewContactsSurname()
newSurname = JOptionPane.showInputDialog("Please enter the new contacts surnname or press cancel to exit without saving.");
if(newSurname == null)
finish();
addToPhoneList = checkLengthValid(newSurname, "surname");
//Method to get a new contacts home number
public void getNewContactsHomeNum()
newHome = JOptionPane.showInputDialog("Please enter the new contacts home number or press cancel to exit without saving.");
if(newHome == null)
finish();
if(newHome.trim().length() > 0)
try
Long homeNum = Long.parseLong(newHome);
catch(Exception e)
JOptionPane.showMessageDialog(null,"You may only use numbers for a valid phone number. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
addToPhoneList = false;
return;
addToPhoneList = checkLengthValid(newHome, "home number");
//Method to get a new contacst work number
public void getNewContactsWorkNum()
newWork = JOptionPane.showInputDialog("Please enter the new contacts work number or press cancel to exit without saving");
if(newWork == null)
finish();
if(newWork.trim().length()> 0)
try
Long workNum = Long.parseLong(newWork);
catch(Exception e)
JOptionPane.showMessageDialog(null,"You may only use numbers for a valid number. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
addToPhoneList = false;
return;
addToPhoneList = checkLengthValid(newWork, "work number");
//Method to get a new contacts cell number
public void getNewContactsCellNum()
newCell = JOptionPane.showInputDialog("Please enter the new contacts cell number or press cancel to exit without saving");
if(newCell == null)
finish();
if(newCell.trim().length() > 0)
try
Long cellNum = Long.parseLong(newCell);
catch(Exception e)
JOptionPane.showMessageDialog(null,"You may only use numbers for a valid number. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
addToPhoneList = false;
return;
addToPhoneList = checkLengthValid(newCell, "cell number");
//Method to get the details for an existing contact
public void getExistingDetailsAndSearch()
String existingName = getExistingName("search for");
if(existingName == null)
addToSearchList = false;
return;
if(existingName.length()<=0)
JOptionPane.showMessageDialog(null,"You have not entered a name please try again","Error",JOptionPane.ERROR_MESSAGE);
addToSearchList = false;
searchExisting();
String existingSurname = getExistingSurname();
if(existingSurname == null)
return;
if(addToSearchList == true)
searchAndAddIfFound(existingName, existingSurname);
//Method to get existing details and modify contact
public void getExistingDetailsAndModify()
String existingName = getExistingName("modify");
if(existingName == null)
modifyContact = false;
return;
if(existingName.length()<=0)
JOptionPane.showMessageDialog(null,"You have not entered a name please try again","Error",JOptionPane.ERROR_MESSAGE);
modifyContact = false;
modifyExisting();
String existingSurname = getExistingSurname();
if(existingSurname == null)
return;
if(modifyContact == true)
getContactBySearch(existingName.trim().toUpperCase(), existingSurname.trim().toUpperCase());
//Method to get the contact from list and modify details
public void getContactBySearch(String currentName, String currentSurname)
int count = 0;
int numFound = 0;
for(ContactDetails cd: phoneList)
cd = phoneList.get(count);
if((cd.name.equals(currentName))&&(cd.surname.equals(currentSurname)))
numFound ++;
changeDetails(cd);
count ++;
if(numFound <= 0)
JOptionPane.showMessageDialog(null,"No contacts matching the name and surname you entered found. Press the modify button to try again.","Information",JOptionPane.INFORMATION_MESSAGE);
//Method to get existing contacts name
public String getExistingName(String whatWasClicked)
String name = JOptionPane.showInputDialog("Please enter the contacts name that you wish to "+whatWasClicked);
return name;
//Method to get an existing contacts surname
public String getExistingSurname()
String surname = JOptionPane.showInputDialog("Please enter the contacts surname.");
return surname;
//Method to change the details of contact
public void changeDetails(ContactDetails conToChange)
String currentName = conToChange.name;
String currentSurname = conToChange.surname;
String currentHome = conToChange.home;
String currentWork = conToChange.work;
String currentCell = conToChange.cell;
String newNameForContact = getNewModName(currentName);
if(modifyContact == false)
modifyExisting();
return;
String newSurnameForContact = getNewModSurname(currentSurname);
if(modifyContact == false)
modifyExisting();
return;
String newHomeForContact = getNewModHome(currentHome);
if(modifyContact == false)
modifyExisting();
return;
String newWorkForContact = getNewModWork(currentWork);
if(modifyContact == false)
modifyExisting();
return;
String newCellForContact = getNewModCell(currentCell);
if(modifyContact == false)
modifyExisting();
return;
if(modifyContact == true)
conToChange.name = newNameForContact;
//Method to get the modified name
public String getNewModName(String currentName)
String newModifiedName = JOptionPane.showInputDialog("Please enter the new name for contact or press cancel to keep it as is.");
if(newModifiedName == null)
return currentName;
if(newModifiedName.trim().length() <= 0)
JOptionPane.showMessageDialog(null,"You may not replace the existing name with a blank name. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
modifyContact = false;
return currentName;
modifyContact = checkLengthValid(newModifiedName, "modified name");
return newModifiedName;
//Method to get the modified surname
public String getNewModSurname(String currentSurname)
String newModifiedSurname = JOptionPane.showInputDialog("Please enter the new surname for the contact or press cancel to keep it as is.");
if(newModifiedSurname == null)
return currentSurname;
modifyContact = checkLengthValid(newModifiedSurname, "modified surname");
if(modifyContact == false)
JOptionPane.showMessageDialog(null,"Surname not changed.","Information",JOptionPane.INFORMATION_MESSAGE);
return currentSurname;
modifyContact = checkLengthValid(newModifiedSurname, "modified surname");
return newModifiedSurname;
//Method to search and update the list with a succesfull search
private void searchAndAddIfFound(String name, String surname)
int count = 0;
int numFound = 0;
for(ContactDetails cd: phoneList)
cd = phoneList.get(count);
if(cd.name.equals(name.trim().toUpperCase()))
numFound ++;
searchList.add(cd);
count ++;
if(numFound <= 0)
JOptionPane.showMessageDialog(null,"No contacts were found matching the dat you entered.","Information",JOptionPane.INFORMATION_MESSAGE);
else
list.clear();
list.addAll(searchList);
//Method that check all entries are a valid logical length
//Method is based on assumption that a normal name, surname, and phone numbers are not longer than 10 characters long.
//IF This method is changed please change the layout in the GUI as this is also set to fit with the layout that gives a neat //apperance
private boolean checkLengthValid(String detailEntered, String whatWasEntered)
boolean validLength = true;
if(detailEntered.trim().length() >= MAX_LENGTH)
JOptionPane.showMessageDialog(null,"The " +whatWasEntered+" you entered is too long. Please try again and use a "+whatWasEntered+" that is less than "+MAX_LENGTH+" characters long.","Error",JOptionPane.ERROR_MESSAGE);
validLength = false;
return validLength;
private void finish()
System.exit(0);
//Method to update the list with a new entry
private void updateListWithNew()
try
ContactDetails cd = new ContactDetails();
cd.name = newName.trim().toUpperCase();
cd.surname = newSurname.trim().toUpperCase();
cd.home = newHome.trim();
cd.work = newWork.trim();
cd.cell = newCell.trim();
phoneList.add(cd);
JOptionPane.showMessageDialog(null,"Contact succesfully entered. To save this change press exit to save or use the save option in the toolbar menu.","Information",JOptionPane.INFORMATION_MESSAGE);
catch(Exception e)
JOptionPane.showMessageDialog(null,"Failed to add contact to list. If problem persists please contact the software developer.","Error",JOptionPane.ERROR_MESSAGE);
list.clear();
list.addAll(phoneList);
//Method to check for duplicate
public boolean checkIfDuplicate(String nameToCheck, String surnameToCheck)
int count = 0;
boolean valid = true;
for(ContactDetails cd : phoneList)
cd = phoneList.get(count);
if(((nameToCheck.trim().toUpperCase()).equals(cd.name))&&((surnameToCheck.trim().toUpperCase()).equals(cd.surname)))
JOptionPane.showMessageDialog(null,"You may not enter a duplicate contact. Please try again and change the name and surname.","Error",JOptionPane.ERROR_MESSAGE);
valid = false;
break;
count ++;
return valid;
//Method to check that at least one phone number exists for contact
public void checkAtLeastOneNumEntered()
if((newHome.trim().length()<=0)&&(newWork.trim().length()<=0)&&(newCell.trim().length()<=0))
JOptionPane.showMessageDialog(null,"You have not entered any phone number at all. You must enter at least one phone number for a new contact.","Error",JOptionPane.ERROR_MESSAGE);
addToPhoneList = false;
//Method that returns the list to the GUI
public ArrayList<ContactDetails> getList()
return list;
}Should I start over from scratch? Can I get help with links to tutorials on following? How to create a java CRUD application (google not useful) and how to layer in java(google not useful)
This is my pres layer as is is this wrong too?
Filename: ContactsListInterface.java
Date: 16 March 2008
Programmer: Yucca Nel
Purpose: Provides a GUI for entering names and contact numbers into a telephone directory.
Also allows options for searching for a specific name and deleting of data from the record
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.*;
import java.io.*;
import java.util.*;
import java.text.*;
public class Phonebook1 extends JFrame implements ActionListener
{ //start of class
// construct fields, buttons, labels,text boxes, ArrayLists etc
JTextPane displayPane = new JTextPane();
JLabel listOfContacts = new JLabel("List Of Contacts"); // creates a label for the scrollpane
JButton createButton = new JButton("Create");
JButton searchButton = new JButton("Search");
JButton modifyButton = new JButton("Modify");
JButton deleteButton = new JButton("Delete");
Contact c = new Contact();
ArrayList<ContactDetails> contactList = c.getList();
// create an instance of the ContactsListInterface
public Phonebook1()
{ // start of cli()
super("Phonebook Interface");
} // end of cli()
public JMenuBar createMenuBar()
{ // start of the createMenuBar()
// construct and populate a menu bar
JMenuBar mnuBar = new JMenuBar(); // creates a menu bar
setJMenuBar(mnuBar);
JMenu mnuFile = new JMenu("File",true); // creates a file menu in the menu bar which is visible
mnuFile.setMnemonic(KeyEvent.VK_F);
mnuFile.setDisplayedMnemonicIndex(0);
mnuFile.setToolTipText("File Options");
mnuBar.add(mnuFile);
JMenuItem mnuFileExit = new JMenuItem("Save And Exit"); // creates an exit option in the file menu
mnuFileExit.setMnemonic(KeyEvent.VK_X);
mnuFileExit.setDisplayedMnemonicIndex(1);
mnuFileExit.setToolTipText("Close Application");
mnuFile.add(mnuFileExit);
mnuFileExit.setActionCommand("Exit");
mnuFileExit.addActionListener(this);
JMenu mnuEdit = new JMenu("Edit",true); // creates a menu for editing options
mnuEdit.setMnemonic(KeyEvent.VK_E);
mnuEdit.setDisplayedMnemonicIndex(0);
mnuEdit.setToolTipText("Edit Options");
mnuBar.add(mnuEdit);
JMenu mnuEditSort = new JMenu("Sort",true); // creates an option for sorting entries
mnuEditSort.setMnemonic(KeyEvent.VK_S);
mnuEditSort.setDisplayedMnemonicIndex(0);
mnuEdit.add(mnuEditSort);
JMenuItem mnuEditSortByName = new JMenuItem("Sort By Name"); // to sort entries by name
mnuEditSortByName.setMnemonic(KeyEvent.VK_N);
mnuEditSortByName.setDisplayedMnemonicIndex(8);
mnuEditSortByName.setToolTipText("Sort entries by first name");
mnuEditSortByName.setActionCommand("Name");
mnuEditSortByName.addActionListener(this);
mnuEditSort.add(mnuEditSortByName);
JMenuItem mnuEditSortBySurname = new JMenuItem("Sort By Surname"); // to sort entries by surname
mnuEditSortBySurname.setMnemonic(KeyEvent.VK_R);
mnuEditSortBySurname.setDisplayedMnemonicIndex(10);
mnuEditSortBySurname.setToolTipText("Sort entries by surname");
mnuEditSortBySurname.setActionCommand("Surname");
mnuEditSortBySurname.addActionListener(this);
mnuEditSort.add(mnuEditSortBySurname);
JMenu mnuHelp = new JMenu("Help",true); // creates a menu for help options
mnuHelp.setMnemonic(KeyEvent.VK_H);
mnuHelp.setDisplayedMnemonicIndex(0);
mnuHelp.setToolTipText("Help options");
mnuBar.add(mnuHelp);
JMenuItem mnuHelpHelp = new JMenuItem("Help"); // creates a help option for help topic
mnuHelpHelp.setMnemonic(KeyEvent.VK_P);
mnuHelpHelp.setDisplayedMnemonicIndex(3);
mnuHelpHelp.setToolTipText("Help Topic");
mnuHelpHelp.setActionCommand("Help");
mnuHelpHelp.addActionListener(this);
mnuHelp.add(mnuHelpHelp);
JMenuItem mnuHelpAbout = new JMenuItem("About"); // creates a about option for info about api
mnuHelpAbout.setMnemonic(KeyEvent.VK_T);
mnuHelpAbout.setDisplayedMnemonicIndex(4);
mnuHelpAbout.setToolTipText("About this program");
mnuHelpAbout.setActionCommand("About");
mnuHelpAbout.addActionListener(this);
mnuHelp.add(mnuHelpAbout);
return mnuBar;
} // end of the createMenuBar()
// create the content pane
public Container createContentPane()
{ // start of createContentPane()
//construct and populate panels and content pane
JPanel labelPanel = new JPanel(); // panel is only used to put the label for the textpane in
labelPanel.setLayout(new FlowLayout());
labelPanel.add(listOfContacts);
JPanel displayPanel = new JPanel();// panel is used to display all the contacts and thier numbers
setTabsAndStyles(displayPane);
displayPane = addTextToTextPane();
displayPane.setEditable(false);
JScrollPane scrollPane = new JScrollPane(displayPane);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); // pane is scrollable vertically
scrollPane.setWheelScrollingEnabled(true);// pane is scrollable by use of the mouse wheel
scrollPane.setPreferredSize(new Dimension(400,320));
displayPanel.add(scrollPane);
JPanel workPanel = new JPanel();// panel is used to enter, edit and delete data
workPanel.setLayout(new FlowLayout());
workPanel.add(createButton);
createButton.setToolTipText("Create a new entry");
createButton.addActionListener(this);
workPanel.add(searchButton);
searchButton.setToolTipText("Search for an entry by name number or surname");
searchButton.addActionListener(this);
workPanel.add(modifyButton);
modifyButton.setToolTipText("Modify an existing entry");
modifyButton.addActionListener(this);
workPanel.add(deleteButton);
deleteButton.setToolTipText("Delete an existing entry");
deleteButton.addActionListener(this);
labelPanel.setBackground(Color.red);
displayPanel.setBackground(Color.red);
workPanel.setBackground(Color.red);
// create container and set attributes
Container c = getContentPane();
c.setLayout(new BorderLayout(30,30));
c.add(labelPanel,BorderLayout.NORTH);
c.add(displayPanel,BorderLayout.CENTER);
c.add(workPanel,BorderLayout.SOUTH);
c.setBackground(Color.red);
// add a listener for the window closing and save
addWindowListener(
new WindowAdapter()
public void windowClosing(WindowEvent e)
int answer = JOptionPane.showConfirmDialog(null,"Are you sure you would like to save all changes and exit?","File submission",JOptionPane.YES_NO_OPTION);
if(answer == JOptionPane.YES_OPTION)
System.exit(0);
return c;
} // end of createContentPane()
protected void setTabsAndStyles(JTextPane displayPane)
{ // Start of setTabsAndStyles()
// set Font style
Style fontStyle = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE);
Style regular = displayPane.addStyle("regular", fontStyle);
StyleConstants.setFontFamily(fontStyle, "SansSerif");
Style s = displayPane.addStyle("bold", regular);
StyleConstants.setBold(s,true);
} // End of setTabsAndStyles()
public JTextPane addTextToTextPane()
{ // start of addTextToTextPane()
int numberOfEntries = contactList.size();
int count = 0;
Document doc = displayPane.getDocument();
try
{ // start of tryblock
// clear previous text
doc.remove(0,doc.getLength());
// insert titles of columns
doc.insertString(0,"NAME\tSURNAME\tHOME NO\tWORK NO\tCELL NO\n",displayPane.getStyle("bold"));
for(ContactDetails cd : contactList)
cd = contactList.get(count);
doc.insertString(doc.getLength(),cd.name+"\t"+cd.surname+"\t"+cd.home+"\t"+cd.work+"\t"+cd.cell+"\n",displayPane.getStyle("regular"));
count ++;
} // end of try block
catch(BadLocationException ble)
{ // start of ble exception handler
System.err.println("Could not insert text.");
} // end of ble exception handler
return displayPane;
} // end of addTextToTextPane()
// code to process user clicks
public void actionPerformed(ActionEvent e)
{ // start of actionPerformed()
String arg = e.getActionCommand();
// user clicks create button
if(arg.equals("Create"))
c.createNew(); // method to create a new Contact
addTextToTextPane();
if(arg.equals("Search"))
c.searchExisting(); // method to search for an existing entry
addTextToTextPane();
if(arg.equals("Modify"))
c.modifyExisting(); // method to modify contact
addTextToTextPane();
if(arg.equals("Delete"))
c.deleteExisting();
addTextToTextPane();
if(arg.equals("Exit"))
} // end of actionPerformed()
// method to create a new contact
public static void main(String[] args)
{ // start of main()
// Set look and feel of interface
try
{ // start of try block
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
} // end of try block
catch(Exception e)
{ // start of catch block
JOptionPane.showMessageDialog(null,"There was an error in setting the look and feel of this application","Error",JOptionPane.INFORMATION_MESSAGE);
} // end of catch block
Phonebook1 pb = new Phonebook1();
pb.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
pb.setJMenuBar(pb.createMenuBar());
pb.setContentPane(pb.createContentPane());
pb.setSize(520,500);
pb.setVisible(true);
pb.setResizable(false);
} // end of main()
} //end of class -
I recently bought a second-hand ipod classic. When connecting to itunes the message reads that the ipod is corrupt and needs to be restored to factory settings. However, this does not solve the issue and I get the message saying unable to restore, unknown error 1439. No matter what i have tried through apple support i get the same result. My computer runs Windows XP but I have also tried on my laptop which operates Vista and still no joy. Anyone able to solve this one?
Normally unknown error is due to timeout, cause by
connected to slow USB port at the front of the PC, or using USB Hubs - Better connect to the USB HUb at the back of the PC. (Some Laptop, has only one High Power -USB2.0 port
USB resource low, due to sharing of other USB devices - Disconnect all other USB devices when Restoring.
Winsocks conflict with iTunes - Disconnect Internet and Stop firewall and Antivirus, emails apps.
Your hardisk is dying, read this earlier post by tt2.
https://discussions.apple.com/message/17776595#17776595
This wont solve your problem. but is very helpful in troubleshooting.
It would also help, if you can state
Which version of iTunes are your running?
What is your iPod software version as shown in the iTunes summary page?
Have a nice day! -
on Windows 7, CS6 all products, but especially need help with ID. Fonts that are showing in other applications are not showing in ID.
The ID Program folder will be relevant to your OS...
I took a shot and right clicked on my Scripts Samples, choose reveal in Explorer and opened up the ID Program folder.
As shown, there is a Fonts folder.
Drag/Copy/Paste fonts to this folder. -
Dear all, I have a MacBook Pro bought in April 2011. Last April, it got stuck while the wheel was spinning and I had to force it shut. That cost me my hard drive. Now, it's stuck again. I tried esc, cmd+tab, moving the trackpad on the apple, but no. HELP!
Dear John,
thank you for your prompt reply. After I sent the email, I left the wheel spinning to see if it would eventually stop. It didn't, but after a while the screen turned blue, so I decided to switch everything off with a forced shut-down. I could not restart with the OS DVDs because I am currently away from home, but fortunately everything was more or less fine after restarting. It then got stuck again, I forced it shut again, restarted again, and now it seem to work but I won't overdo it and will switch off smoothly after writing this (unless it gets stuck again). Last April I have replaced the HD, so it's now just under 6 months old. And, of course, since the crash occurred when I was abroad and had backed up just before I left, I have lost only a few days' work. Still, and I know this will make me hugely unpopular here, with my 5 previous laptops running on MS Windows I never had a problem. Which does not mean I loved the OS, or I would not have switched to Mac.
Anyway, and this is the main reason for this message, thank you very much again for your speedy intervention.
Claudia -
My mac doesnt start. All i get is the gray screen with the apple and the loading icon but nothing more happens. I tried to start it in safe mode but it doesnt help. What can i do?
If you have a external USB enclosure - trying installing your hard drive in that enclosure and connect it to your usb port - restart your macbook while holding down the options key. If you Macbook boots to your desktop then you have a faulty cable. If you get the same error, then your hard drive just died on you.
good luck. -
Hello, I synchronized my iPhones with iTunes, having a new laptop, I had to do this step. But instead of helping it, I lost many applications. All my good applications disappeared. How do I get them back? What I have to do? I bought those app!!!
How is this possible? How can the iTunes eat what I bought and what for? To buy the applications again?! Geez!
Tell me the solution. It must exist one!You can redownload you previously purchased apps for free as long as they are still available in the app store. Be sure you are logged into the Apple ID in iTunes used to purchase them, then follow this guide: http://support.apple.com/kb/HT2519.
-
I've downloaded current update for iPad 2 but it won't install. It keeps coming up as an error. I have deleted many apps but didn't help the situation... What's causing this and how do I fix this?
What is the latest iOS for iPad 2? Is it iOS 7 or can you update to 8?
all I remember is that my iPad mini performed poorly under iOS 7. Try to update it to the very latest version. Also you will have to use iOS 8.1.3, because 8.1.2 is no longer signed in case you were trying to install that. You can get the latest IPSW from http://IPSW.me just enter in your device and it will forward you to the right Apple ios download link.
Another thing is keeping your device memory free, if you have a 16 gig device, it's harder to keep space free. my iPad mini is 16 gig, but all I can ever keep free is 1 GB so I keep it at that. Turn off "iCloud photo sharing beta" and that will help a little bit. also when you do a restore from iTunes, don't restore your backup right away, see how it performs fresh, and then add your apps back in one at a time you might have to sacrifice photos and other personal things for performance.
Maybe you are looking for
-
I have a Lenovo usb webcam. I believe all was fine out of the box until I started also using Logitech usb headset. Now not working with or without headset. No idea why headset would matter, but that's the only relevant event I can think of. dmesg
-
Link SRM and back-end in a query
hi experts, i'm doing a query in SRM 4.0 with a back-end ECC 6.0. This query includes some TABLES/VIEWS of SRM and others of ECC 6.0 (MM module). Pay attention: i know how is possible to link the views between them, i need to know how to connect two
-
I get a message in my gmail account starting two weeks ago: "This version of Safari is no longer supported. Please upgrade to asupported browser." My updates are current with Safari 5.1.10, using OS 10.6.8. No system changes have been made near that
-
Hi, I have a simple problem. I wish to move data from a resultset to a string[]. However, I do not know the number of rows in the resultset. I have tried something like this: while (resultset.next()) { while ( (sqlData[rowCount++] = resul
-
SAP XI 3.0 Same source for different target in std Value mapping function
Hi, We have replicated 4 value mapping entries from R3 to XI having the same Context , Agency , Schema and value for source, but each of the 4 values has the same Context and Agency but different Schema and Value respectively. To illusstate : Source