Friday, December 26, 2014

Wildfly EJB With JPA On A Phone

Seconds to the count down:
9 enter Fedora21
8 start Wildfly
7 add database browser
6 Wildfly up
4 database empty
2 run application
0 object in database

My server(my phone) runs the precidio-jndi-calc.tar.gz software, which calculates resonator designs for buyers with their JPA Buyer accounts like this,

. When a visitor does not have an account, the stateful bean creates a temporary account, which can be viewed in the video's H2 console.

The wildfly web interface is ; database web interface url is . JDBC url and password are in /etc/wildfly/standalone/standalone-full.xmljdbc:h2:mem:test and sa respectively.

The precidio-calc.jar's structure is this,
├── Buyer.class
│   ├── create-script.sql
│   ├── drop-script.sql
│   ├── ejb-jar.xml
│   └── persistence.xml
├── PackagerBean.class
├── PackagerCommonBusiness.class
├── RemoteResonatorCalculator.class
├── RemoteSiliconResonatorCalculator.class
├── ResonatorCalculatorBean.class
└── SiliconResonatorCalculatorBean.class
, which is a standard standalone jar layout, a subset of an EAR. The client layout is this,
├── RemoteCalculatorClient.class
├── RemoteResonatorCalculator.class
└── RemoteSiliconResonatorCalculator.class
, which means that the client does not need to know the bean implementation, just the shell of the different Calculators . The has username and password, which the server side needs to catch up with the client.

The Fedora 21 Wildfly's jar files are split into 2 directories which fails the EJB server startup. To fix it, shell command lines were these, (all these are already done in my Fedora...arm...21-6.tar.gz)
   91  mv /usr/lib/java/hawtjni/* /usr/share/java/hawtjni/
   92  mv /usr/lib/java/hornetq/* /usr/share/java/hornetq/
   93  mv /usr/lib/java/jansi-native/ /usr/share/java/
   94  rmdir /usr/lib/java/hawtjni/
   95  rmdir /usr/lib/java/hornetq/
   96  mv /usr/lib/java/jffi.jar /usr/share/java/
   97  mv /usr/lib/java/jss4.jar /usr/share/java/
   98  mv /usr/lib/java/netty/netty-* /usr/share/java/netty/
   99  rmdir /usr/lib/java/netty/
  100  mv /usr/lib/java/snappy-java/ /usr/share/java/
  101  mv /usr/lib/java/weld-core/* /usr/share/java/weld-core/
  102  rmdir /usr/lib/java/weld-core/
  103  mv /usr/lib/java/wildfly/wildfly-client-all.jar /usr/share/java/wildfly/
  104  cd /usr/lib/java
  106  rmdir wildfly/
  107  cd ../
  108  rmdir java
  109  ln -s /usr/share/java
  129  ln -s /usr/share/java/resteasy/resteasy-json-p-provider-jandex.jar /usr/share/wildfly/modules/system/layers/base/org/jboss/resteasy/resteasy-json-p-provider/main/resteasy-json-p-provider-jandex.jar

I studied the EJB exam and researched on EJB to obtain certification entirely on this phone/tablet/wildfly setting. 

Tuesday, December 9, 2014

An Amazing Dream - typed on the PC phone before getting up

I met my mother in the Starbucks. She got a tan, a toned body, on high heels, approaching my height of 5'11. I walked some yards in my basketball shoes from the plaza of the Home Depot to the Barnes Noble store to meet her and my brother. I asked her about gardening with a species of flower because I didn't know the name of that flower that she used to plant. But she could not recall the name either. I asked my brother , "what is that called in English?" He didn't answer. I said to them that it was time to go back to reading as many books for the afternoon, and maybe one book will reveal the name of the species.

My mother and I embraced and said goodbye, that's how I noticed how tall she was on high heels that day. She tied her hair a pony tail. Her age spot somehow faded blended in with the tanned face. I walked out of the BN store instead of reading the books. The scene was so far all american.

Now it got less american themed, and as I walked back to the plaza of Home Depot back to my car, I tried crossing 2 low fences to shortcut to my car, I got lost in between the parking lots. I started to bump into tall fences and buildings like government facilities. I realized that I ended up in a prison facility. I thought many people must have entered this facility unkowningly or by accident or by a better word here not to be mocked with committing a crime unintentionally. I walked into a house and asked to be pointed to the exit. The prison was in their daily gathering routine. The clerk was a young lady in a blue uniform. She talked to her colleagues saying they have never heard that a person walked in their facility by accident. They started raising suspicion about my identity. She asked me to show my ID. I gave my driver's license, still with my document brief in my underarm, which assured that I was a citizen lay back guy walking down the street.

That was not assuring enough. In side the house, it had partitions made of steel and mesh fences. She told me that she could let me go, but I needed to "reconsider" my action, and "think" clearly. I was confused about the word "think". What did I need to think when I was just walking to my car unless she meant that I was committing a jailbreak? I pulled out my phone with GPS map to figure out how I wound up here. There must be a way to clear the misunderstanding.