Shane Lee

Ranch Hand
+ Follow
since Mar 19, 2005
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shane Lee

Any update on this Sib?

My enterprise application only has a backend, and all ive found on the net is using servlet to initialise the scheduler.
My goal is to automate method invocation on one of my stateless session beans, periodically via cron trigger.

Any clues?
Weblogic 10.3.2
JDK 1.6

I have an enterprise ejb 3.0 application that deploys on weblogic 10. I have no front end just back end. I need to setup quartz/timer at startup to schedule a job via cron trigger, this job is a method invoked on one of my stateless session beans to browse a jms queue.

From all links/references on quartz and looking at ejb timer, i cant see how i can do this without having front end (web.xml) or scheduling the job myself manually somehow.

I see in ejb 3.1 there exists an auto timer that runs from the time the bean is deployed. All you need is a @Schedule annotation on the method, how easy is that!

Can anyone explain how in my application i can setup a startup class to configure the quartz scheduler or achieve my goal?

This seems to work.

13 years ago
I am trying to use Scanner to break up a string that i read in from file.
File data is:

The steps i need to do are:
Get length from :28 to </n0:message>
Prefix this length to before :28 and get rid of the rest

is there a regular expression i can call to get string token from :28 to </n0:message>?
So far i have a delimiter to get string token from :28 but i dont know how to stop at </n0:message>.

This allows me to include the delimiter which i want, but if i wanted to try and include the delimiter but at the end of the token instead of the start how can i achieve this.

If i run this my data will be like:

All i want from my raw data is three tokens:

I hope i havent made this too confusing!


13 years ago
Hi Unu ,
Ha thats a while back since i worked on that! Looked at my existing code that i have on my laptop and this is a code snippet of how i called a stored procedure.

As you can see from the above comment, i use java.sql.CallableStatement now instead of OracleCallableStatement.
13 years ago
Thanks for the reply Joseph, bindings file was already generated for me and copied over.

Problem was:
My fault i did not have the ETC library on the weblogic classpath.

13 years ago
Good post guys.
This is my example to lookup ejb3 stateless session bean locally via web container on weblogic 10.3.2.

DocumentDAOBean class


POJO class:

Funny how different java ee certified servers process for ejb lookups are different...

Weblogic 10.3.2, MQ 5.3
JDK 1.6
Getting a warning when deployin my ear on weblogic:

<Warning> <JMSPool> <BEA-169807> <There was an error while making the initial connection to the JMS resource named XA_JMS_MANAGER from within an EJB or a servlet. The server will attempt the connection again later. The error was javax.jms.JMSException: MQJMS1068: failed to obtain XAResource>

NOTE: MQ and Weblogic reside on different servers

Websphere MQ JMS jar files are on weblogic domain classpath

On weblogic console i have configured a foreign jms server when creating jms module
In my jms module i have a foreign connection factory:

i have defined initial context factory and connection url:

.bindings file and MQ queues were already created for me

In web application, defined resource reference via web.xml and weblogic.xml


On weblogic console, diagnostics i can see the resource in the JNDI tree.

I have replicated another developers environment, so i cant see whats wrong here.
13 years ago
just to follow up on looking/researching online:

From what i can see i have two tables basic_auth_accounts and user_accounts that use the same composite keys realmTypeId, realmQualifier and accountId.
Both entities have embeddable classes with these columns and one-to-one relationships.

I used hibernate tools to generate these entities from the DB schema which i cant change!

Im wondering if i used the same embeddable class for both entities, as in rename BasicAuthAccountsId to a more generic name, remove UserAccountsId and for both entities use the same @EmbeddedId class?
JDK 1.6, JEE5
Hibernate Core 3.3.1.GA, Hibernate Annotations 3.4.0.GA

Used reverse engineering to create my persistence entities from db schema [NB:This is a schema in work i cannot change]

Getting exception when selecting list of basic_auth_accounts org.hibernate.TypeMismatchException: Provided id of the wrong type for class ebusiness.weblogic.model.UserAccounts. Expected: class ebusiness.weblogic.model.UserAccountsId, got class ebusiness.weblogic.model.BasicAuthAccountsId

Both basic_auth_accounts and user_accounts have composite primary keys and one-to-one relationships.
Main Code for classes are:

Any clues what to do here? This is pretty important that i get this to work. Cannot find any substantial solution on the net, some say to create an ID class which hibernate has done, and some say not to have a one-to-one relationship.

Please help me!!
Maven 2.2.0
Eclipse Galileo
M2Eclipe plugin

i have created a new ear project to package my underlying web project in an ear.
the web project eagent build final name is 001.war, instead of for example eagent-1.4-SNAPSHOT.war. They seemingly use /001 as the context path. So i want to try and replicate this in my ear project. When i add the web dependency i set the value of version to the correct version, but that is not the name of the war i want to see in the ear file created, i want to see 001.war. How can i change this or if i uncomment the element contextRoot and set to 001 will that work instead of changing the war name?


Ebusear pom.xml

14 years ago
Sorry my fault, i do not need parent element in ear pom.xml.
14 years ago
Maven 2.2.0
Eclipse Galileo
M2Eclipe plugin

I have three projects:
Ebusiness (parent pom)
Eagent(child of ebusiness, war)

I created a new project to deploy eagent in an ear called EbusEAR01. Below is my pom.xml for ear project:

Eagent pom.xml:

Now the ear contains all dependencies/jars at the root level not just inside the war. is there anyway using maven ear plugin i can exclude the jar files at the root level? i understand that all dependencies should not be at the parent level in ebusiness with scope provided but this is the way its setup and im just trying to add ear functionality. Any ideas?

14 years ago