Showing posts with label virtualbox. Show all posts
Showing posts with label virtualbox. Show all posts

Saturday, June 16, 2012

Install Safari on Ubuntu

Ubuntu users lack the number of options available as compared to the PC or Mac users. Main browsers they can use are Firefox, Chromium, Google Chrome & Opera.

In this post I will be writing a tutorial on how you can install Safari on Ubuntu.So, without any further ado we will start.

  • Install Wine


Wine is a known Windows emulator for Linux. It is used to run Windows programs on Linux. We will be installing Wine first in order to install Safari on Linux. To install wine you need to open up the Ubuntu Software center and search for Wine. Or, you can simply go to this website and follow the instructions.The install will take a while. Or, you can install it via the Terminalusing the following apt syntax.
sudo apt-get install wine

After installing Wine you need to install core fonts and the flash (windows version) using winetricks. To do this input the following in the terminal.
winetricks corefonts flash


  • Install 7zip


Installing 7zip is our next step as this will be needed to run Play on Linux. Ignoring this will give you an error related to 7zip.
sudo apt-get install p7zip-full


  • Install Play On Linux


Play on Linux will help us create an environment to run Safari easily. To install Play on Linux you need to download it from this website. Choose the Ubuntu version as we are doing this for Ubuntu.

After installing Play on Linux, open it. A new window will open up which will look like the screenshot below.




play on linux

 

Now click Install. Click Internet and then click Safari. Click Install.

play on linux

Now the package will download some required packages and start installing Safari on Ubuntu. Keep following the wizard and you will have Safari installed on Ubuntu.

play on linux

So, we have successfully installed Safari on Ubuntu.

Safari browser

But lets keep in mind that if you want to experience the real internet browsing experience use the browsers that are built to run on Linux by default and not the browsers that run with Wine.

Friday, June 15, 2012

J2EE Tutorial-17(Common Problems and Their Solutions)

Cannot Start the J2EE Server


Naming and Directory Service Port Conflict


Symptom: When you start the J2EE server with the -verbose option, it displays these lines:

J2EE server listen port: 1050 RuntimeException: Could not initialize server... 


Solution: Another process is using port 1050. If the J2EE server is already running, you can stop it by typing j2ee -stop. If some other program is using the port, then you can change the default port number (1050) by editing the config/orb.properties file of your J2EE SDK installation.

For more information about default port numbers, see the Configuration Guide in the download bundle of the J2EE SDK.

Web Service Port Conflict


Symptom: When you start the J2EE server with the -verbose option, it displays these lines:

LifecycleException: HttpConnector[8000].open:
java.net.BindException: Address in use...


Solution: Another process is using port 8000. You can change the default port number (8000) by editing the config/web.properties file of your J2EE SDK installation.

Incorrect XML Parser


Symptom: When you start the J2EE server with the -verbose option, it displays these lines:

Exception in thread "main"
javax.xml.parsers.FactoryConfigurationError:
org.apache.xerces.jaxp.SAXParserFactoryImpl at ...


Solution: Remove the jre/lib/jaxp.properties file from your J2SE installation.

Compilation Errors


ant Cannot Locate the Build File


Symptom: When you type ant converter, these messages appear:

Buildfile: build.xml does not exist!
Build failed.


Solution: Before running ant, go to the j2eetutorial/examples/src directory. If you want to run ant from your current directory, you must specify the build file on the command line. For example, on Windows you would type this command on a single line:

ant -buildfile C:\j2eetutorial\examples\src\build.xml
converter


The Compiler Cannot Resolve Symbols


Symptom: When you type ant converter, the compiler reports many errors, including these:

cannot resolve symbol
...
BUILD FAILED
...
Compile failed, messages should have been provided


Solution: Make sure that you've set the J2EE_HOME environment variable correctly. See Checking the Environment Variables.

ant 1.4 Will Not Compile the Example after You Run the Client


Symptom: ant 1.4 displays this error:

The filename, directory name, or volume label syntax is 
incorrect.


Solution: Use version 1.3 of ant. The 1.4 version of the ant.bat script and the scripts of the J2EE SDK all use the JAVACMD environment variable. The SDK's runclient.bat script, for example, sets JAVACMD to a value that causes problems for ant.bat.

Deployment Errors


The Incorrect XML Parser Is in Your Classpath


Symptom: The error displayed has the following text:

...
[]java.rmi.RemoteException:Error saving/opening

Deployment Error:Bad mapping of key{0}  class{1},
not found: com.sum.enterprise.deployment.xml.ApplicationNode


Solution: Remove the jaxp.jar file from the jre/lib/ext directory of your J2SE installation. This JAR file contains XML parsing routines that are incompatible with the J2EE server. If you do not have a jaxp.jarfile, then perhaps your classpath refers to the XML routines of a Tomcat installation. In this case, you should remove that reference from your classpath.

The Remote Home Interface Was Specified as a Local Home Interface


Symptom: An error such as the following is displayed:

LocalHomeImpl must be declared abstract. 
It does not define javax.ejb.HomeHandle getHomeHandle()
from interface javax.ejb.EJBHome.


Solution: Remove the enterprise bean from the EAR file (EditDelete) and create a new bean with the New Enterprise Bean wizard. In the General dialog box of the wizard, select values from the Remote Home Interface and Remote Interface combo boxes.

J2EE Application Client Runtime Errors


The Client Throws a NoClassDefFoundError


Symptom: The client reports this exception:

java.lang.NoClassDefFoundError:converter.ConverterHome


Solution: This error occurs if the client cannot find the classes in the ConverterAppClient.jar file. Make sure that you've correctly followed the steps outlined in Running the J2EE Application Client.

The Client Cannot Find ConverterApp.ear


Symptom: The client reports this exception:

IOException: ConverterApp.ear does not exist


Solution: Ensure that the ConverterApp.ear file exists and that you've specified it with the -client option:

runclient -client ConverterApp.ear -name ConverterClient


You created the ConverterApp.ear file in the section Creating the J2EE Application. See also the section Running the J2EE Application Client.

The Client Cannot Find the ConverterClient Component


Symptom: The client displays this line:

No application client descriptors defined for: ...


Solution: Verify that you've created the ConverterClient component and that you've specified it for the -name option of the runclient command. You created the ConverterClient component in the sectionPackaging the J2EE Application Client.

The Login Failed


Symptom: After you log in, the client displays this line:

Incorrect login and/or password


Solution: At the login prompts, enter guest as the user name and guest123 as the password.

The J2EE Application Has Not Been Deployed


Symptom: The client reports the following exception:

NameNotFoundException. Root exception is org.omg.CosNaming...


Solution: Deploy the application. For instructions, see Deploying the J2EE Application.

The JNDI Name Is Incorrect


Symptom: The client reports the following exception:

NameNotFoundException. Root exception is org.omg.CosNaming...


Solution: In the JNDI Names tabbed pane of the ConverterApp, make sure that the JNDI names for the ConverterBean and the ejb/SimpleConverter match. Edit the appropriate JNDI Name field and then redeploy the application.

Web Client Runtime Errors


The Web Context in the URL Is Incorrect


Symptom: The browser reports that the page cannot be found (HTTP 404).

Solution: Verify that the Web context (converter) in the URL matches the one you specified in the Component General Properties dialog box (see the section Packaging the Web Client). The case (upper or lower) of the Web context is significant.

The J2EE Application Has Not Been Deployed


Symptom: The browser reports that the page cannot be found (HTTP 404).

Solution: Deploy the application.

The JNDI Name Is Incorrect


Symptom: When you click Submit on the Web page, the browser reports

A Servlet Exception Has Occurred.


Solution: In the JNDI Names tabbed pane of the ConverterApp, make sure that the JNDI names for the ConverterBean and the ConverterWAR match. Edit the appropriate JNDI Name field and then redeploy the application.

Detecting Problems With the Verifier Tool


The verifier tool (verifier) can detect inconsistencies in deployment descriptors and method signatures. These inconsistencies often cause deployment or runtime errors. From deploytool, you can run the GUI version of verifier by selecting ToolsVerifier. You can also run a stand-alone GUI or command-line version of verifier. For more information, see Appendix B.

Comparing Your EAR Files with Ours


For most of the examples, the download bundle of the tutorial includes J2EE application EAR files, which are located in the j2eetutorial/examples/ears directory.

When All Else Fails


If none of these suggestions fixes the problem, you can uninstall the application and clean out the server's repository by running the cleanup script. You'll also need to shut down and restart the server:

j2ee -stop
cleanup
j2ee -verbose

J2EE Tutorial-16(Modifying the J2EE Application)

Since the J2EE SDK is intended for experimentation, it supports iterative development. Whenever you make a change to a J2EE application, you must redeploy the application.

Modifying a Class File


To modify a class file in an enterprise bean, you change the source code, recompile it, and redeploy the application. For example, if you want to change the exchange rate in the dollarToYen business method of theConverterBean class, you would follow these steps.

  1. Edit ConverterBean.java.

  2. Recompile ConverterBean.java by typing ant converter.

  3. In deploytool, select ToolsUpdate Files.

  4. The Update Files dialog box appears. If the modified files are listed at the top of the dialog, click OK and go to step 6. If the files are listed at the bottom, they have not been found. Select one of those files and click Edit Search Paths.

  5. In the Edit Search Paths dialog, specify the directories where the Update Files dialog will search for modified files.

    1. In the Search Root field, enter the fully-qualified name of the directory from which the search will start.

    2. In the Path Directory list, add a row for each directory that you want searched. Unless fully-qualified, these directory names are relative to the Search Root field.

    3. Click OK.



  6. Select ToolsDeploy. Make sure the checkbox labeled Save Object Before Deploying is checked. If you do not want to deploy at this time, select ToolsSave to save the search paths specified in step 5.


As a shortcut, you can select ToolsUpdate And Redeploy. With this shortcut, the Update Files dialog box does not appear unless the files are not found.

To modify the contents of a WAR file you follow the preceding steps. The Update Files operation checks to see if any files have changed, including HTML files and JSP pages. If you change the index.jsp file ofConverterApp, be sure to type ant converter. The converter task copies the index.jsp file from the src to the build directory.

Adding a File


To add a file to the EJB JAR or WAR of the application, perform these steps.

  1. In deploytool, select the JAR or WAR in the tree.

  2. Select the General tab.

  3. Click Edit.

  4. In the tree of the Available Files field, locate the file and click Add.

  5. Click OK.

  6. From the main toolbar, select ToolsUpdate And Redeploy.


Modifying a Deployment Setting


To modify a deployment setting of ConverterApp, you edit the appropriate field in a tabbed pane and redeploy the application. For example, to change the JNDI name of the ConverterBean from ATypo toMyConverter, you would follow these steps.

  1. In deploytool, select ConverterApp in the tree.

  2. Select the JNDI Names tab.

  3. In the JNDI Name field, enter MyConverter.

  4. From the main toolbar, select FileSave.

  5. Select ToolsUpdate And Redeploy.

J2EE Tutorial-14(Running the J2EE Application Client)

To run the J2EE application client, perform the following steps.

  1. In a terminal window, go to the j2eetutorial/examples/src/ejb/converter directory.

  2. Verify that this directory contains the ConverterApp.ear and ConverterAppClient.jar files.

  3. Set the APPCPATH environment variable to ConverterAppClient.jar.

  4. Type the following command (on a single line):

       runclient -client ConverterApp.ear -name ConverterClient 
    -textauth



  5. The client container prompts you to log in. Enter guest for the user name and guest123 for the password.

  6. In the terminal window, the client displays these lines:

       Binding name:'java:comp/env/ejb/SimpleConverter'
    12160.00
    0.77
    Unbinding name:'java:comp/env/ejb/SimpleConverter'



J2EE Tutorial-13(Deploying the J2EE Application)

Now that the J2EE application contains the components, it is ready for deployment.

  1. Select the ConverterApp application.

  2. Select ToolsDeploy.

  3. In the Introduction dialog box, confirm that ConverterApp is shown for the Object To Deploy and that localhost is shown for the Target Server.

  4. Select the checkbox labeled Return Client Jar.

  5. In the text field that appears, enter the full path name for the file ConverterAppClient.jar so that it will reside in the j2eetutorial/examples/src/ejb/converter subdirectory. TheConverterAppClient.jar file contains the stub classes that enable remote access to ConverterEJB.

  6. Click Next.

  7. In the JNDI Names dialog box, verify the names you entered in the previous section.

  8. Click Next.

  9. In the WAR Context Root dialog box, enter converter in the Context Root field. When you run the Web client, the converter context root will be part of the URL.

  10. Click Next.

  11. In the Review dialog box, click Finish.

  12. In the Deployment Progress dialog box, click OK when the deployment completes.

J2EE Tutorial-11(Creating the Web Client)

The Web client is contained in the JSP page j2eetutorial/examples/src/ejb/converter/index.jsp. A JSP page is a text-based document that contains static template data, which can be expressed in any text-based format such as HTML, WML, and XML; and JSP elements, which construct dynamic content.

Coding the Web Client


The statements (in bold in the following code) for locating the home interface, creating an enterprise bean instance, and invoking a business method are nearly identical to those of the J2EE application client. The parameter of the lookup method is the only difference; the motivation for using a different name is discussed in Specifying the JNDI Names.

The classes needed by the client are declared with a JSP page directive (enclosed within the <%@ %> characters). Because locating the home interface and creating the enterprise bean are performed only once, this code appears in a JSP declaration (enclosed within the <%! %> characters) that contains the initialization method, jspInit, of the JSP page. The declaration is followed by standard HTML markup for creating a form with an input field. A scriptlet (enclosed within the <% %> characters) retrieves a parameter from the request and converts it to a BigDecimal object. Finally, JSP expressions (enclosed within <%= %> characters) invoke the enterprise bean's business methods and insert the result into the stream of data returned to the client.

<%@ page import="Converter,ConverterHome,javax.ejb.*,
javax.naming.*, javax.rmi.PortableRemoteObject,
java.rmi.RemoteException" %>
<%!
private Converter converter = null;
public void jspInit() {
try {
InitialContext ic = new InitialContext(); Object objRef = ic.lookup(" java:comp/env/ejb/TheConverter"); ConverterHome home = (ConverterHome)PortableRemoteObject.narrow( objRef, ConverterHome.class); converter = home.create(); } catch (RemoteException ex) {
...
}
}
...
%>
<html>
<head>
<title>Converter</title>
</head>

<body bgcolor="white">
<h1><center>Converter</center></h1>
<hr>
<p>Enter an amount to convert:</p>
<form method="get">
<input type="text" name="amount" size="25">
<br>
<p>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
<%
String amount = request.getParameter("amount");
if ( amount != null && amount.length() > 0 ) {
BigDecimal d = new BigDecimal (amount);
%>
<p><%= amount %> dollars are
<%= converter.dollarToYen(d) %> Yen.
<p><%= amount %> Yen are
<%= converter.yenToEuro(d) %> Euro.
<%
}
%>
</body>
</html>


Compiling the Web Client


The J2EE server automatically compiles Web clients that are JSP pages. If the Web client were a servlet, you would have to compile it.

Packaging the Web Client


To package a Web client, you run the New Web Component wizard of the deploytool utility. During this process the wizard performs the following tasks.

  • Creates the Web application deployment descriptor

  • Adds the component files to a WAR file

  • Adds the WAR file to the application's ConverterApp.ear file


After the packaging process, you can view the deployment descriptor by selecting ToolsDescriptor Viewer.

To start the New Web Component wizard, select FileNewWeb Component. The wizard displays the following dialog boxes.

  1. Introduction dialog box

    1. Read the explanatory text for an overview of the wizard's features.

    2. Click Next.



  2. WAR File dialog box

    1. Select Create New WAR File In Application.

    2. In the combo box, select ConverterApp.

    3. In the WAR Display Name field, enter ConverterWAR.

    4. Click Edit.

    5. In the tree under Available Files, locate the j2eetutorial/examples/build/ejb/converter directory.

    6. Select index.jsp and click Add.

    7. Click OK.

    8. Click Next.



  3. Choose Component Type dialog box

    1. Select the JSP radio button.

    2. Click Next.



  4. Component General Properties dialog box

    1. In the JSP Filename combo box, select index.jsp.

    2. Click Finish.




Specifying the Web Client's Enterprise Bean Reference


When it invokes the lookup method, the Web client refers to the home of an enterprise bean:

Object objRef = ic.lookup("java:comp/env/ejb/TheConverter");


You specify this reference as follows:

  1. In the tree, select ConverterWAR.

  2. Select the EJB Refs tab.

  3. Click Add.

  4. In the Coded Name column, enter ejb/TheConverter.

  5. In the Type column, select Session.

  6. In the Interfaces column, select Remote.

  7. In the Home Interface column, enter ConverterHome.

  8. In the Local/Remote Interface column, enter Converter.

Monday, June 11, 2012

11 Free Linux Apps Your Business Needs Now

The good news is that there are free and open-source alternatives for virtually every package a small business might need, and most of them are excellent. Whether or not you've already made the switch to Linux -- there are, after all, myriad security and other reasons for doing so -- these free apps can be just what any small business needs to succeed.

1. Office Productivity: OpenOffice

OpenOffice.org 3 (also known as OO.o) is a fantastic open-source alternative to Microsoft Office. With components for word processing, spreadsheets, presentations, graphics, databases and more, it is available in many languages and works on all common operating systems, including Linux, Mac and Windows. All data gets stored in an international open standard format, and the software can read and write files from Office as well. Perhaps best of all, the interface is so familiar and intuitive that you might not even realize you're using anything new. You can download and use OpenOffice free of charge.

2. Accounting: GnuCash

GnuCash is a personal and small-business financial-accounting software package that's also available for Linux, Mac OS X, and Windows. Both powerful and flexible, GnuCash lets you track bank accounts, stocks, income and expenses. As quick and intuitive to use as a checkbook register, it is based on professional accounting principles to ensure balanced books and accurate reports. Among GnuCash's key features are double-entry accounting, small-business accounting, invoicing and more. Data can be imported from programs such as Microsoft Money and Quicken, while it can be exported to spreadsheets such as Microsoft Excel. Once again, thisfree software's interface is so intuitive and familiar that if you've used other accounting programs before, this one will be no problem.

3. Desktop publishing: Scribus

Scribus is a free program that offers professional page-layout capabilities for Linux, Mac OSX and Windows desktops. Scribus supports professional publishing features including CMYK color separations for both press-ready output and PDF creation. I've found the software can do just about anything the paid packages can, and it's comparable to InDesign or Publisher, for instance.

4. E-mail: Zimbra

Zimbra Desktop is free e-mail and calendar software that runs on any Linux, Mac or Windows computer. The tool offers e-mail, contacts, calendar and document capabilities all in one application, and it lets users read e-mail from any POP or IMAP e-mail account, including Gmail, Hotmail or business e-mail. Owned by VMware, Zimbra works both online and off, and there's no limit to the size of your e-mail storage. As an added bonus, it's also available in 20 languages.

5. Web page editing: KompoZer

Much like Microsoft's old FrontPage, KompoZer is a tool for anyone who ever works with a Web page. Downloadable for free and compatible with Linux as well as the usual other alternatives,KompoZer is a WYSIWYG (What You See Is What You Get) editor, meaning that you can edit Web pages visually as well as by working with the raw HTML code. The free software is extremely easy to use, making it ideal for nontechnical computer users who want to create an attractive, professional-looking Web site without necessarily needing to know HTML.

6. Graphics: GIMP

GIMP, which stands for "GNU Image Manipulation Program," is a free and open source alternative to Adobe's pricey PhotoShop product. With an interface very similar to PhotoShop's,GIMP offers capabilities including photo retouching, image composition and image authoring. I believe GIMP will satisfy all but the highest-end professional graphic designers. It's perfect for making Web graphics, retouching product photos and creating marketing materials, and any images created can be saved in an array of common formats, including PSD Photoshop.

7. Backup: Amanda

Amanda is a backup and recovery solution that lets you set up a single master backup server to back up multiple hosts to a single large-capacity tape or disk drive. The software can back up a large number of workstations running multiple versions of Linux, Mac OS or Windows. Currently, it's used to protect more than half a million servers and desktops around the world. A sister service to Amanda, meanwhile, is Zmanda, which provides paid backup in the cloud.

8. HR management: OrangeHRM

OrangeHRM is a free package for human resources management. With modules for personnel information management, benefits, recruitment, employee self-service, leave, and time and attendance‚ the software also offers optional paid services including training, support and customization.

9. E-mail campaigns: phpList

If your business runs e-mail campaigns, phpList can be a great tool. The software is free to download, install and use, and it's easy to integrate with any Website. Ideal for newsletters, publicity lists, notifications and many other uses, phpList is designed to manage mailing lists with up to hundreds of thousands of subscribers. A Web interface lets you write and send messages and manage phpList over the internet.

10. Project management: OpenProj

OpenProj is a free project-management package that substitutes nicely for Microsoft Project but works with Linux and Mac as well as Windows. With more than a million users, OpenProj's installed base is second only to that of Microsoft Project itself--which, of course, costs a heck of a lot more. Gantt charts, PERT charts and all the other capabilities offered by Microsoft's software are in OpenProj as well, and existing Project files can be easily imported.

11. Antivirus: ClamAV

Even if you're running Linux, it's still a good idea to use some kind of antivirus software. Originally designed for Unix, ClamAV is a nice package that's now available for Linux as well as for Windows and a number of other platforms. The tool offers built-in support for almost all mail file formats as well as popular document formats including Microsoft Office, HTML, RTF and PDF. With a virus database that's updated multiple times per day, ClamAV is, of course, also free.

MAMP


MAMP installs a local server environment in a matter of seconds on your Mac OS X computer, be it PowerBook or iMac. MAMP will not compromise any existing Apache installation already running with your OS X. You can install Apache, PHP and MySQL without starting a script or having to change any configuration files.

Screenshot

CyberDuck


Cyberduck is an open source FTP, SFTP-client and also a WebDAV, Mosso Cloud Files and Amazon S3 browser for the Mac. It features an easy to use interface with quickly accessible bookmarks. The outline view of the browser allows to browse large folder structures efficiently and you can quickly preview files with Quick Look. To edit files, a seamless integration with several external editors makes it easy to change content quickly. An alternative: Filezilla.

Screenshot