Thursday, June 28, 2012

Symfony2: The above URL assumes that localhost points to the web directory of your new Symfony2 project

Reading the Symfony2 book, in the "Creating Pages in Symfony2" section in the "The "Hello Symfony!" Page" subtitle. I found an advise:

"The tutorial assumes that you've already downloaded Symfony2 and configured your webserver. The above URL assumes that localhost points to the web directory of your new Symfony2 project. For detailed information on this process, see the documentation on the web server you are using. Here's the relevant documentation page for some web server you might be using:


 - For Apache HTTP Server, refer to Apache's DirectoryIndex documentation.
 - For Nginx, refer to Nginx HttpCoreModule location documentation."

The apache issue consist in being able to access to the same page ussing two different urls, one is the default:

http://localhost/Symfony/web/app_dev.php/hello/Symfony

and the other is the page that the tutorial assumes you have already configured. Note that "Symfony/web"  is missing:


http://localhost/app_dev.php/hello/Symfony

Your can get that configuration going to the file : "apache_installation_dir\conf\extra\httpd-vhosts.conf" and setting the following configuration:



NameVirtualHost *:8082
Listen 127.0.0.1:8082


<VirtualHost *:8082>
  ServerName local.myproject
  DocumentRoot "E:/Programs/windows7/xampp-win32-1.7.4-VC6/xampp/htdocs/Symfony/web"
  DirectoryIndex index.php
  <Directory "E:/Programs/windows7/xampp-win32-1.7.4-VC6/xampp/htdocs/Symfony/web">
    AllowOverride All
    Allow from All
  </Directory>


  Alias /sf "E:/Programs/windows7/xampp-win32-1.7.4-VC6/xampp/htdocs/Symfony/lib/vendor/symfony/data/web/sf"
  <Directory "E:/Programs/windows7/xampp-win32-1.7.4-VC6/xampp/htdocs/Symfony/lib/vendor/symfony/data/web/sf">
    AllowOverride All
    Allow from All
  </Directory>
</VirtualHost>

Note: be aware of changing the routes and changing the port. In my case I preferred to use 8082 port so I could access to the url http://localhost:8082/app_dev.php/hello/Symfony

Wednesday, June 27, 2012

GlassFish: Increase Session Timeout


In the web admin console

1. In the accordion panel,  go to "Configurations" > "default-config"/"server-config" > "Web container"
2. in the tabs options, go to "Session Properties"
3. Change the value of the field "Session Timeout"

Reference:
http://itgeekhelp.blogspot.com/2009/03/glassfish-web-container-tuning-settings.html

Glassfish: Exception in thread "main" java.lang.UnsupportedClassVersionError: com/sun/enterprise/admin/cli/AsadminMain (Unsupported major.minor version 49.0


Look through you PATH variable and correct the route for the right the java version. In my case I had a jre1.3 in my path :S, so I changed it to jdk1.6. That worked smoothly :D

References:
http://techtracer.com/2007/10/10/resolving-the-unsupported-majorminor-version-490-error/

Saturday, June 23, 2012

ExtJS4.1: gridPanel Scroll problem

It you have a gridPanel that it's scroll bar is not been shown .Look if you have the layout: 'absolute' config value set and try deleting that config parameter. That worked.for me.


Before:
Ext.define('WebMonitorClass.view.PlanillaActivacionGridPanel', {    
    extend: 'Ext.grid.Panel'
    ,alias: 'widget.planillaActivacionGridPanel'
    ,layout: 'absolute'
    ,frame:true
    ,columnLines: true    
    ,store: Ext.create('Ext.data.ArrayStore', {
        fields: [
           {name: 'column1',     type: 'string'}
           ,{name: 'column2',     type: 'string'}                      
        ],
        data: [['data 11','data12'],
                ['data 21','data22'],
            ]})
        ,x:0
        ,y:0
        ,height: 200
        ,width: 150
        ,columns: [
            {
                text     : 'Column 1',                
                sortable : false,
                width    : 75,
                dataIndex: 'column1'
            },{
                text     : 'Column2',              
                sortable : false,
                width    : 105,
                dataIndex: 'column2'
            }
        ]          
    ,initComponent: function() {                                                    
        this.callParent();        
    }    
    ,items: []
});


After (Scroll Works Perfectly)
Ext.define('WebMonitorClass.view.PlanillaActivacionGridPanel', {    
    extend: 'Ext.grid.Panel'
    ,alias: 'widget.planillaActivacionGridPanel'
    //,layout: 'absolute' // with layout:absolute the scroll doesn't work           
    ,frame:true
    ,columnLines: true    
    ,store: Ext.create('Ext.data.ArrayStore', {
        fields: [
           {name: 'column1',     type: 'string'}
           ,{name: 'column2',     type: 'string'}                      
        ],
        data: [['data 11','data12'],
                ['data 21','data22'],
            ]})
        ,x:0
        ,y:0
        ,height: 200
        ,width: 150
        ,columns: [
            {
                text     : 'Column 1',                
                sortable : false,
                width    : 75,
                dataIndex: 'column1'
            },{
                text     : 'Column2',              
                sortable : false,
                width    : 105,
                dataIndex: 'column2'
            }
        ]          
    ,initComponent: function() {                                                    
        this.callParent();        
    }    
    ,items: []
});


Reference:
http://docs.sencha.com/ext-js/4-1/#!/example/grid/grid-plugins.html

Thursday, June 21, 2012

EXTJS4: not-editable textfield

Add readOnly boolean config parameter:

,readOnly:true


for example:

                     {
                            xtype:'textfield'                                                        
                            ,x:830
                            ,value:"MyDefaultvalue"
                            ,readOnly:true
                            ,y:40
                            ,width:220                           
                        }


Reference:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.form.field.Text-cfg-readOnly

Tuesday, June 12, 2012

Apache: Faulting application httpd.exe, version 2.2.4, faulting module OraOCIEI11.dll, version 0.0.0.0

If your apache server suddenly restarts and your windows event viewer gets an error like this:

Faulting application httpd.exe, version 2.2.4, faulting module OraOCIEI11.dll, version 0.0.0.0


Try updating your Oracle Instant Client version.

Ie. In the server I had Version 11.1.0.6.0 and I delete that one and I installed version Version 11.2.0.2.0


That solved the problem :D

Resources:
https://forums.oracle.com/forums/thread.jspa?threadID=2327291