This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Modern JavaScript for the Impatient and have Cay Horstmann on-line!
See this thread for details.
Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!

Chris Rowse

Greenhorn
+ Follow
since Aug 02, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chris Rowse

Hi Peter

Apologies, I had already noticed that Eclipse was picking up the Liferay JRE rather than the JDK
and did not make this clear in my posting.

In the .ini file I have tried (at line 18)
C:/jdk1.6.0_25/
C:/jdk1.6.0_25/jre/bin
C:/jdk1.6.0_25/bin

With both forward(/) and backward(\) file separators.
Most Java apps, I find, prefer forward slanting file separators, regardless of OS (Linux, Windows, MAC)

Files which may be of assistance in getting to the root of the problem

eclipse.ini


Environment


window->preferences->java -> Installed JREs

Installed JREs



your assistance is much appreciated
Chris
A week ago, I had a perfect copy of Eclipse, with no errors.
On Thursday 7 July, it started giving the 'Eclipse is running in a JRE.... " message on startup for no apparent reason.

I tried many of the fixes suggested by the authors above based on previous experience.

JAVA_HOME points to C:\jdk1.6.0_25

I have now religiously gone through all the above suggestions to no avail
and now get two errors on starting Eclipse

1) Eclipse is running in a JRE.... "
2) 'Repository registry initialization' has encountered a problem

An internal error occurred during:"Repository registry initialization"

Details>>
Array index out of range.


If I click OK, the messages go away, and Eclipse gives the following when I run maven install

Unable to locate the Javac Compiler in:
[ERROR] C:\apps\liferay-portal-6.0.5\tomcat-6.0.26\jre1.6.0_21\win\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
[ERROR] -> [Help 1]

Eclipse is looking at my server runtime, instead of my compiler path.

I need the liferay/tomcat runtime in my project server path to resolve build and IDE edit dependencied.
The compile should be using my window->java->installedJRE selected JRE (the one that has JDK)

When I look in the properties for my project, I notice that the 'Targeted Runtime' is incorrect.
The correct runtimes are greyed out, and cannot be changed (I need dynamic web nad java 1.5 or greater)
ALL my runtimes are 1.5 or 1.6

If I run Maven on the command line, it works fine
If I open the project in Netbeans it works fine

The space in the path problem has been fixed in most other java apps a decade ago.

What I understand
a) Maven needs a JDK so that it can run its processes - this should come from PATH
b) Eclipse editor needs to know my runtime so it can find runtime dependencies (project properties?)
c) my .war file build needs to know what is in the Liferay environment (JRE)

WHat I cant find - the details of the rruntimes and servers - I can only find the names.

Any more ideas on where the problem may be?
Hi Roseanne

Thanks for the tip, The app is a bit more involved than that & uses a number of resources..

Reason I went away for three days is that I took out and read the FINE MANUALS from Siemens and Sun.

Guess what? If I implement the lifecycle methods required, the app works!

When in doubt, Kick me!

Ah, but of course, as one of my ex-employees once said "But it is so much easier if YOU read the manuals and then explain it all to me"

Chris
16 years ago
Hi,
I'm a newbie to MIDlets, been using Java since 1.0.

I have an App for the Siemens TC45 (117Kb) that compiles and runs both off the command line and in the Sun debugger.

The App simply wont start on the TC45 using at^sjra=

I either get nothing, or an immediate ERROR message from the module. Resetting doesnt seem to help much.

I once got an 'out of memory', but dont think that memory is a problem, since I have too few objects. Most of the code size is taken by ajof.zip, most of which I dont use.

THe App's first line in both the constructor and startApp() methods is to send a static text string to the serial port.

Any ideas would be most welcome
Chris
16 years ago
Hi,
I am having a problem using XDoclet to geterate methods into the local interface. The remote interface is working fine.

Either I am missing something, or there are serious performance gains to be made using XDoclet and EJB.

The generated Local interface looks (IMHO) like a useless extension of the HOME interface!! :-)

On a live bean, deployed in JBoss, about 99% of the time is spent in the getXXX() and setXXX() methods of remote bean. This is acceptible when I access a few beaans individually, but useless if I want to findall() 20000 beans of 50Kb each and do some work on them.

I want to be able to delegate this task to the EE container so everything runs locally, and get rid of the RMI calls.

Using a value object doesnt help since the data must be streamed between the EE container and the web (tomcat) containers.

My thinking is to have a number of Stateless Session beans, that run in the EE container and have the form

public String method() {
// Use JNDI to find Local Business bean
StringBuffer sb = new StringBuffer();
Collection c = bean.findAll();
// Iterate over collection
while (it.hasNext()) {
// get Bean or its attributes
// using REMOTE about 99% of the time is spent HERE
// do something
// log to sb;
// perhaps create some other beans
// can also take substantial time in setXXX) or ejbCreate() methods
}
return sb.toString();
}



Any ideas. or help will be much appreciated.

----------Here is the EJBsource code ---------------------------------------
package natis.ejb;
import java.io.UnsupportedEncodingException;

import java.rmi.*;

import javax.naming.InitialContext;
import javax.naming.NamingException;

import javax.ejb.*;

/**
*
* @ejb.bean
* name="TestBean"
* jndi-name="ejb/TestBeanRemote"
* local-jndi-name="ejb/TestBeanLocal"
* view-type="both"
* type="CMP"
* cmp-version="2.x"
* primkey-field="id"
* local-business-interface="natis.interfaces.TestBeanLocalHome"
* business-interface="natis.interfaces.TestBeanRemoteHome"
*
* @ejb.home
* local-class="natis.interfaces.TestBeanLocalHome"
* remote-class="natis.interfaces.TestBeanRemoteHome"
* @ejb.interface
* local-class="natis.interfaces.TestBeanLocal"
* remote-class="natis.interfaces.TestBeanRemote"
*
* @ejb.finder
* signature="Collection findAll()"
* role-name="Administrator"
* transaction-type="NotSupported"
* unchecked="true"
*
* @ejb.persistence
* read-time-out="10000"
* fetch-size="20"
* table-name="TestBean_001"
*
* @ejb.pk
* generate="true"
* unchecked="true"
*
* @jboss.ejb-external-ref-jndi
* jndi-name="/UUIDKeyGeneratorFactory"
* ref-name="comp:env/keygenerator"
*
*
* @jboss.create-table "${jboss.create.table}"
* @jboss.remove-table "${jboss.remove.table}"
* @jboss.tuned-updates "${jboss.tuned.updates}"
* @jboss.read-only "${jboss.read.only}"
* @jboss.read-ahead strategy="on-load"
* page-size="50"
* eager load group = "TestBeanIndex"
*
* @jboss.persistence
* datasource="java:/DefaultDS"
* datasource-mapping="Hypersonic SQL"
* create-table="true"
* remove-table-"false"
* fetch-size="10"
*
* @ejb.security-identity
* run-as="sa"
*
* @ejb.value-object
* match="*"
*
* @struts.form
* name="Entry"
* include-all="true"
*
* @struts.action
* name="TestSaveAction"
* path="/natis/action/saveTest"
* scope="request"
* roles="*"
*
* @version $Revision: 1.17 $
* @author <a href="mailto:chris@forthtree.co.za@forthtree.co.za">Chris@forth.co.za</a>
*/
public abstract class TestBean implements EntityBean {

EntityContext entityContext;

/**
* EJBCREATE
* @return pk primary key set to null
*
* @ejb.create-method
*/
public String ejbCreate() throws CreateException {
return null;
}
public void ejbPostCreate() throws CreateException {
}

/**
* Id of this TestBean.
*
* @ejb.pk-field
* class="java.lang.String"
* @ejb.persistent-field
* @ejb.interface-method view-type="both"
*
* @ejb.persistence column-name="TestBean_id"
* @ejb.permission
* role-name="Administrator"
*
* @jboss.unknown-pk
* class="java.lang.String"
* readonly="true"
* column-name="TestBean_id"
* sql-type="char(32)"
* //jboss.auto-increment
*
* @jonas.cmp-field-jdbc-mapping
* field-name="id"
* jdbc-field-name="TestBean_id"
*/
public abstract String getId();

/**
* No interface method for setId(..). See page 130 of the EJB 2.0 specification:
* "Once the primary key for an entity bean has been set, the Bean Provider must
* not attempt to change it by use of set accessor methods on the primary key
* cmp-fields. The Bean provider should therefore not expose the set accessor
* methods for the primary key cmp-fields in the component interface of the
* entity bean.". A work around would be to remove and then an re-create the bean.
*/
protected abstract void setId(String id);


/**
* @ejb.permission
* role-name="Administrator"
* @ejb.transaction
* type="Supports"
* @ejb.value-object
* exclude="false"
* match="*"
* @ejb.persistent-field
* @ejb.persistence
* column-name="mfData"
* sql-type="text(500)"
* @ejb.interface-method
* view-type="both"
*
* @struts.form-field
* form-name="Entry"
*
* @jonas.cmp-field-jdbc-mapping
* field-name="mfData"
* jdbc-field-name="mfData"
*/

public abstract String getData();
/**
* @ejb.permission
* role-name="Administrator"
* @ejb.transaction
* type="Supports"
* @ejb.value-object
* exclude="false"
* match="*"
* @ejb.persistent-field
* @ejb.interface-method
* view-type="both"
*
* @struts.form-field
* form-name="Entry"
*
*/
public abstract void setData(String mfData);

/** * @ejb.interface-method
* view-type="local"

*/
public String toIx() {
return getId() + "|" + getData();
}





/**
* Gets the EntityContext. To be used by classes extending this.
* @return the EntityContext of the EJB
*/
protected EntityContext getEntityContext() {
return entityContext;
}

/** Required to implement EntityBean. Sets the EntityContext. */
public void setEntityContext(EntityContext entityContext) throws EJBException {
this.entityContext = entityContext;
}

/** Required to implement EntityBean. Sets the EntityContext to null. */
public void unsetEntityContext() throws EJBException {
entityContext = null;
}

/** Required to implement EntityBean. Not implemented. */
public void ejbActivate() throws EJBException { }

/** Required to implement EntityBean. Not implemented. */
public void ejbPassivate() throws EJBException { }

/** Required to implement EntityBean. Not implemented. */
public void ejbLoad() throws EJBException { }

/** Required to implement EntityBean. Not implemented. */
public void ejbStore() throws EJBException { }

/** Required to implement EntityBean. Not implemented. */
public void ejbRemove() throws RemoveException, EJBException { }




}


---------- Here is the EJBDOCLET tag --------------------------------------
<target depends="prepare" name="ejbdoclet">

<echo>+---------------------------------------------------+</echo>
<echo>| |</echo>
<echo>| R U N N I N G E J B D O C L E T |</echo>
<echo>| |</echo>
<echo>+---------------------------------------------------+</echo>
<!--
-->
<ejbdoclet
destdir="${project.gen-src.dir}"
mergedir="${project.merge.dir}"
excludedtags="@version,@author,@todo"
addedtags="@xdoclet-generated at ${TODAY},@copyright The Forthtree,@author Chris Rowse, @version ${version}"
ejbspec="2.0"
force="${project.xdoclet.force}"
verbose="true"
>

<fileset dir="${project.java.dir}">
<include name="${project}/ssb/*Bean.java"/>

<include name="${project}/ejb/*Bean.java"/>
<include name="${project}/ejb/*BeanMS.java"/>

<include name="${project}/ejb/${project}*.java"/>
<include name="${project}/ejb/*Error.java"/>

<exclude name="${project}/ejb/Base*.java"/>


</fileset>

<fileset dir="${project.tmp.dir}">
<include name="${project}/**/*Bean.java"/>
<include name="${project}/ejb/*BeanMS.java"/>

<include name="${project}/**/*Error.java"/>
</fileset>


<!--
<fileset dir="${project.java.dir}">
<include name="${project}/ssb/*Bean.java"/>
</fileset>
-->
<packageSubstitution packages="ejb" substituteWith="interfaces"/>
<packageSubstitution packages="absbeans" substituteWith="interfaces"/>

<session/>
<remoteinterface/>
<localinterface/>
<homeinterface/>
<localhomeinterface/>
<!--
<dataobject/>
-->

<valueobject/>

<entitypk/>

<entitycmp/>
<entitybmp/>


<dao>
<packageSubstitution packages="ejb" substituteWith="dao"/>
</dao>

<utilobject cacheHomes="true" includeGUID="true"/>

<deploymentdescriptor
description="${project} Deployment"
destdir="${project.target.dir}/META-INF"
mergedir="${project.merge.dir}"
validatexml="true">
<configParam name="clientjar" value="${project}Client.jar"/>
</deploymentdescriptor>


<jboss
version="3.2"
unauthenticatedPrincipal="nobody"
xmlencoding="UTF-8"
destdir="${project.target.dir}/META-INF"
validatexml="true"
preferredrelationmapping="relation-table"
/>

<!--
<weblogic
version="6.1"
xmlencoding="UTF-8"
destdir="${project.target.dir}/META-INF"
validatexml="true"
datasource="java:/${project}DataSource"
mergedir="${project.merge.dir}"
persistence="weblogic"
/>

<jrun
version="4.0"
xmlencoding="UTF-8"
destdir="${project.target.dir}/MNETA-INF"
validatexml="true"
/>

<webSphere destdir="${project.target.dir}/META-INF"/>
-->
<!--
<jonas
version="2.5"
xmlencoding="UTF-8"
destdir="${project.target.dir}/META-INF"
validatexml="false"
mergedir="${project.merge.dir}"
/>

<orion destdir="${project.target.dir}/META-INF"/>

<apachesoap destdir="${project.target.dir}/META-INF"/>
-->

<strutsform/>

<castormapping destdir="${project.target.dir}/META-INF" validatexml="false"/>

</ejbdoclet>

</target>

---------- Here is the generated Remote interface ------------------

/*
* Generated by XDoclet - Do not edit!
*/
package natis.interfaces;

/**
* Remote interface for TestBean.
* @xdoclet-generated at 2-08-04
* @copyright The Forthtree
* @author Chris Rowse
* @version ${version}
*/
public interface TestBeanRemote
extends javax.ejb.EJBObject
{
/**
* Id of this TestBean.
*/
public java.lang.String getId( )
throws java.rmi.RemoteException;

public java.lang.String getData( )
throws java.rmi.RemoteException;

public void setData( java.lang.String mfData )
throws java.rmi.RemoteException;

}



---------- Here is the generated LOCAL interface
/*
* Generated by XDoclet - Do not edit!
*/
package natis.interfaces;

/**
* Local interface for TestBean.
* @xdoclet-generated at 2-08-04
* @copyright The Forthtree
* @author Chris Rowse
* @version ${version}
*/
public interface TestBeanLocal
extends javax.ejb.EJBLocalObject, natis.interfaces.TestBeanLocalHome
{

}
16 years ago