21 November 2011

Elegir: Elige vs Elije

Es uno de los verbos más usado en el comercio a diferentes niveles, tal como, ferias libres, malls, marketing televisivo, Internet, papel (periódicos, carteles y otros).

Elije: incorrecto

A la vez uno de los verbos mas erradamente escritos, sucede muy frecuente que usen J (jota) en vez de G para decir, elegido, elegir... no sé cual es el motivo de confusión, donde la regla es sólo si usan a/o entonces hay que usar J

En la RAE sale la conjugación correcta:


En Transgrediendo a Cervantes hay varias fotos al respecto.

PD: Proteger es otro verbo que también se usa mal a menudo.

08 November 2011

WL_LLR_ADMINSERVER

WebLogic Server 10.x has non-XA datasource that emulates Global Transactions; when using non-XA with Global Transactions and Logging Last Resource enable the following error may happen at admin console:

* An error occurred during activation of changes, please see the log for details.

* weblogic.application.ModuleException:

* JDBC LLR, table verify failed for table 'WL_LLR_ADMINSERVER', row 'JDBC LLR Domain//Server' record had unexpected value 'base_domain//AdminServer' expected 'domain_sample//AdminServer'*** ONLY the original domain and server that creates an LLR table may access it ***

or

in the WLS stdout:

<08-11-2011 10:50:57 AM CLST> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 1 task for the application 'DS1'.>
weblogic.application.ModuleException:
        at weblogic.jdbc.module.JDBCModule.activate(JDBCModule.java:349)
        at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:107)
        at weblogic.application.internal.flow.DeploymentCallbackFlow$2.next(DeploymentCallbackFlow.java:411)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
        at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:74)
        at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:66)
        at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
        at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
        at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:16)
        at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:162)
        at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:820)
        at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1227)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:403)
        at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.commit(DeploymentReceiverCallbackDeliverer.java:63)
        at weblogic.deploy.service.internal.statemachines.targetserver.AwaitingCommit.callDeploymentReceivers(AwaitingCommit.java:235)
        at weblogic.deploy.service.internal.statemachines.targetserver.AwaitingCommit.handleCommit(AwaitingCommit.java:131)
        at weblogic.deploy.service.internal.statemachines.targetserver.AwaitingCommit.receivedCommit(AwaitingCommit.java:44)
        at weblogic.deploy.service.internal.transport.CommonMessageReceiver.receiveRequestCommitMsg(CommonMessageReceiver.java:470)
        at weblogic.deploy.service.internal.transport.CommonMessageReceiver$3.run(CommonMessageReceiver.java:742)
        at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: java.sql.SQLException: JDBC LLR, table verify failed for table 'WL_LLR_ADMINSERVER', row 'JDBC LLR Domain//Server' record had unexpected value 'base_domain//AdminServer' expected 'domain_sample//AdminServer'*** ONLY the original domain and server that creates an LLR table may access it ***
        at weblogic.jdbc.wrapper.JTSLoggableResourceTable.newVerifyException(JTSLoggableResourceTable.java:221)
        at weblogic.jdbc.wrapper.JTSLoggableResourceTable.findOrCreateTable(JTSLoggableResourceTable.java:303)
        at weblogic.jdbc.wrapper.JTSLoggableResourceImpl.findOrCreateBackingTable(JTSLoggableResourceImpl.java:528)
        at weblogic.jdbc.wrapper.JTSLoggableResourceImpl.recoverXARecords(JTSLoggableResourceImpl.java:241)
        at weblogic.transaction.internal.ServerTransactionManagerImpl.registerLoggingResourceTransactions(ServerTransactionManagerImpl.java:751)
        at weblogic.jdbc.common.internal.RmiDataSource.recoverLoggingResourceTransactions(RmiDataSource.java:277)
        at weblogic.jdbc.common.internal.DataSourceManager.createAndStartDataSource(DataSourceManager.java:148)
        at weblogic.jdbc.common.internal.DataSourceManager.createAndStartDataSource(DataSourceManager.java:97)
        at weblogic.jdbc.module.JDBCModule.activate(JDBCModule.java:346)
        ... 29 more

This is for the verbatim message:

Caused by: java.sql.SQLException: JDBC LLR, table verify failed for table 'WL_LLR_ADMINSERVER', row 'JDBC LLR Domain//Server' record had unexpected value 'base_domain//AdminServer' expected 'domain_sample//AdminServer'*** ONLY the original domain and server that creates an LLR table may access it ***

Therefore one way to solve this is to update the WL_LLR_ADMINSERVER table pointing to to the correct target domain name and server that has this LLR DataSource.
where the String 'domain_sample//AdminServer' is the tuple to be modifed.

Excute the following SQL script for updating:

update SCHEMA_SAMPLE.WL_LLR_ADMINSERVER set RECORDSTR = 'domain_sample//AdminServer' where  XIDSTR  = 'JDBC LLR Domain//Server'; 

02 November 2011

Eclipse Plug-ins (update)

After several years, many plug-ins have been made and are more stable than ever.

From my last post about it, the following list is the one I am currently using:
(most of these URIs are the repository location for installing new software at Eclipse)
More plug-ins can be found at:  http://marketplace.eclipse.org/

28 October 2011

org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken

In Oracle Weblogic Server - Version: 9.2 to 10.3.6 when shutting down managed server(s) the following error may occurs:

CharScanner; panic: ClassNotFoundException: org.hibernate.hql.ast.HqlToken

or when trying to run an application using HQL with antlr as parser, the following stacktrace may appear:

org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [ from org.example.hibernate.Customer]
at org.hibernate.hql.ast.HqlLexer.panic(HqlLexer.java:57)
at antlr.CharScanner.setTokenObjectClass(CharScanner.java:340)
at org.hibernate.hql.ast.HqlLexer.setTokenObjectClass(HqlLexer.java:31)
at antlr.CharScanner.(CharScanner.java:51)
at antlr.CharScanner.(CharScanner.java:60)
at org.hibernate.hql.antlr.HqlBaseLexer.(HqlBaseLexer.java:56)
at org.hibernate.hql.antlr.HqlBaseLexer.(HqlBaseLexer.java:53)
at org.hibernate.hql.antlr.HqlBaseLexer.(HqlBaseLexer.java:50)
at org.hibernate.hql.ast.HqlLexer.(HqlLexer.java:26)
at org.hibernate.hql.ast.HqlParser.getInstance(HqlParser.java:44)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:242)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:112)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:57)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1627)
at org.example.hibernate.HQLSample.selectCustomer(HQLSample.java:41)
at Test.doGet(Test.java:38)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:821)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3717)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

Cause
Classloading issues with antlr library bundled with WebLogic Server that is not compatible with Hibernate 3.

Solution
It is necessary to use antlr 2.7.6 (this version works, however more details of which version should be check with Hibernate as being a third party tool).

There are 4 possible workarounds for this classloading issue:

1. Package antlr.jar into WEB-INF/lib and add the following tag to weblogic.xml
    (this works for war alone or packaged into an ear).
<container-descriptor>
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>

2. If it is an ear file then put antlr.jar at APP-INF/lib (or at web application level: WEB-INF/lib) and modify weblogic-application.xml adding the following tag:
<prefer-application-packages>
    <package-name>antlr.*</package-name>
</prefer-application-packages>

3. Change property hibernate.query.factory_class from hibernate configuration file (hibernate.cfg.xml).
    (if hibernate.query.factory_class doesn't exist then this value is assigned by default):
<property name="hibernate.query.factory_class"
 value="org.hibernate.hql.ast.ASTQueryTranslatorFactory">
</property>

to a different parser (classic):

<property name="hibernate.query.factory_class" 
value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory">
</property>

4. Set at server classpath level antlr library before WLS classpath.
    (warning: this is the less recommended option because it impacts the whole WLS and may affect another modules).

    In setDomainEnv.cmd (or any of the start-up scripts) set the next value at the end of the file, referring to antlr library's location:

set CLASSPATH=C:\jars\antlr-2.7.6.jar;%CLASSPATH%

References
http://download.oracle.com/docs/cd/E21764_01/web.1111/e13706/classloading.htm
http://community.jboss.org/wiki/HibernateCoreMigrationGuide30#weblogic

25 October 2011

Matemática, un viaje entretenido

Para los usuarios del Metro de Santiago de Chile hay un concurso de matemáticas que esta abierto hasta el 31 de octubre.

Son preguntas interesantes y alguna conocidas... si se entusiasman vayan al sitio: http://www.unviajeentretenido.cl

Se agradece esta iniciativa hecha por el Metro y la PUC.

Facebook Programming Challenge

For anybody that like to solve puzzles and programming, Facebook has a new challenge:
http://facebook.interviewstreet.com/recruit/challenges

In this case also it is a test for recruiting.

Be careful that is timed programming question therefore be sure to have some free time and without noise :P

UPDATE1: they moved to https://www.hackerrank.com

28 September 2011

Foo

Es conocido las palabras foo y bar para dar ejemplos de programación, lo que no sabia era las otras también utilizadas: baz, qux, quux

Generando el siguiente conjunto de términos:

{ foo, bar, foobar, baz, qux, quux }

07 September 2011

The Bank of San Serriffe

Just checking Knuth's page, I've found out that I appeared twice in The Bank of San Serriffe's balance:
German González-Morris    0x$1.20
German Gonzales-Morris    0x$1.20

It is incredible how many times my last name (being one of the most popular worldwide) is misspelled :D

01 September 2011

Eclipse versions bundled in WebLogic Server

This is a summary of embedded Eclipse versions found in WebLogic Server installations:

WebLogic Server Eclipse OEPE
10.3 only WorkShop --
10.3.1 3.4.2 (Ganymede) 11.1.1.1.1
10.3.2 3.5.0 (Galileo) 11.1.1.3.0
10.3.3 3.5.2 11.1.1.5.0
10.3.4 3.6.1 (Helios) 11.1.1.6.1
10.3.5 3.6.2 11.1.1.7.2
10.3.6 3.7.1 (Indigo) 11.1.1.8.0
12.1.1 3.7.1 12.1.1.0.0
12.1.1 March 2012 3.7.2 12.1.1.0.1
12.1.2 4.3.0 (Kepler) 12.1.2.1
12.1.3 4.3.2 12.1.3
latest standalone 4.4.1 (Luna) 12.1.3.3


WebLogic Server installations can be downloaded from: http://www.oracle.com/technetwork/middleware/weblogic/downloads/index.html

Oracle OEPE can be obtained standalone as well, usually there is newer version too: http://www.oracle.com/technetwork/developer-tools/eclipse/downloads/index.html

Updated: 24-December-2014
 

20 July 2011

04 July 2011

Awkward Javadoc comments

There are several funny Javadoc/Source code explaining methods, properties and/or examples:

1. Catastrophic :
weblogic.cluster.singleton

public interface ClusterLeaderListener 

void localServerLostClusterLeadership()

This method is called if the local server is already the cluster leader i.e. localServerIsClusterLeader() has already been called and subsequently the server loses the cluster leadership. This can only happen under catastrophic conditions. This condition is fatal. 



2. Draconian :
javax.xml.validation.Validator 

setErrorHandler:

class DraconianErrorHandler implements ErrorHandler {
     public void fatalError( SAXParseException e ) throws SAXException {
         throw e;
     }
     public void error( SAXParseException e ) throws SAXException {
         throw e;
     }
     public void warning( SAXParseException e ) throws SAXException {
         // noop
     }
 }

3. Draconian' :


DRACONIAN_ERROR_HANDLER

public static final org.xml.sax.ErrorHandler DRACONIAN_ERROR_HANDLER

// ErrorHandler that always treat the error as fatal.


http://javasourcecode.org/html/open-source/jdk/jdk-6u23/com/sun/xml/internal/ws/util/xml/XmlUtil.java.html#line.300

update 2019-01
4.  do you want to debug ?

 static char* do_you_want_to_debug(const char* message);

http://hg.openjdk.java.net/jdk8u/jdk8u-dev/hotspot/file/d3cc20285653/src/share/vm/runtime/os.hpp#l502

5. OpenJDK source has too many swear words


-                rpnChange(0, 2 << 7);   // Bitch Bend sensitivity
+                rpnChange(0, 2 << 7);   // Pitch Bend sensitivity
 
 
-     * method is a mess, but it is fast and it works, so don't fuck with it.
+     * method is a mess, but it is fast and it works, so don't change it.
  

https://bugs.openjdk.java.net/browse/JDK-8215217
http://hg.openjdk.java.net/jdk/jdk/rev/2cc1ae79b303





08 May 2011

Project Euler

Hace un tiempo publiqué una lista de sitios de competencias de programación y resolución de problemas matemáticos más cercanos a las matemáticas recreativas.

Dentro de los cuales he participado en menor grado en TopCoder y CodeChef que demuestran un nivel de probemas bastante simpáticos, en donde la mayor atracción es la de problemas de larga duración (ó maratones tac como lo menciona topcoder). El otro tipo de competencias son de corto plazo, muy similar a los concursos que hace ACM o una prueba de universidad.

Uno que no habia considerado es Project Euler que esta más cercano a las matemáticas que la programación. En este sitio hay problemas definidos con una solución esperada, única (y no como test cases que se pueden ejecutar para variables en los ya mencionados otros concursos).

Es bastante bueno la interfaz del sitio para encontrar información e ir viendo los avances que uno logra, por otro lado, los primeros problemas son bastantes fáciles y de un nivel adecuado para cursos introductorios de programación (a pesar que vi algunos grupos de alumnos de algoritmos y estrucutras de datos, espero que ete caso los hayan forzado a solucionar los problemas más avanzados).

Esta hecho de tal manera que la dificultad de los problemas van avanzando y así uno va consiguiendo logros tal como si fuese un alumno de karate :P

Creo que hay que seguir con este proyecto, cual tiene una perspertiva diferente y con pensamiento libre.

Por ahora solo 12 problemas resueltos y contando...
(ícono automático con datos):

05 May 2011

WLS: Listing Users and their Groups in a Security Realm

Many times I've seen the question about a WLST script for listing groups to which an user belongs.
(This works Oracle Weblogic Server - Version: 9.0 to 10.3.4)


Before running the script you need to set up the environment to your local WebLogic Server by invoking DOMAIN_NAME\bin\setDomainEnv.cmd (setDomainEnv.sh on UNIX), where DOMAIN_NAME is the directory in which you located the domain


You need to modify the line 6, where set the address, port, username and password of your WebLogic Server:

connect('weblogic','welcome1','t3://127.0.0.1:7001')

and run it with the following command line:

java weblogic.WLST groups_of_users.py
Listing groups_of_users.py:
from weblogic.management.security.authentication import UserReaderMBean
from weblogic.management.security.authentication import GroupReaderMBean
from weblogic.management.security.authentication import MemberGroupListerMBean

# connect to WLS with username/password = weblogic/welcome1
connect('weblogic','welcome1','t3://127.0.0.1:7001')

realm=cmo.getSecurityConfiguration().getDefaultRealm()
atns = realm.getAuthenticationProviders()

for i in atns:
  if isinstance(i,UserReaderMBean):
    userReader = i
    cursor = i.listUsers("*",0)
    # print '* Users in realm '+realm.getName()+' are: '
    while userReader.haveCurrent(cursor):
      # print userReader.getCurrentName(cursor)
      user = userReader.getCurrentName(cursor)

# init

      print ''

    # listings groups of user
      # print "Listing the groups of a '" + user +"'"
      atnr=cmo.getSecurityConfiguration().getDefaultRealm().lookupAuthenticationProvider("DefaultAuthenticator")
      # users? = OracleSystemUser, weblogic
      x = atnr.listMemberGroups(user)
      # print x

      # new pointers for better understanding
      groupReader = atnr
      cursor2 = x
      print "* Groups in user '" + user + "' are: "
      while groupReader.haveCurrent(cursor2):
        print groupReader.getCurrentName(cursor2)
        groupReader.advance(cursor2)
      groupReader.close(cursor2)

# end      
      
      userReader.advance(cursor)
    userReader.close(cursor)
  


Then you will get a similar output to:

* Groups in user 'weblogic' are:
Administrators

* Groups in user 'usertest1' are:
AppTesters
Monitors

25 February 2011

El Rey de e (5x5)

Un nuevo cuadrado encontrado, ahora con 95 dígitos:

2,7182818284590452353602874713526624977572470936999595749669676277240766303535547594571382178525

7 2 0 6 2
1 8 5 5 3
3 7 4 0 9
5 2 7 9 3
6 6 5 6 6

Blog Archive

Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.