Hi,
Today i was installing XAMPP on windows 7 desktop. Well, the installation gone perfectly well. Finally, i was able to access XAMPP control panel, but, the moment i started apache 2.2, it failed. Then i installed it as a service and then started, but it was still in vain.
Later on, i changed C:\xampp\apache\conf\httpd.conf file contents as below
Listen 80
to
Listen 81
and then restarted the service, finally it worked.
The reason why i changed the port is because i later on found that skype also listens to the same port which was a default port for Apache 2.2
Thursday, June 24, 2010
Tuesday, June 22, 2010
Generating Serial Numbers from Database
Hi,
Recently, in one of my e-commerce applications, there was a need for generating a unique serial number. I tried for all possibilities from java code but some one suggested to do this from backend. I tried for below mentioned way and it worked finally.
CREATE TYPE ARRAY AS TABLE OF VARCHAR2(10)
/
CREATE FUNCTION MY_NUMBERS(N IN NUMBER DEFAULT NULL)
RETURN ARRAY
PIPELINED
AS
BEGIN
FOR j IN 1 .. NVL(N,10)
LOOP
PIPE ROW('ACUPRO'||lpad(j,5,0));
END LOOP;
RETURN;
END;
/
select * from TABLE(MY_NUMBERS(3));
COLUMN_VAL
----------
ACUPRO00001
ACUPRO00002
ACUPRO00003
Regards,
Ujjwal Soni
Recently, in one of my e-commerce applications, there was a need for generating a unique serial number. I tried for all possibilities from java code but some one suggested to do this from backend. I tried for below mentioned way and it worked finally.
CREATE TYPE ARRAY AS TABLE OF VARCHAR2(10)
/
CREATE FUNCTION MY_NUMBERS(N IN NUMBER DEFAULT NULL)
RETURN ARRAY
PIPELINED
AS
BEGIN
FOR j IN 1 .. NVL(N,10)
LOOP
PIPE ROW('ACUPRO'||lpad(j,5,0));
END LOOP;
RETURN;
END;
/
select * from TABLE(MY_NUMBERS(3));
COLUMN_VAL
----------
ACUPRO00001
ACUPRO00002
ACUPRO00003
Regards,
Ujjwal Soni
Friday, June 11, 2010
Porting Java
Love it or hate it, one of the great things about Java is its portability. It abstracts out many of the platform-specific things so that you, the programmer, need not worry about things like file systems and how to create directories and the like. Not a big deal, he thought, that's what Java was built for ...
public static MultipartRequest createMultipartRequest (HttpServletRequest req) throws IOException { [SNIP] // Create a temp directory for the attachments Runtime.getRuntime().exec ("mkdir -p " + Constants.UPLOAD_PATH); File check = new File (Constants.UPLOAD_PATH); [SNIP] }
Thursday, June 10, 2010
Update on Alfresco Installation on Windows 7
Hello Everyone,
I finally managed to run Alfresco on my Windows 7 desktop.
I edited some lines in alfresco-global.properties located under C:\Alfresco\tomcat\shared\classes. This is a global file used for configuration of email/database etc for Alfresco Server.
I was using mysql database for Alfresco, so my DB hostname entry in this file was
db.name=alfresco
db.username=alfresco
db.password=alfresco
db.host=localhost
db.port=3306
i changed it to
db.name=alfresco
db.username=alfresco
db.password=alfresco
db.host=127.0.0.1
db.port=3306
and my server got up and running.
Cheers!!!
Ujjwal Soni
I finally managed to run Alfresco on my Windows 7 desktop.
I edited some lines in alfresco-global.properties located under C:\Alfresco\tomcat\shared\classes. This is a global file used for configuration of email/database etc for Alfresco Server.
I was using mysql database for Alfresco, so my DB hostname entry in this file was
db.name=alfresco
db.username=alfresco
db.password=alfresco
db.host=localhost
db.port=3306
i changed it to
db.name=alfresco
db.username=alfresco
db.password=alfresco
db.host=127.0.0.1
db.port=3306
and my server got up and running.
Cheers!!!
Ujjwal Soni
Installing Alfresco on Windows 7
Hi All,
I am installing Alfresco-Community-3.3-Full version on my windows-7 desktop. After successful installation, when i am trying to run Alfresco Server. I get below error. I tried for many sources, but still i am not able to find any solution. I am still working for a solution to this problem. Hopefully, will post a solution to this problem soon.
INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener" is already configured for this context. The duplicate definition has been ignored.
16:10:56,353 INFO [alfresco.config.JndiPropertiesFactoryBean] Loading properties file from class path resource [alfresco/repository.properties]
16:10:56,383 INFO [alfresco.config.JndiPropertiesFactoryBean] Loading properties file from class path resource [alfresco/domain/transaction.properties]
16:10:56,414 INFO [alfresco.config.JndiPropertiesFactoryBean] Loading properties file from URL [file:/C:/Alfresco/tomcat/shared/classes/alfresco-global.properties]
16:10:56,588 INFO [alfresco.config.JndiPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/alfresco-shared.properties]
16:11:07,845 WARN [hibernate.cfg.SettingsFactory] Could not obtain connection metadata
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure
Last packet sent to the server was 0 ms ago.)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2073)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1298)
16:11:35,351 INFO [extensions.webscripts.TemplateProcessorRegistry] Registered template processor freemarker for extension ftl
I am installing Alfresco-Community-3.3-Full version on my windows-7 desktop. After successful installation, when i am trying to run Alfresco Server. I get below error. I tried for many sources, but still i am not able to find any solution. I am still working for a solution to this problem. Hopefully, will post a solution to this problem soon.
INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener" is already configured for this context. The duplicate definition has been ignored.
16:10:56,353 INFO [alfresco.config.JndiPropertiesFactoryBean] Loading properties file from class path resource [alfresco/repository.properties]
16:10:56,383 INFO [alfresco.config.JndiPropertiesFactoryBean] Loading properties file from class path resource [alfresco/domain/transaction.properties]
16:10:56,414 INFO [alfresco.config.JndiPropertiesFactoryBean] Loading properties file from URL [file:/C:/Alfresco/tomcat/shared/classes/alfresco-global.properties]
16:10:56,588 INFO [alfresco.config.JndiPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/alfresco-shared.properties]
16:11:07,845 WARN [hibernate.cfg.SettingsFactory] Could not obtain connection metadata
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure
Last packet sent to the server was 0 ms ago.)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2073)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1298)
16:11:35,351 INFO [extensions.webscripts.TemplateProcessorRegistry] Registered template processor freemarker for extension ftl
Thursday, June 3, 2010
Reason why i love using firefox brower
Hello Everyone,
Here is another reason why do I love using firefox. Some of you guys may already know it. For those who don't know, here it is.
Open firefox browser. In the URL bar, type following
javadoc
and press enter. You will directly go to javadoc page for that class. e.g. javadoc HashMap will take you directly to online HashMap javadoc API. I was quite surprised and pleased to see this. Normally firefox takes you to the relative sites if you type something in the URL address bar. e.g. typing citibank and entering will take you to citibank homepage. But this little trick is good for java developers.
Here is another reason why do I love using firefox. Some of you guys may already know it. For those who don't know, here it is.
Open firefox browser. In the URL bar, type following
javadoc
and press enter. You will directly go to javadoc page for that class. e.g. javadoc HashMap will take you directly to online HashMap javadoc API. I was quite surprised and pleased to see this. Normally firefox takes you to the relative sites if you type something in the URL address bar. e.g. typing citibank and entering will take you to citibank homepage. But this little trick is good for java developers.
Regards,
Ujjwal Soni
Subscribe to:
Posts (Atom)