Getting Zekr Beta to build in Eclipse 64bit (OS X 10.6, using Java 64bit)

45 views
Skip to first unread message

zuhaib

unread,
Nov 30, 2009, 4:56:26 PM11/30/09
to zekr-dev
I am running in to some issues with SWT when i try to run the Zekr
inside Eclipse x64 on OS 10.6. It is throwing a "Exception in thread
"main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT
libraries on 64-bit JVM", yet I have done everything that is called
out in this FAQ on the subject http://www.eclipse.org/swt/faq.php#cocoa64launch
yet its a no go.
I am able to build sample code from the eclipse cvs and compile and
display fine with swt running in 64bit mode. When i follow the
traceback of the error I dont see if its a hitch in Zekr code that is
causing it now to play well with swt 64bit or I have some
configuration I am missing.
I have a windows 7 64bit VM install I might try this on next to see if
this is just a local issue.
Thanks.

Zuhaib Siddique

unread,
Nov 30, 2009, 5:14:16 PM11/30/09
to zekr-dev
Well scratch that, I forgot that the swt are included are 32 bit and
need to be replaced.. duh
Well I did that and it seems I am getting other errors which I should
be able to work thru (or on). If anyone is working on it in 64 bit
take a look at this
"
***WARNING: Display must be created on main thread due to Cocoa restrictions.
Exception in thread "main" org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:4031)
at org.eclipse.swt.SWT.error(SWT.java:3946)
at org.eclipse.swt.SWT.error(SWT.java:3917)
at org.eclipse.swt.widgets.Display.error(Display.java:999)
at org.eclipse.swt.widgets.Display.createDisplay(Display.java:776)
at org.eclipse.swt.widgets.Display.create(Display.java:759)
at org.eclipse.swt.graphics.Device.<init>(Device.java:130)
at org.eclipse.swt.widgets.Display.<init>(Display.java:650)
at org.eclipse.swt.widgets.Display.<init>(Display.java:641)
at net.sf.zekr.ZekrMain.startZekr(ZekrMain.java:39)
at net.sf.zekr.ZekrMain.main(ZekrMain.java:88)
"
Zuhaib Siddique
http://www.zuhaiblog.com/
zsid...@gmail.com
> --
>
> You received this message because you are subscribed to the Google Groups "zekr-dev" group.
> To post to this group, send email to zekr...@googlegroups.com.
> To unsubscribe from this group, send email to zekr-dev+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/zekr-dev?hl=en.
>
>
>

Mohsen Saboorian

unread,
Dec 1, 2009, 12:29:54 AM12/1/09
to zekr...@googlegroups.com
Salaam,

Zuhaib, please add -XstartOnFirstThread to your JVM args.

Mohsen

Zuhaib Siddique

unread,
Dec 1, 2009, 12:42:19 AM12/1/09
to zekr-dev
Ah, that fixed it. Also it seems the stable OS X Swt release will
throw out some odd errors, but the dev swt work with Mohsen command.
Do you have more info on that, and what it does. Just want to get an
idea how i did not find it and what it does (i will search as well for
it).

Getting new error (is that not fun), after swt launches.
net.sf.zekr.common.runtime.HtmlGenerationException:
java.lang.ArrayIndexOutOfBoundsException: 1
net.sf.zekr.common.runtime.HtmlRepository.getMixedUri(HtmlRepository.java:142)
net.sf.zekr.common.runtime.HtmlRepository.getMixedUri(HtmlRepository.java:232)
net.sf.zekr.common.runtime.HtmlRepository.getMixedUri(HtmlRepository.java:253)
net.sf.zekr.ui.QuranForm.updateQuranView(QuranForm.java:1418)
net.sf.zekr.ui.QuranForm.updateView(QuranForm.java:1330)
net.sf.zekr.ui.QuranForm.apply(QuranForm.java:1182)
net.sf.zekr.ui.QuranForm.navTo(QuranForm.java:1254)
net.sf.zekr.ui.QuranForm.init(QuranForm.java:305)
net.sf.zekr.ui.QuranForm.<init>(QuranForm.java:258)
net.sf.zekr.ZekrMain.startZekr(ZekrMain.java:51)
net.sf.zekr.ZekrMain.main(ZekrMain.java:88)

result is no display of text of the quran, but audio works (what i
just tested). Will start working backwards on it unless this is an
issue only unique to me or solved.
On Mon, Nov 30, 2009 at 9:29 PM, Mohsen Saboorian <moh...@gmail.com> wrote:
> -XstartOnFirstThread

Mohsen Saboorian

unread,
Dec 1, 2009, 12:49:03 AM12/1/09
to zekr...@googlegroups.com
Please add a breakpoint to getMixedUri(int sura, int aya, boolean update) and check where is the exception coming from. I have no idea.

Mohsen

zuhaib

unread,
Dec 2, 2009, 9:55:39 PM12/2/09
to zekr-dev
Quick update,
I set some breakpoint and etc trying to work backwards was was
throwing the Array error. Ended up changing the way getMixedUri
handled exception and set it to throw e.printStackTrace(); which gave
a much more in depth view as to what threw the
ArrayIndexOutOfBoundsException

Got this
java.lang.ArrayIndexOutOfBoundsException: 1
at net.sf.zekr.common.resource.QuranText.refineRawText(QuranText.java:
130)
at net.sf.zekr.common.resource.QuranText.<init>(QuranText.java:68)
at net.sf.zekr.common.resource.QuranText.getSimpleTextInstance
(QuranText.java:100)
at net.sf.zekr.common.resource.QuranText.getInstance(QuranText.java:
90)
at net.sf.zekr.common.resource.QuranText.getInstance(QuranText.java:
78)
at net.sf.zekr.common.resource.FilteredQuranText.<init>
(FilteredQuranText.java:32)
at net.sf.zekr.common.runtime.HtmlRepository.getMixedUri
(HtmlRepository.java:135)
at net.sf.zekr.common.runtime.HtmlRepository.getMixedUri
(HtmlRepository.java:233)
at net.sf.zekr.common.runtime.HtmlRepository.getMixedUri
(HtmlRepository.java:254)
at net.sf.zekr.ui.QuranForm.updateQuranView(QuranForm.java:1418)
at net.sf.zekr.ui.QuranForm.updateView(QuranForm.java:1330)
at net.sf.zekr.ui.QuranForm.apply(QuranForm.java:1182)
at net.sf.zekr.ui.QuranForm.navTo(QuranForm.java:1254)
at net.sf.zekr.ui.QuranForm.init(QuranForm.java:305)
at net.sf.zekr.ui.QuranForm.<init>(QuranForm.java:258)
at net.sf.zekr.ZekrMain.startZekr(ZekrMain.java:51)
at net.sf.zekr.ZekrMain.main(ZekrMain.java:88)

Code in question is this

private void refineRawText() {
QuranProperties quranProps = QuranProperties.getInstance();
String delim = config.getProps().getString("quran.text.delim");
fullQuran = rawText.split(delim);
String[] sura;
quranText = new String[114][];
int ayaTotalCount = 0;
for (int i = 0; i < 114; i++) {
int ayaCount = quranProps.getSura(i + 1).getAyaCount();
sura = new String[ayaCount];
for (int j = 0; j < ayaCount; j++) {
sura[j] = fullQuran[ayaTotalCount + j];
}
quranText[i] = sura;
ayaTotalCount += ayaCount;
}
}

Why would it throw this issue out in OS X with Java 64 and not in
Windows Java 64 makes me go o_0 I looked and made sure to include as
many vm options from the mac_zekr.sh file in my Eclipse build.

On Nov 30, 9:49 pm, Mohsen Saboorian <mohs...@gmail.com> wrote:
> Please add a breakpoint to getMixedUri(int sura, int aya, boolean update)
> and check where is the exception coming from. I have no idea.
>
> Mohsen
>
> > zsiddi...@gmail.com
>
> > On Mon, Nov 30, 2009 at 9:29 PM, Mohsen Saboorian <mohs...@gmail.com>
> > wrote:
> > > -XstartOnFirstThread
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "zekr-dev" group.
> > To post to this group, send email to zekr...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > zekr-dev+u...@googlegroups.com<zekr-dev%2Bunsu...@googlegroups.com>
> > .

Mohsen Saboorian

unread,
Dec 6, 2009, 10:49:41 AM12/6/09
to zekr...@googlegroups.com
Salaam,

This is most probably an issue with your Quran text file (or \n \r issues) not a JVM bug. Try this out:

replace this line fullQuran = rawText.split(delim); with:
fullQuran = StringUtils.split(rawText, "\r\n"); (also make sure that your Quran text, say simple-quran.txt is in Windows -- \r\n format and has enough data -- at least 6236 lines).

What is the value of 'i' when exception is thrown? Give me value of variables currently on the stack of this method.

Mohsen

To unsubscribe from this group, send email to zekr-dev+u...@googlegroups.com.

zuhaib

unread,
Dec 13, 2009, 7:33:53 PM12/13/09
to zekr-dev
Salam,

First thing I think you got the code mixed up, there is no split
method part of your StringUtils class, unless you are saying use
another one.

It seems the quran-simple.txt had incorrect EOL, after saving the file
in Windows format it ran. Maybe I did something funny to the file
after getting it from CVS or check if its getting the file correctly
in the first place.

The

On Dec 6, 7:49 am, Mohsen Saboorian <mohs...@gmail.com> wrote:
> Salaam,
>
> This is most probably an issue with your Quran text file (or \n \r issues)
> not a JVM bug. Try this out:
>
> replace this line fullQuran = rawText.split(delim); with:
> fullQuran = StringUtils.split(rawText, "\r\n"); (also make sure that your
> Quran text, say simple-quran.txt is in Windows -- \r\n format and has enough
> data -- at least 6236 lines).
>
> What is the value of 'i' when exception is thrown? Give me value of
> variables currently on the stack of this method.
>
> Mohsen
>
> > <zekr-dev%2Bunsu...@googlegroups.com<zekr-dev%252Buns...@googlegroups.com>

Zubair Khan

unread,
Dec 13, 2009, 7:44:13 PM12/13/09
to zekr...@googlegroups.com
Assalamu alaykum guys,

Sorry after our initial contact, I never really got a chance to commit to this project or contribute.  Are you guys still looking for a hand to help out? When I initially contacted the zekr team, I was finishing up school and getting ready to start working.  Alhumdulillah I'm well settled into my new job now.  I'm a Software Engineer at Electronic Arts (the game company) and I primarily work on internal web services in Java.

Please let me know if I can be of any help.

Sincerely,

Zubair Khan
www.zubairkhan.net


To unsubscribe from this group, send email to zekr-dev+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages